-
Notifications
You must be signed in to change notification settings - Fork 794
Remove export_for_training #16434
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
Remove export_for_training #16434
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16434
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit cf1a1b7 with merge base 4bf3869 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@tugsbayasgalan has exported this pull request. If you are a Meta employee, you can view the originating Diff in D90114683. |
This PR needs a
|
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.
Pull request overview
This PR removes the deprecated torch.export.export_for_training function and replaces all occurrences with torch.export.export. According to the description, these functions are aliases of each other, and export_for_training was announced for deletion in PyTorch 2.10.
Key Changes:
- Systematically replaced all calls to
torch.export.export_for_training()withtorch.export.export()across the codebase - Updated 7 files including test files, model export scripts, and utility functions
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| exir/tests/test_dim_order_utils.py | Updated test to use torch.export.export instead of deprecated alias |
| examples/mediatek/model_export_scripts/whisper.py | Replaced deprecated calls in encoder and decoder export functions |
| examples/mediatek/model_export_scripts/qwen.py | Updated Qwen model export script to use the non-deprecated function |
| examples/mediatek/model_export_scripts/phi.py | Updated Phi model export script to use the non-deprecated function |
| examples/mediatek/model_export_scripts/gemma.py | Updated Gemma model export script to use the non-deprecated function |
| backends/samsung/utils/export_utils.py | Updated quantization utility to use torch.export.export |
| .ci/scripts/wheel/test_windows.py | Updated Windows wheel test to use the non-deprecated function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| pre_autograd_aten_dialect = torch.export.export_for_training( | ||
| pre_autograd_aten_dialect = torch.export.export( | ||
| model, example_inputs, dynamic_shapes=dynamic_shapes, strict=True | ||
| ).module() # NOTE: Will be replaced with export |
Copilot
AI
Jan 5, 2026
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.
This comment is now outdated. The code has already been updated to use torch.export.export instead of export_for_training, so the note about replacing it with export is no longer accurate and should be removed.
| ).module() # NOTE: Will be replaced with export | |
| ).module() |
| pre_autograd_aten_dialect = torch.export.export_for_training( | ||
| pre_autograd_aten_dialect = torch.export.export( | ||
| model, example_inputs, dynamic_shapes=dynamic_shapes, strict=True | ||
| ).module() # NOTE: Will be replaced with export |
Copilot
AI
Jan 5, 2026
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.
This comment is now outdated. The code has already been updated to use torch.export.export instead of export_for_training, so the note about replacing it with export is no longer accurate and should be removed.
| pre_autograd_aten_dialect = torch.export.export_for_training( | ||
| pre_autograd_aten_dialect = torch.export.export( | ||
| model, example_inputs, strict=True | ||
| ).module() # NOTE: Will be replaced with export |
Copilot
AI
Jan 5, 2026
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.
This comment is now outdated. The code has already been updated to use torch.export.export instead of export_for_training, so the note about replacing it with export is no longer accurate and should be removed.
| ).module() # NOTE: Will be replaced with export | |
| ).module() |
| pre_autograd_aten_dialect = torch.export.export_for_training( | ||
| pre_autograd_aten_dialect = torch.export.export( | ||
| model, example_inputs, dynamic_shapes=dynamic_shapes, strict=True | ||
| ).module() # NOTE: Will be replaced with export |
Copilot
AI
Jan 5, 2026
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.
This comment is now outdated. The code has already been updated to use torch.export.export instead of export_for_training, so the note about replacing it with export is no longer accurate and should be removed.
| ).module() # NOTE: Will be replaced with export | |
| ).module() |
| pre_autograd_aten_dialect = torch.export.export_for_training( | ||
| pre_autograd_aten_dialect = torch.export.export( | ||
| model, example_inputs, dynamic_shapes=dynamic_shapes, strict=True | ||
| ).module() # NOTE: Will be replaced with export |
Copilot
AI
Jan 5, 2026
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.
This comment is now outdated. The code has already been updated to use torch.export.export instead of export_for_training, so the note about replacing it with export is no longer accurate and should be removed.
| ).module() # NOTE: Will be replaced with export | |
| ).module() |
Summary: X-link: pytorch/pytorch#171714 X-link: pytorch/executorch#16434 export_for_training and export are alias to each other. We announced that export_for_training will be deleted in python 2.10. Reviewed By: angelayi Differential Revision: D90114683
Summary: X-link: pytorch/pytorch#171714 X-link: pytorch/executorch#16434 export_for_training and export are alias to each other. We announced that export_for_training will be deleted in python 2.10. Reviewed By: angelayi Differential Revision: D90114683
Summary: X-link: pytorch/pytorch#171714 X-link: pytorch/ao#3571 export_for_training and export are alias to each other. We announced that export_for_training will be deleted in python 2.10. Reviewed By: angelayi Differential Revision: D90114683
0baecf4 to
221dd28
Compare
Summary: X-link: pytorch/executorch#16434 X-link: pytorch/ao#3571 export_for_training and export are alias to each other. We announced that export_for_training will be deleted in python 2.10. Test Plan: CI Reviewed By: angelayi Differential Revision: D90114683
Summary: X-link: pytorch/executorch#16434 X-link: pytorch/ao#3571 export_for_training and export are alias to each other. We announced that export_for_training will be deleted in python 2.10. Test Plan: CI Reviewed By: angelayi Differential Revision: D90114683
Summary: X-link: pytorch/pytorch#171714 X-link: pytorch/executorch#16434 export_for_training and export are alias to each other. We announced that export_for_training will be deleted in python 2.10. Reviewed By: angelayi Differential Revision: D90114683
Summary: X-link: pytorch/pytorch#171714 X-link: pytorch/ao#3571 export_for_training and export are alias to each other. We announced that export_for_training will be deleted in python 2.10. Reviewed By: angelayi Differential Revision: D90114683
221dd28 to
e83fd1e
Compare
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.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary: X-link: pytorch/pytorch#171714 X-link: pytorch/ao#3571 export_for_training and export are alias to each other. We announced that export_for_training will be deleted in python 2.10. Reviewed By: angelayi Differential Revision: D90114683
Summary: X-link: pytorch/pytorch#171714 X-link: pytorch/executorch#16434 export_for_training and export are alias to each other. We announced that export_for_training will be deleted in python 2.10. Reviewed By: angelayi Differential Revision: D90114683
Summary: X-link: pytorch/executorch#16434 X-link: pytorch/ao#3571 export_for_training and export are alias to each other. We announced that export_for_training will be deleted in python 2.10. Test Plan: CI Reviewed By: angelayi Differential Revision: D90114683
e83fd1e to
cf1a1b7
Compare
Summary:
X-link: pytorch/ao#3571
export_for_training and export are alias to each other. We announced that export_for_training will be deleted in python 2.10.
Differential Revision: D90114683