Skip to content

[TEST] GPU-host triage at c03416cc5: #5113 items 4-18 still red after #5138; #5242 left FP8-quantizing tests (whole test_packing_numeric_boundaries.py fails to import); #5288 FP8 fixture decodes 1e7x and still passes; ROCm gates for #5173/#5186/#5169 #5325

Open

Description

@Qubitium

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 with ImportError: 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 -cpu ones.
  • tests/kernels/test_cuda_bias_epilogue.py: 10 FP8 nodes (fp8_dense/fp8_scaled cancellation rounding, bias-only backward keeps _scaled_mm, differentiable backward).
  • tests/kernels/test_lora_cuda_autograd.py::test_fp8_cuda_lora_preserves_base_and_adapter_gradients
  • tests/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

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 sets store_full_length_kv without 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 leave keys=None, and the test's _measured helper calls .numel() on it.
  • test_qwen2_audio_support.py::test_tiny_qwen2_audio_gptq_quantization_smoke: 5.23 masking_utils._ignore_bidirectional_mask_sdpa calls .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 native models/lfm3, whose attention gate is self_attn.g_proj (the remote code calls it gate_proj, which is what definitions/lfm3.py tags :!), plus conv.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.py x2 and test_hf_awq_repair_train_mode_4907.py x4 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

  1. Qubitium commented on Nov 19, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim released: agent-root-5325-test-triage finished this issue's CPU-verifiable scope.

    Landed in #5344, merged to main as 3f38d5ee1: B1 (FP8 quantizer call sites migrated to tests/fp8_test_utils; tests/test_packing_numeric_boundaries.py imports again), B2 (the #5288 FP8 fixture now declares weight_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_inverse is symbol-anchored), B7 (_cpu_fallback_sources is 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.

  2. Qubitium commented on Nov 19, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim: agent-root-5325-triage-followup is working on the remaining items in this issue now (the earlier agent-root-5325-test-triage claim 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.

  3. Qubitium commented on Nov 19, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim: agent-root-5325-stale-tests is working on this issue now.

  4. added 2 commits that reference this issue on Nov 19, 2026
  5. Qubitium commented on Nov 19, 2026

    @Qubitium
    CollaboratorAuthor

    CPU-verifiable stale-test items from this triage are now fixed on main:

    Items 5, 10, 11, 17, 18 and B3/B4 need CUDA/ROCm or the optional gguf package and remain for a GPU/ROCm lane.

  6. Qubitium commented on Nov 19, 2026

    @Qubitium
    CollaboratorAuthor

    Status update (2026-11-19T14:20Z) — re-triaged sections A and B on current main.

    Claim agent-root-5325-triage-followup stays active until #5565 merges.

  7. added
    unsafe
    scanned
    on Nov 20, 2026
  8. Qubitium commented on Nov 20, 2026

    @Qubitium
    CollaboratorAuthor

    Agent release: agent-root-5325-triage-followup finished this issue's CPU-verifiable scope. Landed in #5565, merged to main as 8c71625b5.

    • Item 7 — ModelTest.quantModel retries a pre-quantized checkpoint without quantize_config (the loader rejects a caller config by design), so _loaded_model_was_prequantized is reachable again. TestLmHeadLoad::test_eval passes.
    • Item 8 — rivision=revision typo fixed.
    • Item 12 — dropped the scheduling-dominated 150x memcpy bound; the 3x forward-pack ratio still catches the old eight-pass rebuild.
    • Item 16 — FP16 dense fallback no longer pins 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.
    • B6 — refreshed the drifted config.py / gptq.py doc citations.
    • B7 — snapshot the post-init QQQ buffers before the reference forward; the module under test was previously built from None payload buffers after QQQTorchLinear dropped 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 main and 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 gguf package).

  9. Qubitium commented on Nov 20, 2026

    @Qubitium
    CollaboratorAuthor

    Round 26 rechecked this at 8c71625b5 on an RTX 4090 and an R9700 (gfx1201), both with Transformers 5.23.0.

    🤖 Generated with Codex

  10. added
    safe
    and removed
    unsafe
    on Nov 20, 2026
  11. 3 remaining items

  12. Qubitium commented on Nov 29, 2026

    @Qubitium
    CollaboratorAuthor

    Re-measurement on main = a4471c53b — 24 of the 25 listed items are already green

    I re-ran every item named in this issue on current main (CPU, plus one pinned RTX 4090 with CUDA_DEVICE_ORDER=PCI_BUS_ID verified at SM 8.9). 0 failures across all of them:

    scope result
    A6 + A9 + A12 + A13 + A15 + A18 1298 passed, 14 skipped
    B1 numeric range 485 passed, 65 skipped
    A5 + A14 8 passed
    A7 3 passed
    A10 4 passed, 2 skipped
    A11 file 25 passed
    item status fixed by
    A4, A5, A12, A14, A15/16 green a668dc8ef (#5564)
    A6, A8, A10, A13 green 8c71625b5 (#5565)
    A7, A9 green 8e4013994 (#6277)
    A11 (the named node), A17, A18 green e2299af57 (#6279)
    B1, B6, B2 semantics green — test_packing_numeric_boundaries.py collects 115 tests again 3f38d5ee1 (#5344)
    B2 fixture green — declares "inverse", drops the FP8 lm_head, now assert_closes against dense logits e6ad644a1 (#5288)
    B3, B4 green — narrowed oracle + IS_ROCM branches 356a5e038 (#6280)
    B5, B7 green — Paro gate + _CUDA_SOURCE_ALLOWLIST cc10a7a5c (#6255)

    So the #5242 / #5288 / #5113 threads and the ROCm gates for #5173/#5186/#5169 are 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.py has three Marlin tests. #6279 converted the node named here, but two others in the same file still used skipif(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:104 then returns "Marlin kernel is not supported on ROCm." and marlin_validate_runtime_device raises ValueError — a fail where a skip is correct. _marlin_layer_or_skip() does not cover it (it catches only ImportError/ModuleNotFoundError).

    Proven by patching torch.version.hip:

    build              cuda.is_available()  requires_nvidia_cuda()  old marker runs?  new marker runs?
    NVIDIA (this host) True                True                    True              True
    simulated HIP      True                False                   True              False
    

    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

    • The ROCm items (A10/A11/A17/B3/B4) were verified by inspecting the gates and monkeypatching torch.version.hip, not on AMD hardware. A real ROCm run is the only end-to-end confirmation.
    • B7 is fixed by pinning the test's expected set; _cpu_fallback_sources still 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.

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

    safescanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions