Skip to content

[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

Closed

Description

@Qubitium

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

  1. Quantize a bf16 Llama with QuantizeConfig(method="exl3", bits=4) and save.
  2. 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

  1. added
    bug
    on Nov 16, 2026
  2. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions