-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[ONNX] Fix onnx custom op export & add initial test case #21321
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
|
hi @houseroad, I'm adding test case for custom op support, that requires JIT C++ extensions. The CI for caffe2_onnx_py2_gcc5_ubuntu16_04_test is throwing errors
Do you have suggestions on how to fix this? |
fd07eca to
25da36b
Compare
|
@pytorchbot retest this please |
|
@pytorchbot rebase this please |
|
Requesting review from @dzhulgakov and/or @houseroad . |
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.
Btw, I am adding/changing the onnx runtime ci.
scripts/onnx/test.sh
Outdated
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.
Remove these debug command?
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.
removed ... from the debug commands it seems the path /usr/local/include/python2.7 doesn't exist, that might be the reason why JIT compiler couldn't find Python.h file.
ce0ee89 to
42bbae7
Compare
42bbae7 to
1e3582d
Compare
1e3582d to
ec394c6
Compare
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. It's fine to skip the custom op test in python 2, since py2 is approaching the end of its life.
|
@houseroad merged this pull request in 319ef3b. |
Summary:
- Fix typo in ```torch/onnx/utils.py``` when looking up registered custom ops.
- Add a simple test case
1. Register custom op with ```TorchScript``` using ```cpp_extension.load_inline```.
2. Register custom op with ```torch.onnx.symbolic``` using ```register_custom_op_symbolic```.
3. Export model with custom op, and verify with Caffe2 backend.
Pull Request resolved: pytorch#21321
Differential Revision: D16101097
Pulled By: houseroad
fbshipit-source-id: 084f8b55e230e1cb6e9bd7bd52d7946cefda8e33
torch/onnx/utils.pywhen looking up registered custom ops.TorchScriptusingcpp_extension.load_inline.torch.onnx.symbolicusingregister_custom_op_symbolic.