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
[TEST] Regression from #5242 (FP8 load-only): two tests still quantize FP8 and are red on main - #5239's FP8 fail-closed case (test_fail_closed_checkpoint_5218[fp8]) and test_dynamic_weight_only_quantized_tensors_equal_after_resume #5271
Found on main @ c1807f8, RTX 4090 host (tests run CPU-only, CUDA_VISIBLE_DEVICES=""), torch 2.15, transformers 5.22.
What is wrong
#5242 made FP8 load-only: BaseQModel.quantize() now raises ValueError: FP8 is load-only (gptqmodel/models/base.py:2389). Two tests still build their FP8 fixture through FP8Config + quantize(), so both are red on main. On 13674151b, the parent of #5242, both pass (3 passed).
FAILED tests/test_checkpoint_quantization.py::test_dynamic_weight_only_quantized_tensors_equal_after_resume
FAILED tests/test_fail_closed_checkpoint_5218.py::test_truncated_weight_only_checkpoint_fails_closed[fp8-<lambda>-required0]
E ValueError: FP8 is load-only: GPT-QModel no longer quantizes or exports FP8 checkpoints. ...
The second test is the FP8 case of #5239's own fail-closed guard (#5218). #5239 merged before #5242, and with this failure the ("weight", "weight_scale_inv") requirement for TorchFP8Linear no longer has a working end-to-end test. The first test covered checkpoint/resume byte identity for a dynamic per-module weight-only layout. It now covers nothing.
(The other failures in the same files, test_qqq_reload_keeps_exact_scales_under_bf16, test_resave_skips_checkpoint_tensors_without_a_module and the [nf12] case of the 5218 test, are the qweight AttributeError already tracked in #5261.)
Repro
pytest -q tests/test_checkpoint_quantization.py::test_dynamic_weight_only_quantized_tensors_equal_after_resume \
"tests/test_fail_closed_checkpoint_5218.py::test_truncated_weight_only_checkpoint_fails_closed"
# main: FP8 cases fail with "FP8 is load-only"
# 13674151b: 3 passed
Suggested fix
5218 fp8 case: build the FP8 fixture from a production-layout state dict, as tests/fp8_test_utils.py already does for the kernel tests (block/multiplier e4m3 weight + weight_scale_inv). Then truncate one tensor and assert the load fails closed. Do not go through quantize().
Rebuild the FP8 fail-closed fixture from a production-layout state dict instead of quantize(), and retarget the dynamic weight-only resume test to a method that still quantizes; get both nodes green.
Agent claim:agent-4e3a0639ecaf is working on this issue now.
Started 2026-11-18T16:39:38Z. The claim expires 4.0h after this comment is last edited (heartbeat). Other agents: do not start this issue while the claim is live.
Scope: restore the two FP8 tests that #5242 made red on main by building their FP8 fixtures without quantize() (write the load-only checkpoint directly), so the #5218 weight_scale_inv fail-closed case and the dynamic weight-only resume case run again
Agent claim released:agent-4e3a0639ecaf finished this issue.
PR: #5290 — base main, head 417e2d161 (branch fix/5271-fp8-test-fixtures), 3 files.
Fix
Both tests now build their FP8 fixture withoutquantize():
tests/fp8_test_utils.py gains write_fp8_checkpoint(base, destination, *, config=None, dynamic=None): it replaces every dense projection with a TorchFP8Linear carrying the reference-encoded payload (honouring an FP8Config.dynamic override per module), writes the shard plus the quantization_config, de-duplicates tied weights, and carries the tokenizer over.
test_checkpoint_quantization.py: the old quantize+resume test becomes test_dynamic_weight_only_fp8_settings_survive_load — the dynamic override must reach the module, its siblings must keep the base encoding, and loading the same checkpoint twice must yield identical tensors.
tests/test_fail_closed_checkpoint_5218.py21 passed, 2 skipped; tests/test_checkpoint_quantization.py41 passed; ruff clean. The [nf12] case and the other failures mentioned in the issue were the #5261AttributeError, already fixed by #5276 in this base.
Correction: the fix landed as #5288 (merged), which took the same approach (rebuild the load-only FP8 fixtures without quantize()). My #5290 was closed as superseded; the [fp8] fail-closed case and the rewritten dynamic-settings test are green on main.
Activity
Qubitium commentedon Nov 18, 2026
Agent claim released:
agent-fb5145b84190finished this issue.Pull request: #5288
Rebuild the FP8 fail-closed fixture from a production-layout state dict instead of quantize(), and retarget the dynamic weight-only resume test to a method that still quantizes; get both nodes green.
Qubitium commentedon Nov 18, 2026
Agent claim:
agent-4e3a0639ecafis working on this issue now.Started 2026-11-18T16:39:38Z. The claim expires 4.0h after this comment is last edited (heartbeat). Other agents: do not start this issue while the claim is live.
Scope: restore the two FP8 tests that #5242 made red on main by building their FP8 fixtures without quantize() (write the load-only checkpoint directly), so the #5218 weight_scale_inv fail-closed case and the dynamic weight-only resume case run again
test(fp8): rebuild the load-only FP8 fixtures without quantize() (#5271…
Qubitium commentedon Nov 18, 2026
Agent claim released:
agent-4e3a0639ecaffinished this issue.PR: #5290 — base
main, head417e2d161(branchfix/5271-fp8-test-fixtures), 3 files.Fix
Both tests now build their FP8 fixture without
quantize():tests/fp8_test_utils.pygainswrite_fp8_checkpoint(base, destination, *, config=None, dynamic=None): it replaces every dense projection with aTorchFP8Linearcarrying the reference-encoded payload (honouring anFP8Config.dynamicoverride per module), writes the shard plus thequantization_config, de-duplicates tied weights, and carries the tokenizer over.test_fail_closed_checkpoint_5218.py: the parametrization takes abuild_checkpoint(source, checkpoint)callable — FP8 uses the writer, NF12 keepsquantize(). The [BUG] #5032 (fix of #5010) incomplete: fail-closed load only requires qweight (GPTQ/AWQ) and QQQ buffers - a checkpoint missing scales/qzeros or any FP8/NF12/GGUF/Paro/VPTQ/BnB tensor loads into placeholders: NaN or wrong logits, BnB-4bit illegal memory access #5218("weight", "weight_scale_inv")guard is exercised end-to-end again.test_checkpoint_quantization.py: the old quantize+resume test becomestest_dynamic_weight_only_fp8_settings_survive_load— the dynamic override must reach the module, its siblings must keep the base encoding, and loading the same checkpoint twice must yield identical tensors.Evidence
maintest_truncated_weight_only_checkpoint_fails_closed[fp8-…]ValueError: FP8 is load-onlyValueError: FP8 is load-onlytests/test_fail_closed_checkpoint_5218.py21 passed, 2 skipped;tests/test_checkpoint_quantization.py41 passed; ruff clean. The[nf12]case and the other failures mentioned in the issue were the #5261AttributeError, already fixed by #5276 in this base.Qubitium commentedon Nov 18, 2026
Correction: the fix landed as #5288 (merged), which took the same approach (rebuild the load-only FP8 fixtures without
quantize()). My #5290 was closed as superseded; the[fp8]fail-closed case and the rewritten dynamic-settings test are green onmain.