Repository navigation
Fix: Zero point underflow in AWQ Exllama v2 kernel - #2351
Merged
Qubitium merged 3 commits intoJan 12, 2026
Merged
Conversation
…2 AWQ asymmetric quantization
Collaborator
|
@12345txy Thank for the bug fix. We have confirmed this bug and verified the fix. |
Collaborator
|
New/comprehensive fix is in: #2352 |
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.
Fix: Zero Point Calculation Error in
unpack_reorder_packfor ExLlamaV2 AWQ Asymmetric QuantizationDescription
Fixes a critical bug in
unpack_reorder_packfunction where zero_point values of 0 are incorrectly handled when using ExLlamaV2 kernel with AWQ asymmetric quantization.Problem
When
izeros=0, the operationizeros = izeros - 1results in-1. The negative value is incorrectly processed inpack_exllama, causing zero_point to incorrectly change from 0 to 15. This leads to:weight = (qweight - zero_point_wrong) * scaleRoot Cause
In
packing_utils.py:85, whenizeros=0:izeros - 1becomes-1(negative value)-1(0xFFFFFFFF) is incorrectly handled inpack_exllama:-1 & 0xF = 15(0xF)Causal Chain:
Solution
Replace
izeros = izeros - 1withizeros = torch.where(izeros > 0, izeros - 1, izeros)to avoid negative values whenizeros=0.Changes
File:
gptqmodel/quantization/awq/utils/packing_utils.pyFunction:
unpack_reorder_pack()Line: 85
Before:
After:
Testing
Verification Steps
sym=False)Test Results
After applying the fix: