You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] dequantize_model() on a bf16 GPTQ model now produces fp16 Linear weights, so the forward crashes on a dtype mismatch (regression from 82ab6f1 + c9fb1ed) #4370
Severity: medium. Status: confirmed on CPU; A/B tested against 842d666. Kind: regression from 82ab6f1 (#4184), combined with the dtype heuristic added in c9fb1ed (#4181).
Where
gptqmodel/utils/model.py:3207-3219 (82ab6f1) now restores every BaseQuantLinear.scales at its checkpoint dtype. GPTQ checkpoints always store fp16 scales (_scales_for_storage).
dequantize_model in nn_modules/qlinear/torch.py:1074-1092 takes its target dtype from scales.dtype. c9fb1ed copied the same logic into torch_fused.py and torch_aten_kernel.py.
Together, a bf16 model now dequantizes to fp16 dense layers, while norms and embeddings stay bf16.
Found during an AI-assisted review (Claude Code, round 12) of def6e61; repros were run at that commit (A/B against 842d666 where noted) on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.
Taking this. I'll investigate against current main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.
Activity
Qubitium commentedon Nov 16, 2026
Taking this. I'll investigate against current
main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.fix(qlinear): dequantize to model compute dtype, not scales dtype (#4370
test(cpu): cover #4181 int4pack dispatch and dequantize regressions (#…