-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[ONNX] Use the torchlib opset number and fix opset import logic #141413
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/141413
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 9e84596 with merge base 259a00b ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…logic" - Update the ONNX IR `add_opset_imports` pass to remove the heuristics of taking the `max` of the seen opsets. Instead, it uses the torchlib default opset version for the model's opset_import. The version converter is able to take the true opset versions in the nodes and convert the model to the correct version. - Update all hard coding of opset 18 to instead query the default torchlib opset from onnxscript, introduced in microsoft/onnxscript#1963 Fixes #141260 [ghstack-poisoned]
| # so we don't need to specifically process them. | ||
| with onnxscript.evaluator.default_as(tracer): | ||
| output = onnxscript.opset18.Concat(*sequence_mixed_elements, axis=0) # type: ignore[type-var] | ||
| output = onnxscript_apis.torchlib_opset().Concat( |
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.
Ops in _building.py also needs the changes?
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.
The opset version is used in https://github.com/pytorch/pytorch/pull/141413/files#diff-c2f19ccd7bc57c1edd3281f4d758f616c933599307fded5d3ad3d063a5313222R115 which is then used in
| opset = _get_onnxscript_opset(registry.opset_version) |
| return onnxscript.values.Opset("", opset_version) |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…rch#141413) - Update the ONNX IR `add_opset_imports` pass to remove the heuristics of taking the `max` of the seen opsets. Instead, it uses the torchlib default opset version for the model's opset_import. The version converter is able to take the true opset versions in the nodes and convert the model to the correct version. - Update all hard coding of opset 18 to instead query the default torchlib opset from onnxscript, introduced in microsoft/onnxscript#1963 Fixes pytorch#141260 Pull Request resolved: pytorch#141413 Approved by: https://github.com/titaiwangms
…rch#141413) - Update the ONNX IR `add_opset_imports` pass to remove the heuristics of taking the `max` of the seen opsets. Instead, it uses the torchlib default opset version for the model's opset_import. The version converter is able to take the true opset versions in the nodes and convert the model to the correct version. - Update all hard coding of opset 18 to instead query the default torchlib opset from onnxscript, introduced in microsoft/onnxscript#1963 Fixes pytorch#141260 Pull Request resolved: pytorch#141413 Approved by: https://github.com/titaiwangms
Stack from ghstack (oldest at bottom):
add_opset_importspass to remove the heuristics of taking themaxof the seen opsets. Instead, it uses the torchlib default opset version for the model's opset_import. The version converter is able to take the true opset versions in the nodes and convert the model to the correct version.Fixes #141260