From 2ab09dedb7dafbce98c5207729692d4e9bf287a2 Mon Sep 17 00:00:00 2001 From: Bryan Bernhart Date: Thu, 4 Aug 2022 16:33:58 -0700 Subject: [PATCH] Roll GPGMM * Depreciate ResidencySet with ResidencyList. * Depreciate Heap::As with ComPtr:As. --- DEPS | 2 +- src/webnn/native/dmlx/deps/src/device.cpp | 14 +++++++------- src/webnn/native/dmlx/deps/src/device.h | 2 +- src/webnn/native/dmlx/deps/src/util.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/DEPS b/DEPS index f51dec653..fb809954e 100644 --- a/DEPS +++ b/DEPS @@ -55,7 +55,7 @@ deps = { }, # GPGMM support for fast DML allocation and residency management. 'third_party/gpgmm': { - 'url': '{github_git}/intel/gpgmm.git@61fcfcbd872b7643423ac8c9555f3a6a366904ee', + 'url': '{github_git}/intel/gpgmm.git@ff03c9a0cea262e534d25257512f2ba2bdb8c2d4', 'condition': 'checkout_win', }, 'third_party/oneDNN': { diff --git a/src/webnn/native/dmlx/deps/src/device.cpp b/src/webnn/native/dmlx/deps/src/device.cpp index f80101985..ce5a19156 100644 --- a/src/webnn/native/dmlx/deps/src/device.cpp +++ b/src/webnn/native/dmlx/deps/src/device.cpp @@ -19,7 +19,7 @@ SVDescriptorHeap::SVDescriptorHeap( ID3D12DescriptorHeap* SVDescriptorHeap::GetDescriptorHeap() const { ComPtr descriptorHeap; - m_Heap->As(&descriptorHeap); + m_Heap.As(&descriptorHeap); return descriptorHeap.Get(); } @@ -574,8 +574,8 @@ HRESULT Device::ExecuteCommandListAndWait() ID3D12CommandList* commandLists[] = { m_commandList.Get() }; if (m_residencyManager != nullptr){ - gpgmm::d3d12::ResidencySet* residencySets[] = { &m_residencySet }; - m_residencyManager->ExecuteCommandLists(m_commandQueue.Get(), commandLists, residencySets, ARRAYSIZE(commandLists)); + gpgmm::d3d12::ResidencyList* residencyLists[] = { &m_residencyList }; + m_residencyManager->ExecuteCommandLists(m_commandQueue.Get(), commandLists, residencyLists, ARRAYSIZE(commandLists)); } else { m_commandQueue->ExecuteCommandLists(ARRAYSIZE(commandLists), commandLists); } @@ -584,7 +584,7 @@ HRESULT Device::ExecuteCommandListAndWait() ReturnIfFailed(m_commandAllocator->Reset()); ReturnIfFailed(m_commandList->Reset(m_commandAllocator.Get(), nullptr)); - ReturnIfFailed(m_residencySet.Reset()); + ReturnIfFailed(m_residencyList.Reset()); return S_OK; } @@ -633,7 +633,7 @@ HRESULT Device::EnsureCpuBufferSize(uint64_t requestedSizeInBytes, _Inout_ ComPt ReturnIfFailed(CreateCpuCustomBuffer(m_resourceAllocator.Get(), newSize, buffer)); } - UpdateResidencyIfNeeded(buffer.Get(), &m_residencySet); + UpdateResidencyIfNeeded(buffer.Get(), &m_residencyList); return S_OK; } @@ -650,7 +650,7 @@ HRESULT Device::EnsureDefaultBufferSize(uint64_t requestedSizeInBytes, _Inout_ C ReturnIfFailed(CreateDefaultBuffer(m_resourceAllocator.Get(), newSize, buffer)); } - UpdateResidencyIfNeeded(buffer.Get(), &m_residencySet); + UpdateResidencyIfNeeded(buffer.Get(), &m_residencyList); return S_OK; } @@ -709,7 +709,7 @@ HRESULT Device::EnsureReadBackHeapSize(uint64_t requestedSizeInBytes) ReturnIfFailed(CreateReadBackBuffer(m_resourceAllocator.Get(), newSize, m_readbackHeap)); } - UpdateResidencyIfNeeded(m_readbackHeap.Get(), &m_residencySet); + UpdateResidencyIfNeeded(m_readbackHeap.Get(), &m_residencyList); return S_OK; } diff --git a/src/webnn/native/dmlx/deps/src/device.h b/src/webnn/native/dmlx/deps/src/device.h index 55e3f7b7e..af7e277af 100644 --- a/src/webnn/native/dmlx/deps/src/device.h +++ b/src/webnn/native/dmlx/deps/src/device.h @@ -98,7 +98,7 @@ namespace pydml Microsoft::WRL::ComPtr m_temporaryResource; Microsoft::WRL::ComPtr m_persistentResource; - gpgmm::d3d12::ResidencySet m_residencySet; + gpgmm::d3d12::ResidencyList m_residencyList; bool m_useCpuCustomHeapResources = false; bool m_useGpu = true; diff --git a/src/webnn/native/dmlx/deps/src/util.h b/src/webnn/native/dmlx/deps/src/util.h index 7f9d99459..4466575cd 100644 --- a/src/webnn/native/dmlx/deps/src/util.h +++ b/src/webnn/native/dmlx/deps/src/util.h @@ -116,9 +116,9 @@ struct DmlBufferArrayBinding } }; -inline void UpdateResidencyIfNeeded(gpgmm::d3d12::ResourceAllocation* resource, gpgmm::d3d12::ResidencySet* residencySet){ +inline void UpdateResidencyIfNeeded(gpgmm::d3d12::ResourceAllocation* resource, gpgmm::d3d12::ResidencyList* residencyList){ if (resource == nullptr) return; - residencySet->Insert(resource->GetMemory()); + residencyList->Add(resource->GetMemory()); } inline HRESULT CreateResource(