-
Notifications
You must be signed in to change notification settings - Fork 172
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
is_linear fix for MHA #1141
is_linear fix for MHA #1141
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/1141
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 4f45e03 with merge base 4b563f2 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@@ -234,6 +234,7 @@ def _is_linear(mod, *args): | |||
and not isinstance(mod.weight, AffineQuantizedTensor) | |||
and not isinstance(mod.weight, LinearActivationQuantizedTensor) | |||
and not isinstance(mod.weight, AffineFakeQuantizedTensor) | |||
and not isinstance(mod, nn.modules.linear.NonDynamicallyQuantizableLinear) |
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.
nit: maybe add a Note here, to say that if MHA is refactored to not use this module we'd need a different solution
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.
looks good, thanks!
@@ -1278,6 +1278,32 @@ def test_autoquant_compile(self, device, dtype, m1, m2, k, n): | |||
sqnr = SQNR(out, out2) | |||
self.assertTrue(sqnr >= 30) | |||
|
|||
@parameterized.expand(COMMON_DEVICE_DTYPE) | |||
@unittest.skipIf(not TORCH_VERSION_AT_LEAST_2_5, "autoquant requires 2.5+.") |
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.
according to CI, probably need to add skip if cuda is not available, or change this
ao/test/integration/test_integration.py
Line 97 in 629aee1
COMMON_DEVICES = ["cpu", "cuda"] |
Summary: filter fn may need access to parent types of module as in the case with mha Test Plan: TODO Reviewers: Subscribers: Tasks: Tags:
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
2b08079
to
4f45e03
Compare
Summary: filter fn may need access to parent types of module as in the case with mha
Test Plan: python /home/cdhernandez/local/ao/test/integration/test_integration.py -k "test_autoquant_mha"
Reviewers:
Subscribers:
Tasks:
Tags: