mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-18 18:52:16 +00:00
remove unnecessary code
This commit is contained in:
parent
d0cbc65382
commit
b239db05f8
3 changed files with 6 additions and 15 deletions
|
|
@ -140,8 +140,6 @@ class IExecutionProvider {
|
|||
const IKernelLookup& kernel_lookup,
|
||||
const onnxruntime::GraphTransformerManager& graph_transformer_mgr) const;
|
||||
|
||||
virtual bool RequestCustomizedGraphOptimizationForEP() const { return false; }
|
||||
|
||||
/**
|
||||
Get kernel registry per execution provider type.
|
||||
The KernelRegistry share pointer returned is shared across sessions.
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ struct ComputeCapability {
|
|||
ComputeCapability(std::unique_ptr<IndexedSubGraph> t_sub_graph)
|
||||
: sub_graph(std::move(t_sub_graph)) {}
|
||||
|
||||
// optional function to optimize this ComputeCapability
|
||||
// this will be called by ORT once the ComputeCapability is assigned to the EP
|
||||
// Optimization: std::function<Status(const Graph&, const ComputeCapability& this_optimization, ComputeCapability& cc_to_update)>
|
||||
// Optional function to optimize this ComputeCapability.
|
||||
// This will be called by ORT once the ComputeCapability is assigned to the EP
|
||||
// Optimization: std::function<Status(const Graph& graph, const ComputeCapability& this_optimization, ComputeCapability& cc_to_update)>
|
||||
std::function<Status(Graph&, const ComputeCapability&, ComputeCapability&)> optimization_func;
|
||||
|
||||
// optional ComputeCapability instances for sets of nodes within this ComputeCapability that should be optimized.
|
||||
|
|
|
|||
|
|
@ -141,13 +141,6 @@ auto get_capabilities = [](const IExecutionProvider& ep,
|
|||
const onnxruntime::GraphTransformerManager& graph_transformer_manager) {
|
||||
std::vector<std::unique_ptr<ComputeCapability>> capabilities;
|
||||
capabilities = ep.GetCapability(graph_viewer, kernel_lookup, graph_transformer_manager);
|
||||
/*
|
||||
if (ep.RequestCustomizedGraphOptimizationForEP()) {
|
||||
capabilities = ep.GetCapability(graph_viewer, kernel_lookup, graph_transformer_manager);
|
||||
} else {
|
||||
//capabilities = ep.GetCapability(graph_viewer, kernel_lookup);
|
||||
}
|
||||
*/
|
||||
|
||||
// In theory an EP could return an empty capability. Remove those.
|
||||
capabilities.erase(std::remove_if(capabilities.begin(), capabilities.end(),
|
||||
|
|
@ -452,13 +445,13 @@ static Status PartitionOnnxFormatModelImpl(Graph& graph, FuncManager& func_mgr,
|
|||
bool subgraph_assigned_to_ep = false;
|
||||
Node* n = PlaceNode(graph, *capability->sub_graph, fusion_style, type, mode, fused_node_unique_id, &subgraph_assigned_to_ep);
|
||||
|
||||
// If the subgraph is assigned to the ep and the ComputeCapability has nodes_to_optimize,
|
||||
// run EP related optimizations and update compute capability (cc).
|
||||
// If the subgraph is assigned to the EP and the ComputeCapability has nodes_to_optimize,
|
||||
// run EP related optimizations and update ComputeCapability.
|
||||
if (subgraph_assigned_to_ep && !capability->nodes_to_optimize.empty()) {
|
||||
for (auto& optimization_cc : capability->nodes_to_optimize) {
|
||||
if (optimization_cc->optimization_func) {
|
||||
optimization_cc->optimization_func(graph, *optimization_cc, *capability);
|
||||
// #TODO: Handle nested optimization func?
|
||||
// #TODO: Handle nested optimization ComputeCapability
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue