Repository navigation
Description
Found on main @ b225a43, Radeon AI PRO R9700 (gfx1201), ROCm 10.1, torch 2.16.0.dev+rocm10.1, Python 3.14t (one card via ROCR_VISIBLE_DEVICES). These are the ROCm-only failures from a file-by-file run of tests/ (excluding tests/models). Failures shared with CUDA are in #4764 (this round's regressions) and #4769 (pre-existing). Each ROCm failure below was re-run 3x in isolation and failed 3/3 unless marked.
1. Missing ROCm skip: the test drives a CUDA-only kernel on ROCm
The library correctly refuses, with an explicit "CUDA-only ... use X on ROCm" error. The tests are gated only on torch.cuda.is_available(), which is true on ROCm.
| test (count) | error |
|---|---|
kernels/test_awq_native_eval_autograd.py::test_awq_native_eval_preserves_requested_gradients[input,bias] (2) |
The native AWQ JIT extension is CUDA-only and cannot be built by hipcc |
kernels/test_static_cache_compile_4669.py::test_static_cache_does_not_compile_a_graph_breaking_kernel (1, new this round) |
Marlin kernel is not supported on ROCm. |
test_marlin_scratch_cuda.py (62) |
require_dtype() calls pytest.fail(marlin_runtime_error(dtype)); it should pytest.skip when torch.version.hip |
test_marlin_device_profile.py (6), test_marlin_g_idx.py::test_marlin_decodes_noncontiguous_g_idx, test_q4_marlin.py (10), test_lora.py::{test_load_0_marlin,test_evalution_from_path}, test_gptaq.py::TestQwen2_5_GPTAQ::test_qwen2_5, test_dynamic.py::TestDynamic::test_dynamic_bits_2_marlin, test_inference_speed.py (marlin cases) |
Marlin kernel is not supported on ROCm. / Marlin device profile requires CUDA. |
test_asymmetric_real_model_gates.py::test_generation_propagates_extension_build_failure[awq_marlin,awq_machete,gptq_machete] (3) |
... only supports [DEVICE.CUDA] |
test_kernel_audit_regressions.py::{test_awq_gemm_validation_matches_native_width_and_group_contract, test_machete_validation_checks_extension_availability} (2) |
expects ImportError, gets NotImplementedError('Machete ... is CUDA-only ...') |
test_hf_packing_api.py::test_gpu_feasibility_and_best_format |
hf_check_packing_feasibility(..., backend=BACKEND.MARLIN, device='cuda:0') returns False on ROCm (correct) |
test_model.py::TestModelSave::test_moe |
TorchLinear() is not an instance of MarlinLinear (AUTO correctly picks a portable kernel on ROCm) |
test_q4_exllama_v2.py (3), test_eval_runtime.py::test_eval_path, test_packable.py (3 exllama cases), test_serialization.py (3) |
ExLlamaV2 GPTQ is CUDA-only: ROCm support is disabled ... |
test_bits.py::TestBits::test_bits, test_dynamic.py::TestDynamic::test_dynamic_bits_1_triton, test_save_loaded_quantized_model.py::TestSave::test_save_2_triton |
TritonV2Linear is CUDA-only and does not run on ROCm |
test_bitblas.py (5 on ROCm) |
BitBLAS ... is CUDA-only; test_bitblas_validate_accepts_bf16_gptq asserts True |
test_checkpoint_modules.py::test_qqq_optional_group_scales_schema, test_qqq_jit.py (2) |
QQQ (BACKEND.QQQ) has no ROCm kernel |
test_glm5_core_cuda.py (4), test_kimi_k3_core_cuda.py (2) |
EXL3_EXLLAMA_V3 inference requires NVIDIA CUDA |
test_exl3_wide_input.py::test_native_exl3_row_boundary_uses_expected_half_kernel[32-bc] |
assert ['hgemm'] == ['bc']: the native EXL3 bc branch is CUDA-only, so ROCm takes the hgemm branch |
test_gptqmodel_nf12_api.py::{test_preloaded_partial_namespace_is_reused_without_a_second_load, test_require_reports_only_the_missing_operator} |
native NF12 kernels support NVIDIA CUDA, not ROCm (second test: regex mismatch on the same message) |
test_awq_gemv_insession_4554.py::test_awq_gemv_quantize_save_and_reload_on_cpu |
AWQ GEMV/GEMV_FAST/LLM_AWQ kernels require the native CUDA AWQ extension (pack step) |
test_awq_gemm.py, test_awq_gemv_fast.py, test_awq_llm_awq.py (reload legs) |
AwqGEMMLinear requires the native CUDA AWQ extension ... use BACKEND.AWQ_TORCH, or does not support device: DEVICE.ROCM |
Suggested: one shared requires_nvidia_cuda marker (torch.cuda.is_available() and torch.version.hip is None) in tests/accelerator_gates.py, used by every test that names a CUDA-only backend.
2. CUDA-capability fakes that do not apply on ROCm
On ROCm, selector validation deliberately ignores the CUDA capability tuple (utils/importer.py:~161, if IS_ROCM: return None). So tests that fake get_device_capability get no grouping and no refusal:
test_default_device_mixed_capability_4705.py::{test_default_load_stays_inside_one_capability_group, test_explicit_mixed_placement_is_refused_with_the_remedy, test_mixed_capability_refusal_names_a_way_forward}:DID NOT RAISE ValueError/ both devices returned (new this round, fix(loader): keep the default placement inside one compute-capability group (#4705) #4714);test_max_memory_kernel_devices_4632.py::test_a_budget_that_names_both_cards_still_rejects_mixed_capabilities:DID NOT RAISE.
These need skipif(torch.version.hip), or a ROCm arch-based fake.
3. Stale expectations on ROCm only
test_allspark_awq.py::test_awq_module_export_keeps_checkpoint_layout[dtype0,dtype1](the HIP twin of the CUDA test):assert set(pristine) == {"qweight","qzeros","scales","bias"}fails becauseqzeros_formatwas added (fix(checkpoint): refuse runtime-layout HF saves, emit AWQ snapshots, carry layout in a tensor (#4125) #4134). The CUDA copy was updated, but this file was not.test_awq_clip_consistency.py::test_clip_grid_low_precision_oracle[{0,1}-32-{False,True}-dtype0-cuda],::test_clip_grid_edge_cases[mixed_dtype-cuda],::test_awq_clip_consistency_1_cuda(6, also red at 12c1273): fp16 clip search is compared to a sequential oracle withrtol=0, atol=0. On ROCm, fp16 reduction order differs, so 1-4 of 256 bounds pick the neighbouring grid step (max diff 0.00195). The legacy-consistency case differs by one grid step (0.293). This is a tie-break in fp16, not a wrong clip. Compare the resulting quantization error, or allow one grid step on HIP.test_bench_cuda_even_d2h.py::{test_even_d2h_latency_profile, test_even_d2h_request_wall}: wall-clock thresholds tuned for CUDA, e.g.ratio=3.25,async=0.074 ms > sync=0.043 ms.test_gptq_post_inverse_fallback_4400.py::test_qqq_releases_input_hessian_before_inverse_and_block_pass:peak < 3.5 * hessian_bytesfails with 5.13x (86 MB vs a 16.8 MB Hessian). It passes on CUDA. Likely rocSOLVER cholesky/inverse workspace, which the bound does not model. It needs a ROCm-specific bound, or an owner check that no extra Hessian-sized copy is live on HIP.
4. Not classified as test bugs (instability on a shared card)
These crashed in the full run while the card was shared with other sessions. The logs show expandable_segments: memory mapping failed with OOM around them:
test_lm_head.py::TestLmHeadQuant::test_quant_lm_head,test_quant_trust_remote.py::test_diff_batch,test_simple_quant.py:hipErrorIllegalAddress.test_shared_input_hessian_dedup_real_model_e2e.py: abort, illegal address (passes on CUDA).test_awq_gemm.py: NaN assert in AWQ layer-1 scales in 2 of the 4 runs whose failure reason I captured. The other 2 got past quantization. A 3-layer Llama-3.2-1B AWQ with the test's 512 C4 rows was clean 3/3 in isolation.test_qqq.py::TestGroupSize::test_quant_and_inference_0fails the same way at 12c1273 and at HEAD:HSA_STATUS_ERROR_INVALID_CODE_OBJECTduring calibration (grid 4096x256). The error is sticky, so every later test in the file fails with "device kernel image is invalid". WithAMD_SERIALIZE_KERNEL=3it surfaces instead aslinalg.cholesky ... not positive-definiteinqqq.py:750. A 2-layer Llama-3.2-1B QQQ quantize (g=-1 and g=128) is clean, so I could not reduce it. Someone with an idle R9700 should look at it.
Environment only (ROCm venv): peft, optimum, torchvision, einops and llama-cpp-python are not installed (test_integration, test_quant_and_eora_transformers, ERNIE-VL, Nemotron-H). defuser 0.0.28 is installed (see #4769).
🤖 Generated with Claude Code
Activity
Qubitium commentedon Nov 17, 2026
Follow-up on section 4 ("instability on a shared card"), re-checked on
main@ dba142d, one idle R9700 (gfx1201), nothing else on the card:test_qqq.py::TestGroupSize::test_quant_and_inference_0is not contention. It fails deterministically, 2/2 runs in about 34 s withlinalg.cholesky ... not positive-definiteatqqq.py:948, whenevertests/models/model_test.py:15takes effect. That line forcesexpandable_segments:Trueon ROCm. With that line removed, the same test passes (459 s). It also passes, 3/3 runs plus the whole file 10/10, when CUDA was already initialised before the harness import, so that the variable was ignored. Root cause and repro: [TEST][ROCm] tests/models/model_test.py forces PYTORCH_ALLOC_CONF=expandable_segments:True for ~250 test files, overriding the ROCm-safe default: test_qqq quant tests fail on an idle R9700 (Cholesky not PD), root cause of #4770 sect. 4 #4821.HSA_STATUS_ERROR_INVALID_CODE_OBJECT(kernel_obj=0x0) in the round-14 log hit two unrelated processes on the same card within about 10 s:test_qqqat 13:23:01 andtest_quant_batchat 13:22:5x. A run on another card died withhipErrorLaunchFailureat 13:24:22. So that particular symptom was a device-level event on top of the corrupting allocator setting.test_awq_gemmquantize stage, Llama-3.2-1B, 512 C4 rows, instrumented): with GPT-QModel's ROCm default it was clean 2/2, with no non-finite scales, clip values or weights. With expandable segments, 1 of 2 runs saw non-finitemlp.gate_proj/mlp.up_projweights right afterapply_clip, even though the AWQ clip values and scales were finite. That matches the round-14 NaN-scale assert and points to the same allocator cause as [TEST][ROCm] tests/models/model_test.py forces PYTORCH_ALLOC_CONF=expandable_segments:True for ~250 test files, overriding the ROCm-safe default: test_qqq quant tests fail on an idle R9700 (Cholesky not PD), root cause of #4770 sect. 4 #4821.🤖 Generated with Claude Code
test: fix stale doubles/oracles in the suite-triage red list (#4769) (#…
Qubitium commentedon Nov 17, 2026
Round-17 ROCm re-triage at
main@ 3867c82 (R9700 / gfx1201, ROCm 10.1, torch 2.16, py3.14t, card selected withROCR_VISIBLE_DEVICES). Each item below failed in the full run and again 2-3 times when run alone.Still red, unchanged from the issue body: every section-1 item (
test_awq_native_eval_autograd,test_static_cache_compile_4669,test_marlin_scratch_cuda(70 now, was 62),test_asymmetric_real_model_gates(3),test_kernel_audit_regressionsAWQ/Machete (2),test_bitblas,test_qqq_jit,test_checkpoint_modules::test_qqq_optional_group_scales_schema,test_gptqmodel_nf12_api(2),test_exl3_wide_input[32-bc],test_awq_gemv_insession_4554, ...), both section-2 files (test_default_device_mixed_capability_4705(3),test_max_memory_kernel_devices_4632), and section 3 (test_allspark_awq(2),test_awq_clip_consistency(6),test_gptq_post_inverse_fallback_4400QQQ 5.13x).New ROCm-only red tests since b225a43, same classes as this issue:
test_glm5_core_cuda.py::test_native_mcg_wrapper_matches_serialized_bf16_linear[*-dtype1-*](4) andtest_kimi_k3_core_cuda.py::test_padded_native_and_reconstruct_wrapper_inference[*-dtype1](2):EXL3_EXLLAMA_V3 inference requires NVIDIA CUDA, but the module is on rocm. The bf16 cases passed at b225a43 only because bf16 used to fall back to torch reconstruction. Since 55b267b (perf(exl3): keep bf16 activations on the native fp16 kernels (#4767) #4817, bisected on this card) bf16 also goes to the native kernel. This is not a user-facing regression: a realLlama-3.2-1B-Instruct-EXL3-W4loaded with AUTO on ROCm selectsExllamaV3TorchLinearin bf16 and in fp16 and generates " Paris. The Eiff". The tests needskipif(torch.version.hip)for the whole file, not just the fp16 cases.test_awq_gemv_insession_4554.py::test_awq_gemv_fast_quantize_save_and_reload_on_cpu[gemv_fast, llm_awq]: new parameters that fail with the samerequire the native CUDA AWQ extensionerror as the listed GEMV case.test_moe_config.py::TestMoEConfig::{test_moe_routing_bypass, test_moe_routing_bypass_batch_size, test_moe_routing_override}(3):experts.10.gate_proj exists but is MarlinLinear (got TorchLinear). Line 153 hard-codesMarlinLinearas the expected quantized class, so on ROCm, where AUTO correctly picks a portable kernel, it fails. (At b225a43 this file timed out at 600 s on ROCm, so it was never seen.) Compare againstBaseQuantLinearor the selected kernel instead.test_default_device_capability_group_map_4734.py(new file, 3/3):test_one_gpu_per_capability_maps_only_the_first_group,test_a_group_with_two_devices_maps_to_exactly_those(assert 3 == 2),test_an_explicit_mixed_span_is_still_refused(DID NOT RAISE).test_torch_ops_jit_extension.pyCUDA-fingerprint tests, red since 6dffaf2 (fix(rocm): key the HIP JIT cache by the gfx target (#4815) #4826). Listed with the bisect in [TEST] Suite triage at 3867c82af (RTX 4090 + R9700): 7 tests left red by #4871, #4829, #4837, #4835, #4810, #4930, #4856 (stale doubles/oracles; library behaves as intended) #4969 item 10.test_bench_cuda_even_d2h.py::test_even_d2h_pool_shape_sensitivitynow also fails (ratio bound), together withtest_even_d2h_request_wall.Section 4 (instability on a shared card):
test_quant_time,test_thread_pool_exit,test_threadx::test_virtual_pool_cuda_alias_behaviour, and thedevice kernel image is invaliderrors intest_qwen2_5_omni_lm_headall pass when run alone (2/2). The full run'stest_qwen4_exp_exl3_contracts/test_shared_input_hessian_dedup_real_model_e2eaborts werehipblaslt ... out of memory/hipErrorLaunchFailurewhile the card was shared. Contention, not bugs.🤖 Generated with Claude Code
Qubitium commentedon Nov 18, 2026
Agent claim:
agent-root-4770-rocm-gatingis working on this issue now.Started 2026-11-18T00:14Z. The claim expires 4.0h after this comment is last edited; it is released with the PR link or with a stand-down comment.
Scope: section 1 (a shared
requires_nvidia_cudagate so CUDA-only kernels skip instead of fail on ROCm), section 2 (skipif(torch.version.hip)for CUDA-capability fakes), and section 3's staleallsparkexpectation. Sections 3's HIP numeric tolerances and section 4 (card-instability) are out of scope for this pass.Qubitium commentedon Nov 18, 2026
Section 1 (missing ROCm skip), section 2 (CUDA-capability fakes) and section 3's stale
qzeros_formatexpectation are fixed in #5056, merged as4d2174fe991164808dd14c33dd011b2301d0ca45.What landed
tests/accelerator_gates.py::requires_nvidia_cuda()(torch.cuda.is_available() and torch.version.hip is None), unit-tested withtorch.version.hippatched (False for HIP, False with no device, True only on a CUDA build + device).test_marlin_scratch_cuda.require_dtype()alsopytest.skips on HIP, as asked.test_marlin_device_profile.pywas already gated onmain; unchanged.skipif(torch.version.hip is not None)on the threetest_default_device_mixed_capability_4705grouping/refusal tests andtest_max_memory_kernel_devices_4632::test_a_budget_that_names_both_cards_still_rejects_mixed_capabilities(they keep running on CPU-only hosts).test_allspark_awq.py::test_awq_module_export_keeps_checkpoint_layoutnow expectsqzeros_formatand excludes it from the export, matching the CUDA twin.Verification (PG506 / sm_80, CUDA 13, torch 2.15; ROCm not executed here)
tests/test_accelerator_gates.py: 26 passed (25 on base + the new predicate test).origin/mainat the same commit. The only delta is the new predicate test; the 16 failures are pre-existing AVX512-only / device-move nodes and reproduce identically on base. No gated node skipped on CUDA.test_marlin_scratch_cuda.py: 60 passed, 2 skipped (two-GPU cases).test_glm5_core_cuda.py+ the AllSpark CUDA twin export test: 12 passed.torch.version.hippatched before collection) over the same nodes: 10 passed, 100 skipped, 0 failed - every gated node skips with its reason while ungated nodes still run.ruff checkclean on every touched file. CI on test: skip CUDA-only kernels on ROCm with a shared requires_nvidia_cuda gate (#4770) #5056: all checks green.Not verified: actual ROCm execution, and the AllSpark HIP twin itself (RDNA4-only, skips on CUDA); its expectation was checked against the CUDA twin and a direct
AllSparkAwqLinear.state_dict()key check on this host.