mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-18 21:21:17 +00:00
Remove redundant Resolve() after each inlined function (#17556)
### Description Remove `Resolve()` on the entire graph as each function is resolved. We retain `Resolve()` after each inlining iteration. ### Motivation and Context Poor performance for inlining the model and session initialization. Original model before Resolve() removal FunctionTest.Profiling (**65953 ms**) After Resolve() Removal FunctionTest.Profiling (**2911 ms**) RelWithDebInfo pre-inlined model. Presumably because it runs Level1 optimizers Non-inlined model consists of functions and Level1 optimizers have no effect. FunctionTest.Profiling (**9851 ms**)
This commit is contained in:
parent
adb0be45d3
commit
fdb132643d
3 changed files with 2 additions and 3 deletions
|
|
@ -1135,6 +1135,7 @@ class Graph {
|
|||
|
||||
/**
|
||||
Directly insert the nodes in the function Node provided into this Graph.
|
||||
The Graph needs to be Resolve()d after this call.
|
||||
@param node Node with Node::Type of Node::Type::Fused
|
||||
@returns Status indicating success or providing an error message.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4145,8 +4145,6 @@ Status Graph::InlineFunction(Node& callnode) {
|
|||
|
||||
// std::cout << "Graph after inlining\n\n" << *this << std::endl << std::flush;
|
||||
|
||||
ORT_RETURN_IF_ERROR(this->Resolve());
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ void OpFunctionTester::RunFunctionBodyGraphOnCPU(TwoDArray& results) {
|
|||
|
||||
auto& node = *graph.Nodes().begin();
|
||||
ASSERT_EQ(node.OpType(), op);
|
||||
// Inline function will call Resolve itself
|
||||
ASSERT_STATUS_OK(graph.InlineFunction(node));
|
||||
ASSERT_STATUS_OK(graph.Resolve());
|
||||
|
||||
// Hookup the inputs and outputs
|
||||
std::unordered_map<std::string, OrtValue> feeds;
|
||||
|
|
|
|||
Loading…
Reference in a new issue