-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Support Exports to Multiple ONNX Opset #19294
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
Conversation
|
@houseroad could you take a look at this? thanks :) |
houseroad
left a comment
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.
This is a great effort for supporting multiple onnx opset. Could you fix the failing tests first? I will do a full review later.
|
tests are still failing |
|
@houseroad, looking into the failure of test_dist_broadcast_coalesced_gloo, the other tests are passing |
facebook-github-bot
left a comment
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.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
rebase to resolve the conflict? |
facebook-github-bot
left a comment
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.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
houseroad
left a comment
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.
by default, the exporter should just export the model to the default opset.
If user would like to export to a different opset, it can just specify the target opset using the parameter (we already have it).
We should not ask the users to call sym_registry.register_version('', 9)
|
The user does not call sym_registry.register_version('', 9). |
|
|
||
| # Blacklist operators for this opset version. | ||
| # These operators have been updated in ONNX but not re-implemented here. | ||
| # It is very important to blacklist these operators to avoid exporting |
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.
@houseroad, this is the code for the blacklisting.
_black_list_in_opset() is defined in symbolic_helper.py.
These lines will redefine the ops in black_listed_operators to raise a warning.
I am adding a test test_blacklisted_ops() in test_verify to test this, in #20036.
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.
You can find the full list of changed ops in opset 10 here
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.
adding maxpool, averagepool and dropout.
The other ops are not in opset 9.
|
Lint the code? |
facebook-github-bot
left a comment
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.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
add a comment about _registry
facebook-github-bot
left a comment
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.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
The failed onnx test is legit: https://circleci.com/api/v1.1/project/github/pytorch/pytorch/1650207/output/104/0?file=true You may want to add the max_pool in this pr as well. |
facebook-github-bot
left a comment
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.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
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.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
houseroad
left a comment
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.
Looks good to me. Thanks a lot of this great effort!
|
Thank you @houseroad! |
Summary: Support exporting multiple ONNX opsets (more specifically opset 10 for now), following the proposal in https://gist.github.com/spandantiwari/99700e60919c43bd167838038d20f353. And add support for custom ops (merge with pytorch/pytorch#18297). This PR will be followed by another PR containing the changes related to testing the ops for different opsets. Pull Request resolved: pytorch/pytorch#19294 Reviewed By: zrphercule Differential Revision: D15043951 Pulled By: houseroad fbshipit-source-id: d336fc35b8827145639137bc348ae07e3c14bb1c
|
@houseroad merged this pull request in f4d9bfa. |
Support exporting multiple ONNX opsets (more specifically opset 10 for now), following the proposal in https://gist.github.com/spandantiwari/99700e60919c43bd167838038d20f353.
And add support for custom ops (merge with #18297).
This PR will be followed by another PR containing the changes related to testing the ops for different opsets.