-
Notifications
You must be signed in to change notification settings - Fork 338
Parametrize quantization APIs for AWQ unittest #2930
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2930
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@jerryzh168 @Xia-Weiwen Sorry for the interruption, could you review this PR? |
test/prototype/test_awq.py
Outdated
base_config = Int4WeightOnlyConfig() | ||
class TestAWQ(common_utils.TestCase): | ||
@common_utils.parametrize("base_config", [Int4WeightOnlyConfig()]) | ||
def test_awq_config(self, base_config): |
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.
this one is fine not to parametrize I think
test/prototype/test_awq.py
Outdated
@@ -61,19 +58,20 @@ def test_awq_config(self): | |||
with self.assertRaisesRegex(ValueError, "is not one of"): | |||
AWQConfig(base_config, step="not_supported") | |||
|
|||
def test_awq_functionality(self): | |||
@common_utils.parametrize( | |||
"base_config", [Int4WeightOnlyConfig(group_size=128, version=2)] |
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: version=2 can be removed now
test/prototype/test_awq.py
Outdated
@@ -104,12 +102,14 @@ def test_awq_functionality(self): | |||
loss_base = (ref_out - baseline_out).pow(2).mean().item() | |||
assert loss_awq < loss_base | |||
|
|||
def test_awq_loading(self): | |||
@common_utils.parametrize( | |||
"base_config", [Int4WeightOnlyConfig(group_size=128, version=2)] |
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.
same here, version=2 can be removed now
test/prototype/test_awq.py
Outdated
@@ -152,7 +151,10 @@ def test_awq_loading(self): | |||
assert awq_save_load_out is not None | |||
assert torch.allclose(awq_out, awq_save_load_out, atol=1e-2) | |||
|
|||
def test_awq_loading_vllm(self): | |||
@common_utils.parametrize( | |||
"base_config", [Int4WeightOnlyConfig(group_size=128, version=2)] |
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.
same here
Not sure how was #2997 merged into main, destroying |
Summary:
For expanding more quantization API tests, parameterize quantization APIs in the AWQ unittest, preserving structure.
Test plan: CI -
test/prototype/test_awq.py