Skip to content

test(fp8): rebuild the load-only FP8 fixtures without quantize() (#5271) - #5288

Merged
Qubitium merged 1 commit into
mainfrom
fix/fp8-load-only-tests-5271
Nov 18, 2026
Merged

Qubitium merged 1 commit into
mainfrom
fix/fp8-load-only-tests-5271

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Fixes #5271.

Problem

#5242 made FP8 load-only: BaseQModel.quantize() now raises
ValueError: FP8 is load-only. Two tests still built their FP8 fixture through
FP8Config + quantize(), so both were red on main:

  • tests/test_fail_closed_checkpoint_5218.py::test_truncated_weight_only_checkpoint_fails_closed[fp8]
    -- the FP8 leg of fix(load): require every kernel's checkpoint payload (#5218) #5239's fail-closed guard had no working end-to-end test.
  • tests/test_checkpoint_quantization.py::test_dynamic_weight_only_quantized_tensors_equal_after_resume
    -- the dynamic weight-only resume identity test covered nothing.

Change

  • 5218: the fp8 case now publishes a production FP8 checkpoint instead of
    quantizing. _fp8_checkpoint encodes every nn.Linear weight with the
    existing reference encoder (tests/fp8_test_utils.quantize_fp8_weight, row
    scales) and declares the production layout in config.json
    (method/quant_method: fp8, float8_e4m3fn, row, multiplier). The test
    still loads it, runs one forward, drops weight/weight_scale_inv in turn and
    asserts the fail-closed Missing required quantized weights naming the tensor.
    The parametrization now takes a checkpoint builder, so the nf12 case keeps its
    quantize() path.
  • resume: the dynamic weight-only layout moved to RTN (bits=4 with a
    per-module bits: 8 override on layers.0.self_attn.q_proj), which still
    quantizes, and the reload assertion checks the per-module bits instead of the
    removed FP8 settings. Checkpoint/resume byte identity is unchanged.

Tests

pytest -q tests/test_fail_closed_checkpoint_5218.py tests/test_checkpoint_quantization.py
# 62 passed, 2 skipped

Both previously-red nodes pass; the two files are green end to end.

@Qubitium
Qubitium merged commit e6ad644 into main Nov 18, 2026
6 checks passed
@Qubitium
Qubitium deleted the fix/fp8-load-only-tests-5271 branch November 18, 2026 16:55
Qubitium added a commit that referenced this pull request Nov 19, 2026
…#5294 (#5325) (#5344)

B1: #5242 made FP8 load-only and deleted `TorchFP8Linear.pack` /
`pack_original`; five test modules still called them.
- `tests/test_packing_numeric_boundaries.py` failed to import at all, so the
  whole 113-test GPTQ/AWQ/QQQ packing-boundary file was lost. Import
  `quantize_fp8_weight` from `tests.fp8_test_utils` (115 passed).
- `test_inference_numeric_range.py::test_fp8_small_weight_scale`,
  `test_cuda_bias_epilogue.py::_fp8/_gguf` and
  `test_lora_cuda_autograd.py::test_fp8_cuda_lora_*` build the payload with
  `pack_fp8_module` (48, 6 and 1 nodes).

B2: the #5288 FP8 fixture declared `weight_scale_semantics: "multiplier"`
while `quantize_fp8_weight` stores `448 / amax`, so decode multiplied by the
inverse scale (~1e4x too large) and only `torch.isfinite` was asserted.
Declare `"inverse"`, quantize only the decoder projections (the tied FP8
`lm_head` was never decoded with its scale), and compare the logits against
the dense model. Reverting the declaration now fails the test.

B5: `test_paro_triton_cudagraph_5225.py` only carried `pytest.mark.gpu`, so
all 5 nodes failed on a host with no visible GPU. Add a skipif; they now skip.

B6: cite `gptq.py::hessian_inverse` by symbol. The line moved to 2140 and
`test_docs_contract_refs.py` is red on every host (33 passed).

B7: `_cpu_fallback_sources` enumerated the live registry, so importing
`qlinear.mlx` in an earlier test turned `QQQMlxQuantLinear` (MPS) into an
expected rehome source. Restrict it to CUDA kernels, which is what
`rehome_quantized_kernel` moves; the file now passes after those imports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant