-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RELAY][BUG]type inference is slow #7008
Comments
#6900 is my attempt at getting incremental type inference into the PyToch frontend. It will need some serious cleanup, but I think it is useful. It removes the N² thing of re-checking everything in a linearly growing model and empirically reduces the translation time for BERT by ~3x. |
@t-vi Thanks, I have read your PR and discuss thread. But when I use |
@Meteorix the type inferencer in its current form has some issues being incrementalized, the reason it is so slow is people are using it in a N^2 with number of nodes way like @t-vi mentioned. It wasn't originally designed to be used this way and probably needs to be refactored but doing that is relatively complicated. There are some other issues I would like to address at same time and probably won't happen until q1 2021. |
If there is no actionable item, I suggest we merge this particular issue to relay improvements, and close this thread. |
For a large model, tvm compilation is really slow. I perf it and find that type inference costs most of the time.
From my understanding,
PatternRewriter
rewrite every function in a module, then each timePatternRewriter
callsInferType
to infer every function. It should be incremental. Is there any reason why thisincremental
inference is commented? https://github.com/apache/tvm/blob/main/src/relay/transforms/type_infer.cc#L805The text was updated successfully, but these errors were encountered: