Skip to content

Remove redundant Resolve() after each inlined function#17556

Merged
yuslepukhin merged 2 commits intomainfrom
yuslepukhin/redundant_resolve
Sep 15, 2023
Merged

Remove redundant Resolve() after each inlined function#17556
yuslepukhin merged 2 commits intomainfrom
yuslepukhin/redundant_resolve

Conversation

@yuslepukhin
Copy link
Copy Markdown
Member

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)

@pranavsharma
Copy link
Copy Markdown
Contributor

This is quite an improvement. How many functions did the graph have?

gramalingam
gramalingam previously approved these changes Sep 14, 2023
pranavsharma
pranavsharma previously approved these changes Sep 14, 2023
@yuslepukhin
Copy link
Copy Markdown
Member Author

yuslepukhin commented Sep 15, 2023

This is quite an improvement. How many functions did the graph have?

I do not have this number ready, but this call accounted for 97% CPU usage.

image

@gramalingam
Copy link
Copy Markdown
Contributor

This is quite an improvement. How many functions did the graph have?

I do not have this number ready, but this call accounted for 97% CPU usage.

image

This is great!

@yuslepukhin yuslepukhin merged commit fdb1326 into main Sep 15, 2023
@yuslepukhin yuslepukhin deleted the yuslepukhin/redundant_resolve branch September 15, 2023 19:13
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
### 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**)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants