Repository navigation
test(fp8): rebuild the load-only FP8 fixtures without quantize() (#5271) - #5288
Merged
Merged
Conversation
This was referenced Nov 18, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5271.
Problem
#5242 made FP8 load-only:
BaseQModel.quantize()now raisesValueError: FP8 is load-only. Two tests still built their FP8 fixture throughFP8Config+quantize(), so both were red onmain: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
quantizing.
_fp8_checkpointencodes everynn.Linearweight with theexisting reference encoder (
tests/fp8_test_utils.quantize_fp8_weight, rowscales) and declares the production layout in
config.json(
method/quant_method: fp8,float8_e4m3fn, row,multiplier). The teststill loads it, runs one forward, drops
weight/weight_scale_invin turn andasserts the fail-closed
Missing required quantized weightsnaming the tensor.The parametrization now takes a checkpoint builder, so the nf12 case keeps its
quantize()path.per-module
bits: 8override onlayers.0.self_attn.q_proj), which stillquantizes, and the reload assertion checks the per-module
bitsinstead of theremoved FP8 settings. Checkpoint/resume byte identity is unchanged.
Tests
Both previously-red nodes pass; the two files are green end to end.