Skip to content

Conversation

@lara-hdr
Copy link
Contributor

@lara-hdr lara-hdr commented Apr 15, 2019

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.

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Apr 15, 2019
@lara-hdr
Copy link
Contributor Author

@houseroad could you take a look at this? thanks :)

Copy link
Member

@houseroad houseroad left a 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.

@houseroad
Copy link
Member

tests are still failing

@ezyang ezyang added the module: onnx Related to torch.onnx label Apr 19, 2019
@lara-hdr
Copy link
Contributor Author

@houseroad, looking into the failure of test_dist_broadcast_coalesced_gloo, the other tests are passing

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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
Copy link
Member

rebase to resolve the conflict?

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

Copy link
Member

@houseroad houseroad left a 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)

@lara-hdr
Copy link
Contributor Author

The user does not call sym_registry.register_version('', 9).
sym_registry.register_version is already called in the export functions in utils.py with the specified opset.
So calling torch.onnx.export() is sufficient, and will register the specified function (or default version in case none is specified).


# 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
Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.

@houseroad
Copy link
Member

Lint the code?

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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
Copy link
Member

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@pytorchbot pytorchbot added module: docs Related to our documentation, both in docs/ and docblocks module: internals Related to internal abstractions in c10 and ATen labels May 10, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

Copy link
Member

@houseroad houseroad left a 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!

@lara-hdr
Copy link
Contributor Author

Thank you @houseroad!

zdevito pushed a commit to zdevito/ATen that referenced this pull request May 11, 2019
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
@facebook-github-bot
Copy link
Contributor

@houseroad merged this pull request in f4d9bfa.

facebook-github-bot pushed a commit that referenced this pull request Jun 27, 2019
Summary:
Refactor tests for #19294.
Pull Request resolved: #20036

Reviewed By: zrphercule

Differential Revision: D16016593

Pulled By: houseroad

fbshipit-source-id: eaae324e347679acf3d0ac1c14be03919f54496e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: docs Related to our documentation, both in docs/ and docblocks module: internals Related to internal abstractions in c10 and ATen module: onnx Related to torch.onnx oncall: jit Add this issue/PR to JIT oncall triage queue open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants