-
Notifications
You must be signed in to change notification settings - Fork 24.2k
[ONNX] Migrate onnx ops decomp functions #147469
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
base: gh/justinchuby/111/base
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/147469
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 New Failure, 1 Cancelled JobAs of commit 52f3cfa with merge base bd370c1 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Synced with ONNX Script at microsoft/onnxscript@6f9533e Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> ghstack-source-id: d34741d Pull Request resolved: #147469
Synced with ONNX Script at microsoft/onnxscript@6f9533e Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> ghstack-source-id: 081229b Pull Request resolved: #147469 Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Synced with ONNX Script at microsoft/onnxscript@6f9533e Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> ghstack-source-id: 877bca7 Pull Request resolved: #147469 Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@albanD @malfet, I created this stack which includes a stack that does the necessary refactoring and scaffolding to set up for the onnx decomp logic migration. This PR is still big (18k loc) but the added logic are purely decomp logic code that we moved from onnxscript. Please let me know if this looks good to you |
Synced with ONNX Script at microsoft/onnxscript@6f9533e Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> ghstack-source-id: 877bca7 Pull Request resolved: pytorch#147469 Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Synced with ONNX Script at microsoft/onnxscript@6f9533e Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> ghstack-source-id: 1cda915 Pull Request resolved: pytorch#147469 Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
Stack from ghstack (oldest at bottom):
This is the main PR that adds the onnx decomp functions from onnxscript to pytorch to decouple torch.onnx from implementations in onnxscript. Details of this migration, including how the logic is tested are described in #139301 (comment).
Guide for reviewers
The PR include three parts:
_torchlib/ops
. They are individually tested bytest/onnx/torchlib/test_ops.py
using the added metadata intest/onnx/torchlib/ops_test_data.py
andtest/onnx/torchlib/extra_opinfo.py
.onnxscript
torchlib code to replace"aten::xxx"
keys toaten.xxx
torch op overload objects for accurate registration in core.torch/onnx/_internal/exporter/_registration.py
andtorch/onnx/_internal/exporter/_ir_passes.py
has logic to handle the decomp when they were out of core. These logic were removed.test/onnx/exporter/test_small_models_e2e.py
has a single test for torchvision, which we do not migrate into core. So we remove it until we have a better plan to support torchvision. It is deemed acceptible because torchvision supoport was only a demo in the new exporter previously, and there are way to register torchvision functions using thetorch.onnx.export(..., dynamo=True, custom_translation_table=...)
api for users.Test runtime
Added tests finish within 40 seconds on a 10-core local machine.
Previous work done
Necessary refactoring are done in #147396 and scafolding of tests and logic are added in #147392.
Migration source
Synced with ONNX Script at microsoft/onnxscript@6f9533e
Issue fixed
Fix #139301
Signed-off-by: Justin Chu justinchuby@users.noreply.github.com