Skip to content
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

[BUG] - No module named 'onnxscript._framework_apis.torch_2_7' against PyTorch 2.7 #3297

Open
svekars opened this issue Mar 18, 2025 · 2 comments · Fixed by #3300
Open

[BUG] - No module named 'onnxscript._framework_apis.torch_2_7' against PyTorch 2.7 #3297

svekars opened this issue Mar 18, 2025 · 2 comments · Fixed by #3300
Labels
2.7 bug onnx Issues relating to ONNX

Comments

@svekars
Copy link
Contributor

svekars commented Mar 18, 2025

Add Link

https://pytorch.org/tutorials/beginner/onnx/onnx_registry_tutorial.html
https://pytorch.org/tutorials/beginner/onnx/export_control_flow_model_to_onnx_tutorial.html

Describe the bug

The tutorials are failing with the following error:

Unexpected failing examples:
/var/lib/workspace/beginner_source/onnx/onnx_registry_tutorial.py failed leaving traceback:
Traceback (most recent call last):
  File "/var/lib/workspace/beginner_source/onnx/onnx_registry_tutorial.py", line 99, in <module>
    onnx_program = torch.onnx.export(
  File "/var/lib/ci-user/.local/lib/python3.10/site-packages/torch/onnx/__init__.py", line 364, in export
    return _compat.export_compat(
  File "/var/lib/ci-user/.local/lib/python3.10/site-packages/torch/onnx/_internal/exporter/_compat.py", line 109, in export_compat
    registry = _registration.ONNXRegistry.from_torchlib()
  File "/var/lib/ci-user/.local/lib/python3.10/site-packages/torch/onnx/_internal/exporter/_registration.py", line 164, in from_torchlib
    torchlib_ops = onnxscript_apis.get_torchlib_ops()
  File "/var/lib/ci-user/.local/lib/python3.10/site-packages/torch/onnx/_internal/_lazy_import.py", line 21, in __getattr__
    self._module = importlib.import_module(".", self._name)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'onnxscript._framework_apis.torch_2_7'

and this:

Unexpected failing examples:
/var/lib/workspace/beginner_source/onnx/export_control_flow_model_to_onnx_tutorial.py failed leaving traceback:
Traceback (most recent call last):
  File "/var/lib/workspace/beginner_source/onnx/export_control_flow_model_to_onnx_tutorial.py", line 109, in <module>
    onnx_program = torch.onnx.export(model, (x,), dynamo=True)
  File "/var/lib/ci-user/.local/lib/python3.10/site-packages/torch/onnx/__init__.py", line 364, in export
    return _compat.export_compat(
  File "/var/lib/ci-user/.local/lib/python3.10/site-packages/torch/onnx/_internal/exporter/_compat.py", line 109, in export_compat
    registry = _registration.ONNXRegistry.from_torchlib()
  File "/var/lib/ci-user/.local/lib/python3.10/site-packages/torch/onnx/_internal/exporter/_registration.py", line 164, in from_torchlib
    torchlib_ops = onnxscript_apis.get_torchlib_ops()
  File "/var/lib/ci-user/.local/lib/python3.10/site-packages/torch/onnx/_internal/_lazy_import.py", line 21, in __getattr__
    self._module = importlib.import_module(".", self._name)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'onnxscript._framework_apis.torch_2_7'

build log

Please submit fixes against the 2.7-RC-TEST branch and enable in .jenkins/validate_tutorials_built.py.

Describe your environment

  • CUDA: 12.6
  • PyTorch: 2.7

cc @xadupre

@svekars svekars added bug onnx Issues relating to ONNX labels Mar 18, 2025
@svekars svekars changed the title [BUG] - onnx/onnx_registry_tutorial.py failing against PyTorch 2.7 [BUG] - No module named 'onnxscript._framework_apis.torch_2_7' against PyTorch 2.7 Mar 19, 2025
@svekars svekars added the 2.7 label Mar 19, 2025
@justinchuby
Copy link

Taking a look

@justinchuby

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.7 bug onnx Issues relating to ONNX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants