Skip to content

Add deprecation warning for to_edge + to_backend workflow in XnnpackPartitioner #13209

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leafs1
Copy link
Contributor

@leafs1 leafs1 commented Aug 7, 2025

Summary

This PR adds a deprecation warning in the XnnpackPartitioner to guide users away from the deprecated to_edge() + to_backend() workflow and toward the recommended to_edge_transform_and_lower() flow. We inspect the call stack in the partitioner to detect when the partitioner is called from the deprecated workflow and then print out a warning statement. This helps prevent issues that can arise from the deprecated workflow.

Test plan

Added tests testing the deprecation warning functionality in test_xnnpack_partitioner.py. Tests verify that the warning appears when using to_edge() + to_backend() and does not appear when using to_edge_transform_and_lower().

Copy link

pytorch-bot bot commented Aug 7, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures, 2 Unrelated Failures

As of commit a434ef9 with merge base 5797608 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but was 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.

@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 Aug 7, 2025
@GregoryComer GregoryComer added the release notes: none Do not include this in the release notes label Aug 8, 2025
from torch.export import export


class TestXnnpackPartitioner(unittest.TestCase):
Copy link
Member

Choose a reason for hiding this comment

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

Nice tests.

Copy link
Member

@GregoryComer GregoryComer left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks for adding this.

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. release notes: none Do not include this in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants