Repository navigation
fix(quantization): preserve dense converters in mixed compressed-tensors checkpoints - #50466
Shoryamishra61 wants to merge 5 commits into
Conversation
|
Thank you for your contribution 🤗! CI Security Gate — automatic approval blockedThis PR was not automatically approved for CI because the security gate failed. Possible reasons:
See the workflow run for the exact violations. A maintainer can review and manually approve CI if a finding is a false positive. |
|
Thank you for your contribution 🤗! CI Security Gate — waiting for maintainer approvalCI is approved automatically only for authors who already have a contribution merged in this repository. A maintainer will review this PR and approve CI to run on it. |
…tadata discovery, and fallback
|
[For maintainers] Suggested jobs to run (before merge) run-slow: compressed_tensors_integration |
ArthurZucker
left a comment
There was a problem hiding this comment.
#50245 should make this simpler.
|
Thanks @ArthurZucker and @kylesayrs for the direction. I see the overlap with #50593 and the broader per-layer quantization plan in #50245, so I don't want to maintain a competing loader change in #50466. I can move the focused regression coverage to whichever PR is the intended landing point: numerical Q/K/V fusion against checkpoint tensors (not just missing/unexpected-key counts), dense attention alongside quantized experts, FP8/NVFP4 companion-key handling, and malformed-companion cases. One edge case worth preserving: if a converter pattern spans multiple layers, detecting any companion key may still rewrite dense sources in other layers. The per-layer approach in #50245 seems particularly relevant here. I also understand that compressed-tensors MoE loading without Would you prefer the regression coverage contributed to #50593 or held until #50245 lands? I'm happy to close #50466 if it's superseded, once the relevant cases are accounted for. Thanks! |
What does this PR do?
Fixes #50426
Problem
When loading mixed-precision \compressed-tensors\ checkpoints (such as models with quantized MoE experts and dense fused attention projections, e.g., \RedHatAI/GLM-5.3-Flash-NVFP4), converted modules that the checkpoint leaves unquantized are incorrectly rewritten with serialized/dequantize transformations.
Because source patterns are name-boundary anchored ((?!\w)), the checkpoint's dense .weight\ keys fail to match the rewritten serialized companion patterns (e.g. \weight_packed\ / \weight_scale\ / \weight_shape), leaving the dense modules reported as UNEXPECTED and the fused parameters silently randomly initialized.
Root cause
In \HfQuantizer.update_weight_conversions, the rewrite was applied globally across all converters matching .weight\ whenever \self.serialized_names\ contains companion keys (derived globally from the quantization config groups). The converter selection did not inspect whether the checkpoint actually serializes companion keys for those specific converter sources or leaves them dense.
Fix
Regression coverage
Added \ ests/quantization/compressed_tensors_integration/test_mixed_precision_conversions.py\ covering:
Compatibility
Verification
uff check\ on all modified files (All checks passed)
uff format --check\ on all modified files (All files formatted)
Before submitting
Who can review?
@SunMarc @ArthurZucker