KEMBAR78
[ONNX] Refactor torchscript based exporter by justinchuby · Pull Request #161323 · pytorch/pytorch · GitHub
Skip to content

Conversation

@justinchuby
Copy link
Collaborator

@justinchuby justinchuby commented Aug 22, 2025

Stack from ghstack (oldest at bottom):

Refactor torchscript based exporter logic to move them to a single (private) location for better code management. Original public module and method apis are preserved.

  • Updated module paths in torch/csrc/autograd/python_function.cpp accordingly
  • Removed check_onnx_broadcast from torch/autograd/_functions/utils.py because it is private&unused

@albanD / @soulitzer could you review changes in torch/csrc/autograd/python_function.cpp and
torch/autograd/_functions/utils.py? Thanks!

BC Breaking

  • Deprecated members in torch.onnx.verification are removed

cc @titaiwangms @albanD

Differential Revision: D81236421

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Aug 22, 2025

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 153c848 with merge base 378edb0 (image):
💚 Looks good so far! There are no failures yet. 💚

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 Aug 22, 2025
justinchuby added a commit that referenced this pull request Aug 22, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 0a2854e
Pull Request resolved: #161323
[ghstack-poisoned]
justinchuby added a commit that referenced this pull request Aug 22, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 1c4e008
Pull Request resolved: #161323

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby justinchuby added the module: onnx Related to torch.onnx label Aug 22, 2025
@justinchuby justinchuby marked this pull request as draft August 22, 2025 23:19
justinchuby added a commit to justinchuby/pytorch that referenced this pull request Aug 25, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 1c4e008
Pull Request resolved: pytorch#161323

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
justinchuby added a commit to justinchuby/pytorch that referenced this pull request Aug 25, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 1c4e008
Pull Request resolved: pytorch#161323

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
justinchuby added a commit to justinchuby/pytorch that referenced this pull request Aug 25, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 1c4e008
Pull Request resolved: pytorch#161323

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
[ghstack-poisoned]
justinchuby added a commit that referenced this pull request Aug 25, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 027c5bd
Pull Request resolved: #161323

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby justinchuby added topic: bc breaking topic category suppress-bc-linter Suppresses the failures of API backward-compatibility linter (Lint/bc_linter) labels Aug 25, 2025
@justinchuby justinchuby marked this pull request as ready for review August 25, 2025 22:18
@justinchuby justinchuby reopened this Aug 25, 2025
[ghstack-poisoned]
justinchuby added a commit that referenced this pull request Aug 25, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 34a7ba7
Pull Request resolved: #161323

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
justinchuby added a commit that referenced this pull request Aug 25, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 34a7ba7
Pull Request resolved: #161323

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
[ghstack-poisoned]
justinchuby added a commit to justinchuby/pytorch that referenced this pull request Aug 25, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 64d66f1
Pull Request resolved: pytorch#161323

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
justinchuby added a commit to justinchuby/pytorch that referenced this pull request Aug 25, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 64d66f1
Pull Request resolved: pytorch#161323

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby justinchuby added the keep-going Don't stop on first failure, keep running tests until the end label Aug 27, 2025
[ghstack-poisoned]
justinchuby added a commit to justinchuby/pytorch that referenced this pull request Aug 27, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 36ef09c
Pull Request resolved: pytorch#161323

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby justinchuby added ciflow/trunk Trigger trunk jobs on your pull request skip-pr-sanity-checks labels Aug 27, 2025
@angelayi
Copy link
Contributor

@angelayi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

[ghstack-poisoned]
justinchuby added a commit to justinchuby/pytorch that referenced this pull request Aug 29, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 31e64f4
Pull Request resolved: pytorch#161323

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@angelayi
Copy link
Contributor

@angelayi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@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

Starting merge as part of PR stack under #161449

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #161546

pytorchmergebot pushed a commit that referenced this pull request Sep 2, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

Pull Request resolved: #161449
Approved by: https://github.com/xadupre, https://github.com/titaiwangms
ghstack dependencies: #161323
pytorchmergebot pushed a commit that referenced this pull request Sep 2, 2025
Remove import of two functions

- _run_symbolic_function
- _run_symbolic_method

to the `torch.onnx` namespace.

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

Pull Request resolved: #161546
Approved by: https://github.com/titaiwangms
ghstack dependencies: #161323, #161449
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
Refactor torchscript based exporter logic to move them to a single (private) location for better code management. Original public module and method apis are preserved.

- Updated module paths in `torch/csrc/autograd/python_function.cpp` accordingly
- Removed `check_onnx_broadcast` from `torch/autograd/_functions/utils.py` because it is private&unused

@albanD / @soulitzer could you review changes in `torch/csrc/autograd/python_function.cpp` and
`torch/autograd/_functions/utils.py`? Thanks!

## BC Breaking
- **Deprecated members in `torch.onnx.verification` are removed**

Differential Revision: [D81236421](https://our.internmc.facebook.com/intern/diff/D81236421)
Pull Request resolved: pytorch#161323
Approved by: https://github.com/titaiwangms, https://github.com/angelayi
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…#161449)

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

Pull Request resolved: pytorch#161449
Approved by: https://github.com/xadupre, https://github.com/titaiwangms
ghstack dependencies: pytorch#161323
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
Remove import of two functions

- _run_symbolic_function
- _run_symbolic_method

to the `torch.onnx` namespace.

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

Pull Request resolved: pytorch#161546
Approved by: https://github.com/titaiwangms
ghstack dependencies: pytorch#161323, pytorch#161449
mansiag05 pushed a commit to mansiag05/pytorch that referenced this pull request Sep 22, 2025
Refactor torchscript based exporter logic to move them to a single (private) location for better code management. Original public module and method apis are preserved.

- Updated module paths in `torch/csrc/autograd/python_function.cpp` accordingly
- Removed `check_onnx_broadcast` from `torch/autograd/_functions/utils.py` because it is private&unused

@albanD / @soulitzer could you review changes in `torch/csrc/autograd/python_function.cpp` and
`torch/autograd/_functions/utils.py`? Thanks!

## BC Breaking
- **Deprecated members in `torch.onnx.verification` are removed**

Differential Revision: [D81236421](https://our.internmc.facebook.com/intern/diff/D81236421)
Pull Request resolved: pytorch#161323
Approved by: https://github.com/titaiwangms, https://github.com/angelayi
mansiag05 pushed a commit to mansiag05/pytorch that referenced this pull request Sep 22, 2025
…#161449)

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

Pull Request resolved: pytorch#161449
Approved by: https://github.com/xadupre, https://github.com/titaiwangms
ghstack dependencies: pytorch#161323
mansiag05 pushed a commit to mansiag05/pytorch that referenced this pull request Sep 22, 2025
Remove import of two functions

- _run_symbolic_function
- _run_symbolic_method

to the `torch.onnx` namespace.

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

Pull Request resolved: pytorch#161546
Approved by: https://github.com/titaiwangms
ghstack dependencies: pytorch#161323, pytorch#161449
@github-actions github-actions bot deleted the gh/justinchuby/113/head branch October 3, 2025 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request keep-going Don't stop on first failure, keep running tests until the end Merged module: onnx Related to torch.onnx open source release notes: onnx torch.onnx related changes that should show up in the release notes skip-pr-sanity-checks suppress-bc-linter Suppresses the failures of API backward-compatibility linter (Lint/bc_linter) topic: bc breaking topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants