diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ExecutionProvider.cpp b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ExecutionProvider.cpp index 75da803817..f97b72aa2d 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ExecutionProvider.cpp +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ExecutionProvider.cpp @@ -961,13 +961,6 @@ namespace Dml assert(!m_closed); m_context->Flush(); } - - void __stdcall ExecutionProviderImpl::FlushAndSync() const - { - Flush(); - m_context->GetCurrentCompletionEvent().WaitForSignal(); - m_context->ReleaseCompletedReferences(); - } void ExecutionProviderImpl::ReleaseCompletedReferences() { diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ExecutionProvider.h b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ExecutionProvider.h index a21d996daa..31b893a2f2 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ExecutionProvider.h +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ExecutionProvider.h @@ -125,7 +125,6 @@ namespace Dml STDMETHOD_(D3D12_COMMAND_LIST_TYPE, GetCommandListTypeForQueue)() const override; STDMETHOD_(void, Flush)() const override; - STDMETHOD_(void, FlushAndSync)() const override; // Waits for flushed work, discards unflushed work, and discards associated references to // prevent circular references. Must be the last call on the object before destruction. diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/FusedGraphKernel.cpp b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/FusedGraphKernel.cpp index 4f72d1dc12..b7f24d49d1 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/FusedGraphKernel.cpp +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/FusedGraphKernel.cpp @@ -72,9 +72,6 @@ namespace Dml m_persistentResourceBinding = DML_BUFFER_BINDING { m_persistentResource.Get(), 0, persistentResourceSize }; } - // For temporary prototyping, allow weight upload to complete before issuing initialization work which reads those weights - m_provider->FlushAndSync(); - ORT_THROW_IF_FAILED(m_provider->InitializeOperator( m_compiledExecutionPlanOperator.Get(), m_persistentResourceBinding ? &*m_persistentResourceBinding : nullptr, diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/IExecutionProvider.h b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/IExecutionProvider.h index f5556ae2ab..d7a0a607cd 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/IExecutionProvider.h +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/IExecutionProvider.h @@ -64,7 +64,6 @@ namespace Dml STDMETHOD_(D3D12_COMMAND_LIST_TYPE, GetCommandListTypeForQueue)() const noexcept = 0; STDMETHOD_(void, Flush)() const noexcept = 0; - STDMETHOD_(void, FlushAndSync)() const noexcept = 0; STDMETHOD_(ID3D12Resource*, DecodeResource)(void* allocation) const noexcept = 0; STDMETHOD(AllocatePooledResource(size_t size, AllocatorRoundingMode roundingMode, ID3D12Resource **d3dResource, IUnknown* *pooledResource)) const noexcept = 0;