[Pass] DynamicToStatic uses InferTypeLocal#9869
Merged
mbrookhart merged 1 commit intoJan 14, 2022
Merged
Conversation
Contributor
Author
|
@mbrookhart so using this decreases pass time from 170s--> ~105s on my computer when running on large BERT model. https://zenodo.org/record/3733910/files/model.onnx E.g.: https://github.com/AndrewZhaoLuo/TVM-Sandbox/blob/main/relay/dynamic_to_static_example.py This model doesn't see any change after dynamic 2 static though, so do you have model that does change significantly? Otherwise I think this is ready to review. |
mbrookhart
approved these changes
Jan 14, 2022
mbrookhart
left a comment
Contributor
There was a problem hiding this comment.
@AndrewZhaoLuo Models that don't change much through this pass tend to be a lot slower than models that do, this is a nice speedup, thank you!
crazydemo
pushed a commit
to crazydemo/tvm
that referenced
this pull request
Jan 27, 2022
Raghav-Chakravarthy
pushed a commit
to Raghav-Chakravarthy/tvm
that referenced
this pull request
Jan 28, 2022
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Feb 16, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DynamicToStatic has the same issue as found in #9735 as it incrementally tries to make dynamic things static throughout the graph, running type inference incrementally along the way. DynamicToStatic is a bit of a slow pass for larger models so this might help.
Unsure if this will speed things up, as I'm unsure how well ConstantFolding works, but first glance it appears to be smart and I think type inference dominates runtime.