implement per-group quantization for Int8WeightOnlyConfig#4018
Merged
Conversation
Contributor
Author
vkuzo
added a commit
that referenced
this pull request
Mar 6, 2026
Summary: This is needed for #2752, as there are some Meta-only callsites for `Int8WeightOnlyConfig` v1 using per-group quantization. 99% Claude Test Plan: ``` pytest test/quantization/quantize_/workflows/int8/test_int8_tensor.py -k test_int8_weight_only_v1_v2_per_group_equivalence ``` ghstack-source-id: 300693d ghstack-comment-id: 4013529969 Pull-Request: #4018
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4018
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 4d04fad with merge base 637c4ac ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
vkuzo
commented
Mar 6, 2026
| y = y.reshape(*activation_tensor.shape[:-1], weight_tensor.qdata.shape[0]) | ||
| if weight_tensor.block_size[-1] < weight_tensor.qdata.shape[-1]: | ||
| # Per-group quantization: dequantize weight, then do FP matmul | ||
| w_dequant = weight_tensor.dequantize().to(output_dtype) |
Contributor
Author
There was a problem hiding this comment.
same logic as v1:
This was referenced Mar 6, 2026
andrewor14
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
This is needed for #2752, as there
are some Meta-only callsites for
Int8WeightOnlyConfigv1 usingper-group quantization.
99% Claude
Test Plan: