Skip to content

test(5325): re-triage the GPU-host reds — 24 of 25 already green, fix the last two Marlin gates - #6426

Merged
Qubitium merged 1 commit into
mainfrom
fix/5325-gpu
Nov 29, 2026
Merged

Qubitium merged 1 commit into
mainfrom
fix/5325-gpu

Conversation

@Qubitium

@Qubitium Qubitium commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Re-triage of #5325 on main = a4471c53b (the issue was filed at c03416cc5). Tracking issue stays open.

Finding: 24 of the 25 listed items are already fixed. One item was only partially fixed — two Marlin gates in the file named by item A11 were missed — and that is the whole diff here.

Status of every listed item

item node(s) status on main fixed by
A4 test_concurrency_guards.py::test_cpu_bf16x3_capability_probe_respects_an_active_scope green a668dc8ef (#5564)
A5 test_kernel_audit_regressions.py::test_device_move_restores_checkpoint_layout[TorchAten/TorchFused] green a668dc8ef (#5564)
A6 test_gemma3_vl_support.py, test_qwen3_5_moe_multimodal_support.py green 8c71625b5 (#5565)
A7 test_lm_head.py::TestLmHeadLoad::test_eval / ModelTest.quantModel green (TestPrequantizedLoadContract 3 passed) 8e4013994 (#6277)
A8 test_q4_exllama_v2.py rivision= typo green — now asserts "rivision" not in calls 8c71625b5 (#5565)
A9 test_pre_looper_failure_cleanup_4862.py x2 green 8e4013994 (#6277)
A10 test_ci_free_threaded_lane.py::test_gate_passes_with_gil0 green — skips: requires the pinned free-threaded CI interpreter and CUDA 13.2 torch build 8c71625b5 (#5565)
A11 test_hf_bridge_cpu_offload_5022.py::test_awq_marlin_uses_the_shared_offload_post_init; test_hf_bridge_v2_save_qzeros_4952.py named node green; the other file no longer exists e2299af57 (#6279)
A11 (extra) same file: test_post_init_refreshes_a_materialized_cpu_snapshot_on_cuda, test_v1_grouped_checkpoint_loads_with_auto_cpu_offload was still wrong — fixed here this PR
A12 test_cpu_int4_verify_cost_4884.py x2 green a668dc8ef (#5564)
A13 test_vlm_prepare_dataset_contract_4633.py (62) + test_vlm_pretokenized_calibration.py (17) green 8c71625b5 (#5565)
A14 test_torch.py mutation/cache nodes green a668dc8ef (#5564)
A15/16 test_torch_cpu_avx512.py vbmi/xsave/fused-bias green a668dc8ef (#5564)
A17 test_paro_training_gradients_4958.py::test_cuda_awq_gemm_is_reserved_for_inference green — now requires_nvidia_cuda() e2299af57 (#6279)
A18 test_gguf_all_formats.py::test_gguf_kernel_independent_packed_oracle green e2299af57 (#6279)
B1 test_packing_numeric_boundaries.py collection error green — 115 tests collect; imports the reference encoder from tests/fp8_test_utils 3f38d5ee1 (#5344)
B1 kernels/test_inference_numeric_range.py FP8 nodes green — 485 passed, 65 skipped 3f38d5ee1 (#5344)
B2 test_fail_closed_checkpoint_5218.py::_fp8_checkpoint decodes 1e7x and still passes green — declares weight_scale_semantics: "inverse", drops the FP8 lm_head, and now assert_closes against the dense logits e6ad644a1 (#5288) + 3f38d5ee1 (#5344)
B3 kernels/test_fp8_kernel.py, test_fp8_bias_range.py lean-epilogue oracle green — narrowed oracle + IS_ROCM monkeypatch 356a5e038 (#6280)
B4 test_qqq_per_channel_checkpoint_5126.py (#5186), test_pangu_alpha_replay.py (#5169) green — QQQTorchLinear if IS_ROCM else QQQLinear; _gpu_dtype() returns fp16 on HIP 356a5e038 (#6280)
B5 kernels/test_paro_triton_cudagraph_5225.py no GPU gate green — 5 skipped, Paro Triton requires a CUDA or ROCm GPU cc10a7a5c (#6255)
B6 test_docs_contract_refs.py stale hessian_inverse line green 3f38d5ee1 (#5344)
B7 test_rehome_cpu_fallback_pairs.py order dependence green — _CUDA_SOURCE_ALLOWLIST pins the expected set cc10a7a5c (#6255)

Measured on main, 0 failures throughout: 1298 passed / 14 skipped (the A6+A9+A12+A13+A15+A18 batch), 485 passed / 65 skipped (B1 numeric range), 8 passed (A5+A14), 3 passed (A7), 4 passed / 2 skipped (A10), 25 passed on GPU (the A11 file).

The one remaining defect

tests/test_hf_bridge_cpu_offload_5022.py has three Marlin tests. #6279 converted the one the issue names, but two others in the same file still used @pytest.mark.skipif(not torch.cuda.is_available(), ...):

  • test_post_init_refreshes_a_materialized_cpu_snapshot_on_cuda (line 916)
  • test_v1_grouped_checkpoint_loads_with_auto_cpu_offload (line 1092)

HIP reuses the CUDA device namespace, so torch.cuda.is_available() is True on ROCm and both markers let the test run. gptqmodel/utils/marlin.py:104 then returns "Marlin kernel is not supported on ROCm." and marlin_validate_runtime_device raises ValueError, so the nodes fail instead of skipping. _marlin_layer_or_skip() does not cover this — it catches ImportError/ModuleNotFoundError only, not the ValueError ROCm raises.

Predicate comparison on this host, with torch.version.hip patched to simulate 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

Marlin build error under IS_ROCM=True: Marlin kernel is not supported on ROCm.

Change

Two lines: use the documented requires_nvidia_cuda() predicate, matching the sibling node #6279 already converted. No product code, no assertion changed, no test deleted or skipped beyond what the predicate already implies.

Verification

host result
RTX 4090 (SM 8.9, CUDA_DEVICE_ORDER=PCI_BUS_ID + CUDA_VISIBLE_DEVICES=1) whole file 25 passed — identical to the pre-change run, so no NVIDIA behaviour change
CPU (CUDA_VISIBLE_DEVICES="") whole file 20 passed, 5 skipped, 0 failed

All three Marlin skips now report the same reason: test_hf_bridge_cpu_offload_5022.py:361, :916, :1092 → Marlin needs an NVIDIA CUDA build.

ruff check tests/test_hf_bridge_cpu_offload_5022.py → clean.

Left for the maintainer

Full report: /root/openai-audit/triage-5325.md.

#6279 converted the node named in #5325 item 11 to ``requires_nvidia_cuda()``
but left two Marlin tests in the same file on
``skipif(not torch.cuda.is_available())``:

- ``test_post_init_refreshes_a_materialized_cpu_snapshot_on_cuda``
- ``test_v1_grouped_checkpoint_loads_with_auto_cpu_offload``

HIP reuses the CUDA device namespace, so ``torch.cuda.is_available()`` is
True on ROCm and both markers let the test run. ``utils/marlin.py`` then
returns ``"Marlin kernel is not supported on ROCm."`` and
``marlin_validate_runtime_device`` raises ``ValueError``, so the tests fail
instead of skipping. ``_marlin_layer_or_skip()`` does not cover this: it
catches ``ImportError``/``ModuleNotFoundError`` only.

Use the documented NVIDIA predicate so all three Marlin nodes in the file
report the same skip reason. On a CUDA build the predicate is True, so the
nodes run exactly as before.
Qubitium added a commit that referenced this pull request Nov 29, 2026
…w-up) (#6439)

`torch.cuda.is_available()` is true on ROCm because HIP reuses the CUDA
device namespace, so a `skipif(not torch.cuda.is_available())` marker lets
a Marlin-only test run. There is no ROCm Marlin kernel, so the load raises
`ValueError: Marlin kernel is not supported on ROCm.` -- a failure where a
skip is correct.

#6426 fixed two nodes in `test_hf_bridge_cpu_offload_5022.py` and #6279
fixed one more; these three were left behind:

- `test_hf_bridge_legacy_qzeros_marlin_6274.py`:
  `test_legacy_symmetric_checkpoint_loads_on_the_auto_marlin_kernel` loads
  with `{"": 0}` and asserts the selected kernel is `MarlinLinear`, so on
  ROCm it fails on the assertion instead of skipping. The sibling nodes in
  that file are device-agnostic and keep running on ROCm.

- `test_openai_server_lifecycle.py`:
  `test_gpu_memory_does_not_grow_across_serve_cycles` loads with
  `backend=BACKEND.MARLIN`, and its gate additionally read
  `torch.cuda.get_device_capability(0)`, which reports an unrelated numeric
  pair on HIP (gfx1201 -> (12, 0)) -- the anti-pattern documented in
  `tests/accelerator_gates.py`.

- `models/test_llama3_2_fusion.py`:
  `test_llama32_1b_fusion_save_reload` asserts AUTO selects
  `MarlinLinear`/`AwqMarlinLinear`. Its sibling
  `test_tiny_llama_fusion_after_fresh_quantization` quantizes through
  `BACKEND.GPTQ_TORCH` and is device-agnostic, so only the 1B node is
  gated.

Use the documented `requires_nvidia_cuda()` predicate, matching #6426 and
#6279. On an NVIDIA build it is True, so all three nodes run exactly as
before; on HIP they skip with a reason that names the requirement.

Not changed, after measurement: `tests/kernels/test_asymmetric_real_models.py`
already skips on ROCm via `_require_candidate_backend()` ->
`validate_device()` -> `NotImplementedError`, and
`tests/test_requant_embed_endpoint_5116.py` gates generic CUDA-device tests
that are valid on ROCm (it passes 13/13 on NVIDIA; its simulated-HIP
failures come from Triton's AMD driver, not from gptqmodel's ROCm branches).

Co-authored-by: agent <agent@local>
@Qubitium
Qubitium marked this pull request as ready for review November 29, 2026 20:13
@Qubitium
Qubitium merged commit f6f5c45 into main Nov 29, 2026
6 checks passed
@Qubitium
Qubitium deleted the fix/5325-gpu branch November 29, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant