Skip to content

[TEST] Tests that fail for test-side reasons (found triaging the suite on ROCm R9700 / gfx1201) #4234

Closed

Description

@Qubitium

Version: 7.11.0 @ 9dad249. Library behaviour is correct in each case below; the tests need fixing.

  1. No ROCm gate on tests that force a CUDA-only kernel.

    • Tests: tests/test_triton.py::TestTriton::test_triton_qlinear_{0,1} and tests/test_q4_triton.py::TestsQ4Triton::test_generation_desc_act_{false,true}.
    • They force BACKEND.TRITON, which selects TritonV2Linear (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_reason gate.
  2. tests/test_kernel_device_error_reason.py (3 tests) patches the wrong check.

    • MacheteLinear.validate() calls cached_validate_once() first. Under IS_ROCM that returns MACHETE_ROCM_UNSUPPORTED (machete.py:172-176) before the patched validate_device runs.
    • So test_rocm_rejection_reason_survives always fails on ROCm, and the other two depend on cache order on CUDA.
  3. Stale GGUF selection tests in tests/kernels/test_selection.py (4 tests).

  4. Tolerance in tests/kernels/test_paroquant.py::test_paroquant_identity_forward_matches_awq_torch is 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-3 doesn't make sense.
    • Fix: use a scale-aware tolerance.
  5. 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) does add_(partial, alpha=2/n), which torch CPU runs as an FMA.
    • E.g. zeros.add_(1e20, alpha=2/3).add_(-1e20, alpha=2/3) gives 9.45e11, whereas scale-then-add gives 0.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions