Repository navigation
Description
Version: 7.11.0 @ 9dad249. Library behaviour is correct in each case below; the tests need fixing.
-
No ROCm gate on tests that force a CUDA-only kernel.
- Tests:
tests/test_triton.py::TestTriton::test_triton_qlinear_{0,1}andtests/test_q4_triton.py::TestsQ4Triton::test_generation_desc_act_{false,true}. - They force
BACKEND.TRITON, which selectsTritonV2Linear(SUPPORTS_DEVICES=[DEVICE.CUDA]). The load then correctly raises "TritonV2Linear is CUDA-only and does not run on ROCm". - Fix: add a
cuda_only_skip_reasongate.
- Tests:
-
tests/test_kernel_device_error_reason.py(3 tests) patches the wrong check.MacheteLinear.validate()callscached_validate_once()first. UnderIS_ROCMthat returnsMACHETE_ROCM_UNSUPPORTED(machete.py:172-176) before the patchedvalidate_deviceruns.- So
test_rocm_rejection_reason_survivesalways fails on ROCm, and the other two depend on cache order on CUDA.
-
Stale GGUF selection tests in
tests/kernels/test_selection.py(4 tests).- Tests:
test_select_quant_linear_smoke[GGUFTritonKernel-gguf-gguf],test_cuda_auto_select_prioritizes_triton_then_cpp_then_torch_for_gguf,test_cuda_pack_auto_select_prioritizes_triton_for_gguf,test_explicit_gguf_triton_backend_selects_triton_kernel. - They use
bits=4, which now resolves to Q4_0. After the [BUG] GGUFConfig(bits=4) default q4_0 (and q5_0) quantize crashes with backend=AUTO (CUDA+ROCm: GGUFTritonKernel selected, no fallback); [ROCm] AWQ format=gemv AUTO quantize picks CUDA-only AWQ_GEMV #4107 / fix(kernels): gate GGUF AUTO selection by qtype and resolve AWQ GEMV on ROCm (#4107) #4114 qtype gate,GGUFTritonKernelrejects Q4_0. Not ROCm-specific.
- Tests:
-
Tolerance in
tests/kernels/test_paroquant.py::test_paroquant_identity_forward_matches_awq_torchis meaningless near zero.- It passes alone but fails after
tests/kernels/test_awq_torch.py, because of RNG state. It fails for 57/60 seeds in 0–59. - In each case both kernels are within about 1 fp16 ulp of an fp32 oracle (|y|≈300, diff 0.125–0.25). The failing elements are near-zero outputs after cancellation, where
atol=rtol=5e-3doesn't make sense. - Fix: use a scale-aware tolerance.
- It passes alone but fails after
-
Wrong bitwise expectation in
tests/test_hessian_device_reduction_order.py::test_hessian_reduction_uses_device_order_not_arrival[*](6 tests).- The reduction order is deterministic: all 6 permutations give the same H.
- The test's bitwise expectation sums first and scales after, while
materialize_global_hessian(gptq.py:~1288-1310) doesadd_(partial, alpha=2/n), which torch CPU runs as an FMA. - E.g.
zeros.add_(1e20, alpha=2/3).add_(-1e20, alpha=2/3)gives9.45e11, whereas scale-then-add gives0.0. - Fix: make the expectation mirror the
add_(alpha)contract.
Minor: the debug log at nn_modules/qlinear/gguf_triton.py:1189 says "The automatic backend is GGUF_TORCH", but AUTO picks GGUFTritonKernel on ROCm.
Found during an AI-assisted review (Claude Code) of 9dad249; repros were run on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.
Activity
test: fix test-side failures from ROCm, GGUF qtype and Hessian order (#…