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] Re-save still narrows some fp16 tensors to the model dtype: EXL3 suh/svh, and fp16 biases under a bf16 config (rest of the #4303 class) #4379
Severity: low. Status: confirmed on an RTX 4090 at def6e61. Kind: an incomplete case of #4303's byte-identical re-save. It is not a regression: 08f1b2b~1 behaves the same way.
Where
The export shell in gptqmodel/models/writer.py, get_model_with_quantize: from_config(dtype=model_dtype) plus dtype=None at ~2603. The comment there says every quantized buffer is allocated in the checkpoint dtype, but that does not hold for EXL3, and the shell's dense biases are allocated in the model dtype too.
Repro A: EXL3
Quantize a bf16 Llama with QuantizeConfig(method="exl3", bits=4) and save.
Run GPTQModel.load(out).save(out2).
Actual:
All 14 suh/svh tensors per layer go from fp16 to bf16. This is lossy, because the values are scaled rather than ±1.
The re-saved checkpoint still reloads.
The main loader also routes suh/svh through bf16 when loading with dtype=bf16 (max relative error 3.9e-3).
Perplexity impact on Llama-3.2-1B-Instruct EXL3 W4 is negligible: 19.1485 vs 19.1493.
Repro B: fp16 bias, bf16 config
Re-saving the legacy Qwen2.5-0.5B-Instruct-gptq-4bit checkpoint (fp16 biases, torch_dtype bf16 in its config) writes all 72 biases as bf16.
Expected: re-save preserves each tensor's checkpoint dtype, as #4303 now does for FP8, GPTQ, AWQ, QQQ, GGUF and W4A.
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.
Activity
Qubitium commentedon Nov 16, 2026
Claimed. This issue is now owned by a dedicated worker; a fix PR referencing it will follow. Please avoid duplicating work on it in the meantime.
fix(checkpoint): preserve checkpoint buffer dtypes on re-save (ModelC…