Repository navigation
Description
Found on main @ c03416c, on an RTX 4090 (torch 2.15.0+cu132, transformers 5.23.0) and an AMD R9700 (ROCm 10.1, torch 2.16.0.dev, transformers 5.22.1).
I ran the full non-model suite (1178 files) on both GPUs and compared it with the last triage at 7b8f12785, which filed #5113. Every new failure was rerun 3 times and bisected with the HEAD tests copied into older trees. The items below are the ones where the test, not the product, is wrong. Most of them hide coverage. Product defects from the same triage were filed on their own: #5299, #5305, #5322.
A. #5113 was closed by #5138, but items 4-18 from its comments are still red
#5138 fixed items 1-3 only, and they pass now. The other items, posted as comments on #5113, are unchanged at c03416c. Each one is still deterministic, 3/3:
| #5113 item | test | where red |
|---|---|---|
| 4 | test_concurrency_guards.py::test_cpu_bf16x3_capability_probe_respects_an_active_scope (cache_clear on the #5070 module-global) |
CPU/CUDA/ROCm |
| 5 | test_kernel_audit_regressions.py::test_device_move_restores_checkpoint_layout[TorchAten/TorchFused] (meta move target) |
CUDA/ROCm |
| 6 | test_gemma3_vl_support.py::..._pretokenized_text_without_processor, test_qwen3_5_moe_multimodal_support.py::..._routes_pretokenized_rows_to_base_path (#4946 edge-pad strip) |
all |
| 7 | test_lm_head.py::TestLmHeadLoad::test_eval: ModelTest.quantModel (tests/models/model_test.py:1648) still passes quantize_config= for a pre-quantized NATIVE_MODEL_ID, so the _loaded_model_was_prequantized eval branch is still unreachable for every ModelTest that evaluates a pre-quantized checkpoint |
all |
| 8 | test_q4_exllama_v2.py:175 rivision=revision typo |
CUDA |
| 9 | test_pre_looper_failure_cleanup_4862.py x2 ([empty] message, released == []). The "release already-built processors" path is still untested |
all |
| 10 | test_ci_free_threaded_lane.py::test_gate_passes_with_gil0 (gate pins torch 2.15.0+cu132) |
ROCm 3.14t |
| 11 | ROCm: test_hf_bridge_v2_save_qzeros_4952.py x4 (no importorskip("optimum")), test_hf_bridge_cpu_offload_5022.py::test_awq_marlin_uses_the_shared_offload_post_init (cuda.is_available() gate on HIP) |
ROCm |
| 12 | test_cpu_int4_verify_cost_4884.py::test_transformed_state_dict_is_bounded_by_its_own_bytes x2 (absolute 150x bound, host-load flaky) |
CPU/CUDA/ROCm |
| 13 | test_vlm_prepare_dataset_contract_4633.py (62) + test_vlm_pretokenized_calibration.py (17): 79 nodes, same #4946 strip as item 6 |
all |
| 14 | test_torch.py::test_forward_observes_weight_mutation_and_state_load_clears_metadata, ::test_cached_dequant_offloads_g_idx_to_cpu_on_cuda (cache never published inside the #5070 compiled dequant) |
CUDA/ROCm |
| 15/16 | test_torch_cpu_avx512.py::test_cpu_feature_detection_requires_{vbmi,xsave} (cache_clear), ::test_fused_bias_validation (meta call no longer raises since #5075) |
all |
| 17 | ROCm: test_paro_training_gradients_4958.py::test_cuda_awq_gemm_is_reserved_for_inference (cuda.is_available() gate) |
ROCm |
| 18 | test_gguf_all_formats.py::test_gguf_kernel_independent_packed_oracle (42 nodes: the only-qweight walk trips on #5014 _u8_shift_tables). Only visible with the gguf package installed |
CUDA + ROCm |
The suggested fixes in the #5113 comments still apply.
B. New since 7b8f12785
B1. #5242 (FP8 load-only) left more tests calling the removed FP8 quantizer. FIRST BAD 3ec0e3596
On 3ec0e3596^ with HEAD tests, 108/108 of these pass. On 3ec0e3596, 59 fail with ValueError: FP8 is load-only: GPT-QModel no longer quantizes or exports FP8 weights. They call TorchFP8Linear.pack / pack_original directly, which now raise. #5271/#5288 migrated only two such tests.
tests/test_packing_numeric_boundaries.py: the whole file (113 tests) errors at collection withImportError: cannot import name 'quantize_fp8_weight' from 'gptqmodel.nn_modules.qlinear.fp8'. The GPTQ/AWQ/QQQ packing-boundary tests in that file are lost too, not just the FP8 ones. Red on CPU CI as well.tests/kernels/test_inference_numeric_range.py::test_fp8_small_weight_scale[*]: 48 nodes, including the-cpuones.tests/kernels/test_cuda_bias_epilogue.py: 10 FP8 nodes (fp8_dense/fp8_scaledcancellation rounding, bias-only backward keeps_scaled_mm, differentiable backward).tests/kernels/test_lora_cuda_autograd.py::test_fp8_cuda_lora_preserves_base_and_adapter_gradientstests/kernels/test_compile_capability_4739.py::test_fp8_static_cache_keeps_the_compile_and_beats_eager
Fix: build these payloads with tests/fp8_test_utils.pack_fp8_module / quantize_fp8_weight, the reference encoder #5242 moved there.
B2. The #5288 FP8 load-only fixture decodes to garbage, and the test still passes
tests/test_fail_closed_checkpoint_5218.py::_fp8_checkpoint encodes with tests/fp8_test_utils.quantize_fp8_weight. That stores weight_scale_inv = 448 / amax, the inverse convention (see _compute_scale_inv). The fixture then declares "weight_scale_semantics": "multiplier", so the loader multiplies by 448/amax instead of dividing:
kernel TorchFP8Linear multiplier
decoded/dense ratio row0 (median) -9452684.0 max abs decoded 6209668.5 max abs dense 0.0704
logits maxabs quant 0.0 (dense 1.10) finite True
The test only asserts torch.isfinite(logits).all(), which passes. So the "full production FP8 checkpoint loads and runs" half of test_truncated_weight_only_checkpoint_fails_closed[fp8] checks nothing. Fix: declare "inverse" (or store 1/scale_inv with "multiplier"), and compare logits with the dense model.
B3. ROCm: #5173 lean FP8 epilogue is gated off on ROCm, but its tests assume it runs on every GPU. FIRST BAD 7d4797c0e
_lean_epilogue_eligible returns False on IS_ROCM by design, so ROCm keeps the dequant → narrow → matmul path. These tests are red on ROCm only. At 7d4797c0e^ they pass:
tests/kernels/test_fp8_kernel.py::test_fp8_default_forward_is_w8a16[bf16-{tensor,row}-*]x4. The oracle now keeps the weight un-narrowed for row/tensor, so ROCm differs by 1 bf16 ulp (0.0078125 at index (2, 2) (up to 0.002 allowed)).tests/test_fp8_bias_range.py::test_fp8_bias_free_cuda_in_range_weights_keep_native_path[*]x2 (assert [] == [torch.float16]: the lean path is never called).
Fix: use the narrowed-weight oracle and the dequant expectation when IS_ROCM.
B4. ROCm gates missing on new tests
tests/test_qqq_per_channel_checkpoint_5126.py::test_per_channel_qqq_cuda_roundtrip(fix(qqq): keep per-channel empty s_group buffers in checkpoints (#5126) #5186) assertsQQQLinear, which is CUDA-only. HIP loadsQQQTorchLinear(assert False). Use the test: skip CUDA-only kernels on ROCm with a shared requires_nvidia_cuda gate (#4770) #5056requires_nvidia_cuda()gate, or accept the portable kernel.tests/test_pangu_alpha_replay.py::test_pangu_2_layer_quantize_completes[cuda-offload|cuda-resident](fix(pangu): materialize non-layer replay modules for the last layer (#5135) #5169) reloads the fp32 checkpoint on the GPU. On ROCm, AUTO has no fp32-capable GPTQ GPU kernel and falls back toTorchLinear, which raisesNotImplementedError: TorchLinear only supports [torch.float16, torch.bfloat16] dtype: actual dtype = torch.float32(make_quant,importer.py:1838). This is pre-existing product behaviour: at7b8f12785a realGPTQModel.load("Llama-3.2-1B-Instruct-GPTQ-4bits-gp128", dtype=torch.float32, device="cuda:0")on ROCm fails the same way, fp16 works, and CUDA picksExllamaV2Linearfor fp32. The test should use fp16/bf16 on HIP, or AUTO should name the real constraint.
B5. tests/kernels/test_paro_triton_cudagraph_5225.py (#5258) has no GPU gate
All 5 nodes fail on a host with no GPU visible (RuntimeError: Paro Triton requires a CUDA or ROCm GPU.) instead of skipping, so CPU CI is red.
B6. Stale doc line reference. FIRST BAD 538467ff7 (#5294)
tests/test_docs_contract_refs.py::test_contract_reference_resolves[docs/rocm-default-environment.md-gptqmodel/quantization/gptq.py-hessian_inverse-2121]: hessian_inverse moved from line 2121 to 2140. Red on all hosts.
B7. tests/test_rehome_cpu_fallback_pairs.py::test_rehome_switches_every_cpu_fallback_pair_with_complete_state[qqq-*] depends on test order (CUDA)
Run alone, it passes 5/5. It fails 1-2 nodes whenever an earlier test in the same session imported more qlinear modules: after test_qwen4_exp_exl3_contracts.py, test_qwen_moe_converter.py, test_qzero_pack_device.py or test_qzeros_format_invariant.py, it fails with AssertionError: QQQMlxQuantLinear (sometimes QQQLinear). _cpu_fallback_sources walks the live _registry_kernel_classes(), so QQQMlxQuantLinear becomes a "CUDA source" once qlinear.qqq_mlx-style modules have been imported, and the test then expects rehome_quantized_kernel to switch an MLX module. In the main pass it failed with the file run on its own under host load, and passed in 7b8f12785's run. Pin the expected source set (_CUDA_SOURCES plus an explicit allow-list) instead of using whatever the registry has imported.
C. Environment only (transformers 5.22 → 5.23), for completeness
These fail with the r20 baseline code (7b8f12785) on transformers 5.23 too, and pass on 5.22 (the ROCm venv):
test_gemma4_support.py::test_gemma4_disables_unused_full_length_kv_store,::test_gemma4_unused_kv_store_no_longer_grows_captured_shared_kv_states. 5.23 no longer setsstore_full_length_kvwithout a KV-shared tail, so the tests' precondition[F, F, T, T]is now all False. The product hook is a harmless no-op there.test_kv_cache_estimate_layer_kinds_4542.py::test_gemma3n_measured_cache_skips_the_shared_tail. 5.23 Gemma3n shared layers leavekeys=None, and the test's_measuredhelper calls.numel()on it.test_qwen2_audio_support.py::test_tiny_qwen2_audio_gptq_quantization_smoke: 5.23masking_utils._ignore_bidirectional_mask_sdpacalls.item()on a meta tensor.module_tree/test_registry_leaf_coverage.py::test_every_decoder_leaf_is_declared_or_explicitly_excluded[lfm3, lfm3_vl]. 5.23 ships nativemodels/lfm3, whose attention gate isself_attn.g_proj(the remote code calls itgate_proj, which is whatdefinitions/lfm3.pytags:!), plusconv.conv. Both stay in the source dtype as intended, but the definition does not tag the native names.test_hf_awq_bridge_import_order_4795.pyx2 andtest_hf_awq_repair_train_mode_4907.pyx4 are environment-triggered, but this is a real product break. It is filed separately as [BUG] transformers 5.23: plain from_pretrained of GPT-QModel AWQ checkpoints with dynamic per-module group_size crashes (size mismatch) - 5.23 no longer skips the shape check for pre-quantized params, so the #4795/#4907 late-import repair never runs #5322.
Host-only items, not bugs: einops/torchvision are absent from a venv (nemotron-omni and ernie-vl tree tests). Several new regression tests skip on a single visible GPU (#5104 x5, #5093 x2, #5263, #5101/#5182 x7). These were not exercised in this triage.
Which test should have caught these: the CPU CI lane catches B1 (packing_numeric_boundaries, numeric_range -cpu), B5 and B6 today. A ROCm lane catches A10/A11/A17, B3 and B4. Severity: low for each item, but B1 and B2 together leave FP8 kernel numerics, FP8 checkpoint loading and 113 packing-boundary tests without a working guard.
🤖 Generated with Claude Code
Activity
Qubitium commentedon Nov 19, 2026
Agent claim released:
agent-root-5325-test-triagefinished this issue's CPU-verifiable scope.Landed in #5344, merged to main as
3f38d5ee1: B1 (FP8 quantizer call sites migrated totests/fp8_test_utils;tests/test_packing_numeric_boundaries.pyimports again), B2 (the #5288 FP8 fixture now declaresweight_scale_semantics: "inverse", quantizes only the decoder projections, and asserts logits against the dense model), B5 (Paro Triton cudagraph test skips without a GPU), B6 (gptq.py::hessian_inverseis symbol-anchored), B7 (_cpu_fallback_sourcesis restricted to CUDA kernels, so the rehome pair guard no longer depends on registry import order).Not addressed here: B3/B4 need a ROCm host, and the section A items remain tracked in #5113.
test: restore the FP8 kernel, packing and doc guards left red by #5242/…
Qubitium commentedon Nov 19, 2026
Agent claim:
agent-root-5325-triage-followupis working on the remaining items in this issue now (the earlieragent-root-5325-test-triageclaim was released after landing the CPU-verifiable batch in #5344).Scope: re-triage sections A and B against current
main, then fix the items that still reproduce, split into test-only and product-behaviour fixes as appropriate.Qubitium commentedon Nov 19, 2026
Agent claim:
agent-root-5325-stale-testsis working on this issue now.test: realign the stale #5325 guards with the module-global probes an…
test(triage): realign stale expectations from the #5325 sweep (#5325)
Qubitium commentedon Nov 19, 2026
CPU-verifiable stale-test items from this triage are now fixed on
main:a668dc8ef) — items 4, 9, 14, 15: module-global probe resets instead of the removedcache_clear(), output-level assertions for the compiled dequant, and a prologue-release trigger that still fails after the first processor is built.Items 5, 10, 11, 17, 18 and B3/B4 need CUDA/ROCm or the optional
ggufpackage and remain for a GPU/ROCm lane.Qubitium commentedon Nov 19, 2026
Status update (2026-11-19T14:20Z) — re-triaged sections A and B on current
main.mergeable_state: clean, all checks green): item 7 (ModelTestpre-quantized eval branch), item 8 (rivisiontypo), item 12 (host-load-dependentmemcpybound), item 16 (FP16 fallbacklinear_mode, meta-tensor dispatch), B6 (doc citations), B7 (rehome test import-order dependence).main: item 5, item 6, item 13, B1, B2, B5.ggufpackage).Claim
agent-root-5325-triage-followupstays active until #5565 merges.test(triage): realign stale expectations from the #5325 sweep (#5325) (…
Qubitium commentedon Nov 20, 2026
Agent release:
agent-root-5325-triage-followupfinished this issue's CPU-verifiable scope. Landed in #5565, merged to main as8c71625b5.ModelTest.quantModelretries a pre-quantized checkpoint withoutquantize_config(the loader rejects a caller config by design), so_loaded_model_was_prequantizedis reachable again.TestLmHeadLoad::test_evalpasses.rivision=revisiontypo fixed.memcpybound; the 3x forward-pack ratio still catches the old eight-pass rebuild.linear_mode == "train"in eval; meta construction asserts the FakeTensor dispatch (perf(cpu): make NF12, Paro and QQQ inductor-ready on CPU #5075) instead of expecting a raise.config.py/gptq.pydoc citations.Nonepayload buffers afterQQQTorchLineardropped its checkpoint layout, which is what made the result import-order dependent.Items 4/9/14/15 landed separately in #5564. Verified already green on
mainand left untouched: item 5, item 6, item 13, B1, B2, B5.Still open, not reproducible on this NVIDIA host: items 10, 11, 17, B3, B4 (ROCm-only) and item 18 (needs the optional
ggufpackage).Qubitium commentedon Nov 20, 2026
Round 26 rechecked this at
8c71625b5on an RTX 4090 and an R9700 (gfx1201), both with Transformers 5.23.0.3f38d5ee1,tests/kernels/test_cuda_bias_epilogue.py::_ggufwas switched fromGGUFTorchLinear.pack_originalto the FP8 test packer along with the FP8 fixture. All fourgguf_densecases fail on both platforms withAttributeError: 'GGUFTorchLinear' object has no attribute 'fp8_format'(three isolated reruns per platform). Repro:python -m pytest -q tests/kernels/test_cuda_bias_epilogue.py -k gguf_dense. The GGUF fixture can use its original packer.tests/kernels/test_compile_capability_4739.py::test_fp8_static_cache_keeps_the_compile_and_beats_eagerstill constructs a checkpoint by quantizing to FP8. The test fails on both platforms withValueError: FP8 is load-only, before it checks static-cache compilation.🤖 Generated with Codex
3 remaining items
test(docs): resolve stale contract line references (#5325) (#5950)
test(exllama): gate the CUDA-only generation check and pin the revisi…
test: fix the GGUF packed oracle and HIP gates (#5325) (#6279)
test(rocm): use the dequant oracle and portable kernels where the lea…
fix(gemma4): restore the unused full-length KV-store hook and absorb …
test(fp8): migrate remaining load-only callers to the reference encod…
fix(gemma4): restore the unused full-length KV-store hook and absorb …
test(torch): strengthen meta-move and compiled-dequant cache guards (#…
test(ci): gate Paro cudagraph tests and pin rehome sources (#5325) (#…
test(int4): make the transformed-state-dict bound deterministic (#5325)…
test: reach the pre-quantized eval branch and cover processor release…
test(vlm): lock the #4946 edge-pad strip on both edges (#5325) (#6265)
test(exllama): gate the CUDA-only generation check and pin the revisi…
Qubitium commentedon Nov 29, 2026
Re-measurement on
main=a4471c53b— 24 of the 25 listed items are already greenI re-ran every item named in this issue on current
main(CPU, plus one pinned RTX 4090 withCUDA_DEVICE_ORDER=PCI_BUS_IDverified at SM 8.9). 0 failures across all of them:a668dc8ef(#5564)8c71625b5(#5565)8e4013994(#6277)e2299af57(#6279)test_packing_numeric_boundaries.pycollects 115 tests again3f38d5ee1(#5344)"inverse", drops the FP8lm_head, nowassert_closes against dense logitse6ad644a1(#5288)IS_ROCMbranches356a5e038(#6280)_CUDA_SOURCE_ALLOWLISTcc10a7a5c(#6255)So the
#5242/#5288/#5113threads and the ROCm gates for#5173/#5186/#5169are all resolved. The only item still broken was one this issue did not name:Remaining defect → PR #6426
tests/test_hf_bridge_cpu_offload_5022.pyhas three Marlin tests. #6279 converted the node named here, but two others in the same file still usedskipif(not torch.cuda.is_available()):test_post_init_refreshes_a_materialized_cpu_snapshot_on_cuda(:916)test_v1_grouped_checkpoint_loads_with_auto_cpu_offload(:1092)HIP reports
cuda.is_available() == True, so both markers let the tests run;utils/marlin.py:104then returns"Marlin kernel is not supported on ROCm."andmarlin_validate_runtime_deviceraisesValueError— a fail where a skip is correct._marlin_layer_or_skip()does not cover it (it catches onlyImportError/ModuleNotFoundError).Proven by patching
torch.version.hip:Fixed by using the documented
requires_nvidia_cuda(), matching the sibling #6279 already converted. Whole file: 25 passed on GPU (identical to before — no NVIDIA behaviour change) and 20 passed / 5 skipped on CPU, with all three Marlin skips now reading "Marlin needs an NVIDIA CUDA build".Caveats
torch.version.hip, not on AMD hardware. A real ROCm run is the only end-to-end confirmation._cpu_fallback_sourcesstill walks the live registry, which only matters if that helper is ever promoted to product code.I have not closed this issue — it is a tracking issue, so that is your call.
test(hf): gate the two remaining Marlin offload tests on an NVIDIA bu…