Repository navigation
Fix overflow and underflow across quantized packing paths - #3519
Merged
Merged
Conversation
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 silent packing corruption across GPTQ, AWQ, QQQ, FP8 and GGUF MXFP4. For example, valid BF16 AWQ weights could recover code 255 as 256 and serialize it as 0; QQQ could divide a nonzero FP16 scale to zero before storing it as FP32.
Validation on this host:
The same applicable boundary tests reproduce 53 failures on the base revision. A separate run with the real BitBLAS compressor passes all 56 tests. Repository-wide Ruff and diff checks pass.
Byte/code comparisons are exact, with no mismatches in the passing matrix. Packing cases cover FP16/BF16, 2–8-bit GPTQ, 4/8-bit AWQ, and 64×128/64×256 layers. FP8 scale comparisons use rtol ≤ 1e-6; the Marlin comparison now uses atol=rtol=2e-3.
Limits: this Linux host cannot execute Metal or the Qwen projection benchmarks for MLX. Machete's rejection path is tested on CPU/CUDA/ROCm, but its SM90 native kernel is not exercised. BitBLAS validation covers real compression and buffer installation, not native matmul code generation. No throughput benchmark or full-model evaluation is claimed.