Skip to content
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

Refactor QAT into its own module #555

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Refactor QAT into its own module #555

merged 1 commit into from
Jul 30, 2024

Conversation

andrewor14
Copy link
Contributor

Summary: Refactor QAT into its own module so future QAT features can live under the same folder without making qat.py longer, and a separate QAT README can be added in the future.

Test Plan:
python test/quantization/test_qat.py

Copy link

pytorch-bot bot commented Jul 30, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit cf7f651 with merge base ec317fc (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 Jul 30, 2024
@@ -455,7 +455,7 @@ def test_qat_4w_linear(self):
# TODO: remove once we fix int4 error: https://github.com/pytorch/ao/pull/517
@unittest.skipIf(TORCH_VERSION_AFTER_2_5, "int4 doesn't work for 2.5+ right now")
def test_qat_4w_quantizer(self):
from torchao.quantization.prototype.qat import Int4WeightOnlyQATQuantizer
from torchao.quantization.prototype.qat.api import Int4WeightOnlyQATQuantizer
Copy link
Member

Choose a reason for hiding this comment

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

This renaming seems worse and I don't believe you need it since Int4WeightOnlyQATQuantizer is part of qat/__init__.py

Summary: Refactor QAT into its own module so future QAT features
can live under the same folder without making qat.py longer,
and a separate QAT README can be added in the future.

Test Plan:
python test/quantization/test_qat.py
@andrewor14 andrewor14 merged commit 796fce3 into main Jul 30, 2024
13 checks passed
@andrewor14 andrewor14 deleted the qat-refactor branch July 30, 2024 14:04
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants