-
Notifications
You must be signed in to change notification settings - Fork 57
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
[torchlib] Add the identity nodes back #1703
Conversation
Signed-off-by: Xavier Dupre <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1703 +/- ##
==========================================
+ Coverage 75.75% 76.28% +0.53%
==========================================
Files 240 240
Lines 25495 25496 +1
Branches 4549 4550 +1
==========================================
+ Hits 19313 19449 +136
+ Misses 5281 5159 -122
+ Partials 901 888 -13 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Xavier Dupre <[email protected]>
Signed-off-by: Xavier Dupre <[email protected]>
Signed-off-by: Xavier Dupre <[email protected]>
Signed-off-by: Xavier Dupre <[email protected]>
Could you explain why the change is needed? Thanks! |
It is only a guess. One onnx function was not added to the model. I suspect when one function has no node, it is not added to the final model. I was hoping you could confirm. |
When trying to reproduce, I see the error happens in the optimizer:
|
It is but if you try to load the model with onnxruntime, it fails. The error happens before the optimizer because the model is not valid. It is not detected by check_model or infer_shapes. If you look at the onnx model, you'll see a missing function. |
Thanks for the info, I will look deeper. Do you have the name of the missing function and the error stack from onnx runtime? |
|
Something including dropout in its name. But I don't this matters. I just took the file you modified and replaced |
Sounds good. The changes look good to me. Thanks! |
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.
LGTM. please revert the ci changes thanks!
Co-authored-by: Justin Chu <[email protected]>
Signed-off-by: Xavier Dupre <[email protected]>
In the modularization pass in the exporter, a single node like
clone
can be lifted as a function. If we remove the only Identity node the lifted function will have no nodes. This violates the ONNX standard.Since removing identity nodes is fast, we are safe to include these identity nodes in the torchlib.
onnxscript/tools/transformers_models/phi_test.py broke after #1613, it is fixed by this change.