Skip to content

Conversation

@tugsbayasgalan
Copy link
Contributor

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

Copilot AI review requested due to automatic review settings January 5, 2026 15:58
@pytorch-bot
Copy link

pytorch-bot bot commented Jan 5, 2026

🔗 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 (image):

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.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 5, 2026
@meta-codesync
Copy link

meta-codesync bot commented Jan 5, 2026

@tugsbayasgalan has exported this pull request. If you are a Meta employee, you can view the originating Diff in D90114683.

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copy link
Contributor

Copilot AI left a 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() with torch.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
Copy link

Copilot AI Jan 5, 2026

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.

Suggested change
).module() # NOTE: Will be replaced with export
).module()

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Jan 5, 2026

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.

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Jan 5, 2026

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.

Suggested change
).module() # NOTE: Will be replaced with export
).module()

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Jan 5, 2026

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.

Suggested change
).module() # NOTE: Will be replaced with export
).module()

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Jan 5, 2026

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.

Suggested change
).module() # NOTE: Will be replaced with export
).module()

Copilot uses AI. Check for mistakes.
tugsbayasgalan added a commit to tugsbayasgalan/ao that referenced this pull request Jan 5, 2026
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
tugsbayasgalan added a commit to tugsbayasgalan/ao that referenced this pull request Jan 5, 2026
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
tugsbayasgalan added a commit to tugsbayasgalan/executorch-1 that referenced this pull request Jan 5, 2026
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
tugsbayasgalan added a commit to tugsbayasgalan/pytorch that referenced this pull request Jan 5, 2026
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
tugsbayasgalan added a commit to tugsbayasgalan/pytorch that referenced this pull request Jan 5, 2026
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
tugsbayasgalan added a commit to tugsbayasgalan/ao that referenced this pull request Jan 5, 2026
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
tugsbayasgalan added a commit to tugsbayasgalan/executorch-1 that referenced this pull request Jan 5, 2026
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
Copilot AI review requested due to automatic review settings January 5, 2026 20:55
Copy link
Contributor

Copilot AI left a 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
tugsbayasgalan added a commit to tugsbayasgalan/ao that referenced this pull request Jan 5, 2026
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
tugsbayasgalan added a commit to tugsbayasgalan/pytorch that referenced this pull request Jan 5, 2026
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
@meta-codesync meta-codesync bot merged commit 09b5bdb into pytorch:main Jan 6, 2026
274 of 279 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants