diff --git a/include/onnxruntime/core/framework/execution_provider.h b/include/onnxruntime/core/framework/execution_provider.h index 26c300fafd..6d3fa92f9f 100644 --- a/include/onnxruntime/core/framework/execution_provider.h +++ b/include/onnxruntime/core/framework/execution_provider.h @@ -228,15 +228,6 @@ class IExecutionProvider { } #if !defined(ORT_MINIMAL_BUILD) || defined(ORT_EXTENDED_MINIMAL_BUILD) - - /** - * !!!! This API is deprecated. If your execution provider overrides this API - * !!!! Please migrate it to the "Compile" API with FusedNodeAndGraph type. - Given a list of fused_node, return create_state/compute/release_state func for each node. - */ - virtual common::Status Compile(const std::vector& fused_nodes, - std::vector& node_compute_funcs); - /** Given a collection of fused Nodes and the respective GraphViewer instance for the nodes that were fused, return create_state/compute/release_state func for each node. diff --git a/onnxruntime/core/framework/execution_provider.cc b/onnxruntime/core/framework/execution_provider.cc index 94163aba09..ab0a2b3897 100644 --- a/onnxruntime/core/framework/execution_provider.cc +++ b/onnxruntime/core/framework/execution_provider.cc @@ -101,14 +101,6 @@ void IExecutionProvider::RegisterAllocator(AllocatorManager&) { } #if !defined(ORT_MINIMAL_BUILD) || defined(ORT_EXTENDED_MINIMAL_BUILD) -// !!!!This API will be deprecated soon. If your execution provider overrides this API -// !!!!Please migrate it to the "Compile" API with FusedNodeAndGraph type. -common::Status IExecutionProvider::Compile(const std::vector& /*fused_node*/, - std::vector& /*node_compute_funcs*/) { - return common::Status(common::ONNXRUNTIME, common::NOT_IMPLEMENTED, - "IExecutionProvider::Compile with fused Node is not implemented by " + type_); -} - common::Status IExecutionProvider::Compile(const std::vector& /*fused_nodes_and_graphs*/, std::vector& /*node_compute_funcs*/) { return common::Status(common::ONNXRUNTIME, common::NOT_IMPLEMENTED, diff --git a/onnxruntime/core/framework/graph_partitioner.cc b/onnxruntime/core/framework/graph_partitioner.cc index 79f3a389b8..53e8a87c48 100644 --- a/onnxruntime/core/framework/graph_partitioner.cc +++ b/onnxruntime/core/framework/graph_partitioner.cc @@ -42,15 +42,6 @@ NonCudaOps non_cuda; using namespace ::onnxruntime::common; namespace onnxruntime { -#if !defined(ORT_MINIMAL_BUILD) -static void BuildFusedKernelDef(KernelDefBuilder& builder, const onnxruntime::Node& node) { - auto schema = node.Op(); - builder.SetName(schema->Name()) - .SetDomain(schema->domain()) - .SinceVersion(schema->SinceVersion()) - .Provider(node.GetExecutionProviderType()); -} -#endif // minimal KernelDef based on MetaDef instead of a Function based node static void BuildFusedKernelDef(KernelDefBuilder& builder, const IndexedSubGraph::MetaDef& metadef, @@ -371,33 +362,7 @@ static Status PartitionOnnxFormatModelImpl(Graph& graph, FuncManager& func_mgr, // !!! The Function style fusion is deprecated. if (fusion_style == IExecutionProvider::FusionStyle::Function) { // Create a Function based node where the fused nodes have a new Graph instance. - static std::once_flag legacy_compile_method_warning_flag; - std::call_once( - legacy_compile_method_warning_flag, [](std::string_view ep_type) { - LOGS_DEFAULT(WARNING) << "Execution Provider: " << ep_type << " is still using Function style Compile API " - "which is deprecated and will be removed soon. Please migrate to the new Compile " - "API based on FilteredGraphViewer."; - }, - type); - ORT_RETURN_IF_ERROR(current_ep.Compile(nodes_to_compile, node_compute_funcs)); - - if (node_compute_funcs.size() != nodes_to_compile.size()) { - return ORT_MAKE_STATUS(ONNXRUNTIME, FAIL, type, " did not return correct number of compiled functions"); - } - - for (size_t j = 0, end = nodes_to_compile.size(); j < end; j++) { - ORT_RETURN_IF_ERROR(func_mgr.AddFuncInfo(nodes_to_compile[j]->Name(), std::move(node_compute_funcs[j]))); - } - - for (auto* node : nodes_to_compile) { - // add the KernelDef instances for the compiled nodes - KernelDefBuilder builder; - BuildFusedKernelDef(builder, *node); - ORT_RETURN_IF_ERROR(fused_kernel_registry.Register(builder, - [](FuncManager& func_mgr, const OpKernelInfo& info, std::unique_ptr& out) -> Status { - return FunctionKernel::Create(func_mgr, info, out); - })); - } + return ORT_MAKE_STATUS(ONNXRUNTIME, FAIL, type, "The Function Style fusion is deprecated."); } else { // temporary storage for the GraphViewer for each IndexedSubGraph std::vector> viewers; diff --git a/onnxruntime/core/providers/shared_library/provider_bridge_provider.cc b/onnxruntime/core/providers/shared_library/provider_bridge_provider.cc index 0ad2631cec..94048e78a5 100644 --- a/onnxruntime/core/providers/shared_library/provider_bridge_provider.cc +++ b/onnxruntime/core/providers/shared_library/provider_bridge_provider.cc @@ -291,11 +291,6 @@ std::vector> IExecutionProvider::GetCapabilit const std::vector& kernel_registries) const { return g_host->IExecutionProvider__GetCapability(this, graph_viewer, kernel_registries); } -// !!! This API will be deprecated soon. -common::Status IExecutionProvider::Compile(const std::vector& fused_nodes, - std::vector& node_compute_funcs) { - return g_host->IExecutionProvider__Compile(this, fused_nodes, node_compute_funcs); -} common::Status IExecutionProvider::Compile(const std::vector& fused_nodes_and_graphs, std::vector& node_compute_funcs) { return g_host->IExecutionProvider__Compile(this, fused_nodes_and_graphs, node_compute_funcs); diff --git a/onnxruntime/core/providers/shared_library/provider_interfaces.h b/onnxruntime/core/providers/shared_library/provider_interfaces.h index 52b979054f..5c6ac3a623 100644 --- a/onnxruntime/core/providers/shared_library/provider_interfaces.h +++ b/onnxruntime/core/providers/shared_library/provider_interfaces.h @@ -225,8 +225,6 @@ struct ProviderHost { virtual void IExecutionProvider__InsertAllocator(IExecutionProvider* p, AllocatorPtr allocator) = 0; virtual std::vector> IExecutionProvider__GetCapability(const IExecutionProvider* p, const onnxruntime::GraphViewer& graph_viewer, const std::vector& kernel_registries) = 0; - //!!! This API will be deprecated soon - virtual common::Status IExecutionProvider__Compile(IExecutionProvider* p, const std::vector& fused_nodes, std::vector& node_compute_funcs) = 0; virtual common::Status IExecutionProvider__Compile(IExecutionProvider* p, const std::vector& fused_nodes_and_graphs, std::vector& node_compute_funcs) = 0; diff --git a/onnxruntime/core/session/provider_bridge_ort.cc b/onnxruntime/core/session/provider_bridge_ort.cc index 8d89b53701..54aa606bae 100644 --- a/onnxruntime/core/session/provider_bridge_ort.cc +++ b/onnxruntime/core/session/provider_bridge_ort.cc @@ -280,10 +280,6 @@ struct ProviderHostImpl : ProviderHost { void IExecutionProvider__InsertAllocator(IExecutionProvider* p, AllocatorPtr allocator) override { return p->IExecutionProvider::InsertAllocator(allocator); } std::vector> IExecutionProvider__GetCapability(const IExecutionProvider* p, const onnxruntime::GraphViewer& graph_viewer, const std::vector& kernel_registries) override { return p->IExecutionProvider::GetCapability(graph_viewer, kernel_registries); } - // !!! this api will be deprecated soon - common::Status IExecutionProvider__Compile(IExecutionProvider* p, const std::vector& fused_nodes, std::vector& node_compute_funcs) override { - return p->IExecutionProvider::Compile(fused_nodes, node_compute_funcs); - } common::Status IExecutionProvider__Compile(IExecutionProvider* p, const std::vector& fused_nodes_and_graphs, std::vector& node_compute_funcs) override { return p->IExecutionProvider::Compile(fused_nodes_and_graphs, node_compute_funcs); @@ -446,7 +442,7 @@ struct ProviderHostImpl : ProviderHost { std::unique_ptr NodeProto__construct() override { return std::make_unique(); } void NodeProto__operator_delete(ONNX_NAMESPACE::NodeProto* p) override { delete p; } void NodeProto__operator_assign(ONNX_NAMESPACE::NodeProto* p, const ONNX_NAMESPACE::NodeProto& v) override { *p = v; } - int NodeProto__attribute_size(ONNX_NAMESPACE::NodeProto* p) override { return p->attribute_size();} + int NodeProto__attribute_size(ONNX_NAMESPACE::NodeProto* p) override { return p->attribute_size(); } const ONNX_NAMESPACE::AttributeProto& NodeProto__attribute(const ONNX_NAMESPACE::NodeProto* p, int index) const override { return p->attribute(index); } // TensorProto (wrapped) @@ -768,7 +764,7 @@ struct ProviderHostImpl : ProviderHost { IOnnxRuntimeOpSchemaRegistryList({graph_viewer->GetSchemaRegistry()}), graph_viewer->DomainToVersionMap(), #else IOnnxRuntimeOpSchemaRegistryList(), graph_viewer->DomainToVersionMap(), -#endif // ORT_MINIMAL_BUILD +#endif // ORT_MINIMAL_BUILD std::vector(), logger); }