Skip to content

Copy and adapt pt2e quantization code to torchao #2048

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

Merged
merged 15 commits into from
Apr 15, 2025

Conversation

jerryzh168
Copy link
Contributor

Summary:
First step of dev-discuss.pytorch.org/t/torch-ao-quantization-migration-plan/2810

core logic of pt2e are duplicated, and also ported test here

previous unfinished migration: #1916

Next:

move meta internal callsites to depend on torchao
Docs will be migrated separately

Test Plan:
pytest test/quantization/pt2e_flow

Reviewers:

Subscribers:

Tasks:

Tags:

Summary:
First step of dev-discuss.pytorch.org/t/torch-ao-quantization-migration-plan/2810

core logic of pt2e are duplicated, and also ported test here

previous unfinished migration: pytorch#1916

Next:

move meta internal callsites to depend on torchao
Docs will be migrated separately

Test Plan:
pytest test/quantization/pt2e_flow

Reviewers:

Subscribers:

Tasks:

Tags:
Copy link

pytorch-bot bot commented Apr 12, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 0050dce with merge base 31f119e (image):
💚 Looks good so far! There are no failures yet. 💚

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

@facebook-github-bot facebook-github-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 Apr 12, 2025
@jerryzh168 jerryzh168 added the topic: new feature Use this tag if this PR adds a new feature label Apr 12, 2025
@jerryzh168 jerryzh168 added the topic: bc-breaking Use this tag if this PR breaks backward compatibility label Apr 14, 2025
Copy link
Contributor

@andrewor14 andrewor14 left a comment

Choose a reason for hiding this comment

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

Hi Jerry, can we add a limited set of tests to show that PT2E in pytorch core vs torchao are numerically equivalent, so users will have more confidence they can migrate without any changes in numerics? We can do this in a follow up PR since this one is already 25k lines

@andrewor14
Copy link
Contributor

Another question is how do we ensure both copies of PT2E remain the same? E.g. if we fix a bug in PyTorch core PT2E, is there an easy way to remind us to fix the same bug in torchao's PT2E? (and vice versa?)

@jerryzh168
Copy link
Contributor Author

Another question is how do we ensure both copies of PT2E remain the same? E.g. if we fix a bug in PyTorch core PT2E, is there an easy way to remind us to fix the same bug in torchao's PT2E? (and vice versa?)

we want to deprecate the impl in pytorch core soon, and don't want to do updates on both places

@jerryzh168
Copy link
Contributor Author

Hi Jerry, can we add a limited set of tests to show that PT2E in pytorch core vs torchao are numerically equivalent, so users will have more confidence they can migrate without any changes in numerics? We can do this in a follow up PR since this one is already 25k lines

sure, can do this a bit later

@jerryzh168 jerryzh168 merged commit 88cd9c7 into pytorch:main Apr 15, 2025
18 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. topic: bc-breaking Use this tag if this PR breaks backward compatibility topic: new feature Use this tag if this PR adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants