Repository navigation
Merged
Conversation
…LX QQQ bf16 wide (#4221)
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
Three bf16 accuracy defects: ParoQuant rounded after every Givens stage (~3× the error), MACaQ W4A16/Torch W4A4 skipped the repo's fp32-reduce matmul, and MLX QQQ narrowed bf16 activations to fp16 (inf → NaN).
What Changed
gptqmodel/utils/paroquant.py: bf16 accumulates the whole Givens sweep in fp32 and narrows once; fp16 keeps per-stage rounding (bit-identical to before).gptqmodel/nn_modules/qlinear/macaq.py,gptqmodel/utils/macaq_triton.py: uselinear_fp32_reduce.gptqmodel/nn_modules/qlinear/mlx_qqq.py: new_quantization_dtypekeeps bf16 wide.Tests
Notes: MLX/Metal was not available (dtype decision tested against stand-in primitives); the CUDA fp32-reduce test ran on GPU.
Rebased onto current
mainafter #4263 (#4217) merged; this PR now contains only the #4221 changes.Model Support / Module Plan
N/A — no new model types or registry entries.
Verification environment
No compiled GPTQModel extensions are built in this environment (Machete/Marlin/QQQ-CUDA unavailable), so hardware-specific paths are called out explicitly above.
Fixes #4221