-
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][Frontend][Onnx] Auto extract onnx input shapes when possible. #7115
Conversation
@masahi @hogepodge can you guys take a look at this PR? Let me know if there are other default behaviors we should consider. |
Hey this looks similar to #7055. Could you also review that PR to see how should we proceed? |
@comaniac thanks for pointing that out, you're right that there's a lot of overlap. I looked over #7055 and think that the implementation in this PR is cleaner and probably the one we want to merge. I added the removal of shape_dict in the tvmc frontend converter as well to make sure there's feature parity for both implementations. @dlexplorer are you ok with closing your PR and getting this one merged instead? |
Looks good. |
@mbrookhart can you also weigh in on this implementation vs that in #7055? |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main complaint with #7055 was the handling of dynamic shapes, it seems you've covered that here.
Seems like we might have hit a flaky cudnn test. I'll try rebasing and recommitting. |
82069c1
to
895954f
Compare
it may sense to remove shape init from this script as well: https://github.com/apache/tvm/blob/main/apps/wasm-standalone/wasm-graph/tools/build_graph_lib.py#L32 |
…apache#7115) * Auto extract onnx input shapes when possible. * Remove shape dict definition in tvmc.
…apache#7115) * Auto extract onnx input shapes when possible. * Remove shape dict definition in tvmc.
…apache#7115) * Auto extract onnx input shapes when possible. * Remove shape dict definition in tvmc.
Onnx has shapes associated with each input in the graph. In many cases, there is no need for users to specify those shapes since we can simply pull them out. In the onnx importer today, however, an error is thrown whenever shapes aren't explicitly provided. This PR changes that behavior and should make the importer much more user friendly. If an input shape can be extracted and is static, it does not need to be passed in as a shape dictionary. If there are unknown shapes, the importer will raise a warning but continue assuming they're dynamic.