Skip to content

Conversation

@justinchuby
Copy link
Collaborator

@justinchuby justinchuby commented Jan 30, 2025

Deprecation of torch.onnx.dynamo_export:

  • torch/onnx/_internal/_exporter_legacy.py: Added deprecation warnings to the OnnxRegistry, ExportOptions, ONNXRuntimeOptions, and dynamo_export functions, indicating that torch.onnx.dynamo_export is deprecated since version 2.6.0 and should be replaced with torch.onnx.export(..., dynamo=True). [1] [2] [3] [4]

This PR also removed the **_ kwarg on onnx.export such that users get an error when they supply an unexpected augument.

Updated to emit deprecation warning because it is more appropriate: https://docs.python.org/3/library/exceptions.html#DeprecationWarning

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 30, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/146003

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (4 Unrelated Failures)

As of commit 65d9b41 with merge base 32bb6f8 (image):

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the release notes: onnx torch.onnx related changes that should show up in the release notes label Jan 30, 2025
@justinchuby justinchuby added module: onnx Related to torch.onnx topic: deprecation topic category labels Jan 30, 2025
@justinchuby
Copy link
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jan 30, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@justinchuby
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / macos-py3-arm64 / test (default, 2, 3, macos-m1-stable)

Details for Dev Infra team Raised by workflow job

@justinchuby
Copy link
Collaborator Author

@pytorchbot merge -i

@pytorchmergebot
Copy link
Collaborator

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@justinchuby
Copy link
Collaborator Author

@pytorchbot merge

pytorchmergebot pushed a commit that referenced this pull request Jan 31, 2025
…dels_e2e.py (#146095)

With [the deprecation of torch.onnx.dynamo_export](#146003), this PR turns the torch.export related tests toward torch.onn.export(..., dynamo=True), and places it in test_small_models_e2e.py

NOTE: test_exported_program_as_input_from_file and test_onnx_program_supports_retraced_graph are not kept, because they are more of testing whether exported program stays the same after save/load and retrace. However, in torch.onnx.export(..., dynamo=True), we focus more on the export of from nn.Module to ONNX proto.
Pull Request resolved: #146095
Approved by: https://github.com/justinchuby
@atalman
Copy link
Contributor

atalman commented Feb 3, 2025

@pytorchmergebot revert -c nosignal -m "Broke internally"

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Collaborator

@justinchuby your PR has been successfully reverted.

@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Feb 3, 2025
@justinchuby
Copy link
Collaborator Author

@atalman sorry what's broken?

dump_exported_program: bool = False,
artifacts_dir: str | os.PathLike = ".",
fallback: bool = False,
**_,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is it this line?

@justinchuby justinchuby added this to the 2.7.0 milestone Feb 3, 2025
@atalman
Copy link
Contributor

atalman commented Feb 3, 2025

@justinchuby deprecation error is causing unit tests to fail, as the pytorch code still has references to the old torch.onnx.dynamo_export: https://github.com/pytorch/pytorch/blob/main/benchmarks/dynamo/common.py#L2047

@justinchuby
Copy link
Collaborator Author

I see. Is this the only reference? If we remove this reference will it succeed?

@justinchuby
Copy link
Collaborator Author

#146325

@atalman
Copy link
Contributor

atalman commented Feb 3, 2025

hi @justinchuby once #146325 lands please rebase this PR, we should rebase and reimport this PR internally so we can run tests

pytorchmergebot pushed a commit that referenced this pull request Feb 4, 2025
ONNX exporter experiments in benchmark is obsolete and unmaintained. This PR removes it to unblock #146003

Pull Request resolved: #146325
Approved by: https://github.com/titaiwangms
facebook-github-bot pushed a commit to pytorch/benchmark that referenced this pull request Feb 4, 2025
Summary:
ONNX exporter experiments in benchmark is obsolete and unmaintained. This PR removes it to unblock pytorch/pytorch#146003

X-link: pytorch/pytorch#146325
Approved by: https://github.com/titaiwangms

Reviewed By: ZainRizvi

Differential Revision: D69115633

fbshipit-source-id: 20f264458f38d1dafde100970f07b6622e5b3d6e
@justinchuby
Copy link
Collaborator Author

Replaced by #146425

@justinchuby justinchuby closed this Feb 4, 2025
mori360 pushed a commit to mori360/pytorch that referenced this pull request Feb 6, 2025
Deprecation of `torch.onnx.dynamo_export`:

* [`torch/onnx/_internal/_exporter_legacy.py`](diffhunk://#diff-4d1eb96fe68ea904dcd1f8211318b9ff882dbfe4c3cb725ffc164b6c5a58b74cR83-R86): Added deprecation warnings to the `OnnxRegistry`, `ExportOptions`, `ONNXRuntimeOptions`, and `dynamo_export` functions, indicating that `torch.onnx.dynamo_export` is deprecated since version 2.6.0 and should be replaced with `torch.onnx.export(..., dynamo=True)`. [[1]](diffhunk://#diff-4d1eb96fe68ea904dcd1f8211318b9ff882dbfe4c3cb725ffc164b6c5a58b74cR83-R86) [[2]](diffhunk://#diff-4d1eb96fe68ea904dcd1f8211318b9ff882dbfe4c3cb725ffc164b6c5a58b74cR231-R234) [[3]](diffhunk://#diff-4d1eb96fe68ea904dcd1f8211318b9ff882dbfe4c3cb725ffc164b6c5a58b74cR442-R445) [[4]](diffhunk://#diff-4d1eb96fe68ea904dcd1f8211318b9ff882dbfe4c3cb725ffc164b6c5a58b74cR700-R703)

This PR also removed the `**_` kwarg on onnx.export such that users get an error when they supply an unexpected augument.

Updated to emit deprecation warning because it is more appropriate: https://docs.python.org/3/library/exceptions.html#DeprecationWarning
Pull Request resolved: pytorch#146003
Approved by: https://github.com/titaiwangms
mori360 pushed a commit to mori360/pytorch that referenced this pull request Feb 6, 2025
…dels_e2e.py (pytorch#146095)

With [the deprecation of torch.onnx.dynamo_export](pytorch#146003), this PR turns the torch.export related tests toward torch.onn.export(..., dynamo=True), and places it in test_small_models_e2e.py

NOTE: test_exported_program_as_input_from_file and test_onnx_program_supports_retraced_graph are not kept, because they are more of testing whether exported program stays the same after save/load and retrace. However, in torch.onnx.export(..., dynamo=True), we focus more on the export of from nn.Module to ONNX proto.
Pull Request resolved: pytorch#146095
Approved by: https://github.com/justinchuby
mori360 pushed a commit to mori360/pytorch that referenced this pull request Feb 6, 2025
ONNX exporter experiments in benchmark is obsolete and unmaintained. This PR removes it to unblock pytorch#146003

Pull Request resolved: pytorch#146325
Approved by: https://github.com/titaiwangms
pytorchmergebot pushed a commit that referenced this pull request Feb 7, 2025
Reland #146003

Deprecation of `torch.onnx.dynamo_export`:

* [`torch/onnx/_internal/_exporter_legacy.py`]: Added deprecation warnings to the `OnnxRegistry`, `ExportOptions`, `ONNXRuntimeOptions`, and `dynamo_export` functions, indicating that `torch.onnx.dynamo_export` is deprecated since version 2.6.0 and should be replaced with `torch.onnx.export(..., dynamo=True)`.

Pull Request resolved: #146425
Approved by: https://github.com/titaiwangms, https://github.com/atalman
@justinchuby justinchuby removed this from the 2.7.0 milestone Feb 7, 2025
justinchuby added a commit to justinchuby/pytorch that referenced this pull request Feb 11, 2025
Reland pytorch#146003

Deprecation of `torch.onnx.dynamo_export`:

* [`torch/onnx/_internal/_exporter_legacy.py`]: Added deprecation warnings to the `OnnxRegistry`, `ExportOptions`, `ONNXRuntimeOptions`, and `dynamo_export` functions, indicating that `torch.onnx.dynamo_export` is deprecated since version 2.6.0 and should be replaced with `torch.onnx.export(..., dynamo=True)`.

Pull Request resolved: pytorch#146425
Approved by: https://github.com/titaiwangms, https://github.com/atalman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR ciflow/trunk Trigger trunk jobs on your pull request Merged module: onnx Related to torch.onnx open source release notes: onnx torch.onnx related changes that should show up in the release notes Reverted topic: deprecation topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants