Skip to content

test: realign ROCm suite expectations, thread-cap probe and qzeros marker - #4360

Merged
Qubitium merged 1 commit into
mainfrom
fix/issue-4351-rocm-suite-triage
Nov 16, 2026
Merged

Qubitium merged 1 commit into
mainfrom
fix/issue-4351-rocm-suite-triage

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Fixes #4351

Summary

Three test-side classes from the R9700 suite triage at 842d666, reproduced at
current main (25 failures). Every failing test was classified before editing;
no assertion was weakened and no test was skipped just to make it pass.

# test before (R9700) verdict fix
1a kernels/test_qqq_workspace.py (7) 7 failed: NotImplementedError: QQQ (BACKEND.QQQ) has no ROCm kernel test-wrong stub the validate_once gate the file's helper already bypasses for the other probes; the sizing is pure Python and runs on both backends
1b test_nan_activation_quantizers_4220.py::test_fp8_triton_quantizer_propagates_nan 1 failed: NotImplementedError: W4A Triton kernels are CUDA-only test-wrong skip gate only checked SM >= 8.9, and ROCm reports (12, 0); add IS_ROCM to the gate
2 test_thread_caps.py::test_process_thread_count_does_not_scale_with_cpu_count passes 5/5 alone, AssertionError: (399, 320) after test_paro_branch_replay_masks test-wrong measure the harness contract in a fresh subprocess instead of counting process-wide threads
3a kernels/test_torch_int8.py::test_native_int8_checkpoint_save_strict_reload_and_oracle (12) 12 failed: writer set lacked projection.qzeros_format that state_dict() carries test-wrong compare the writer against the checkpoint minus the marker
3b kernels/test_w4a_cache_lifecycle.py (3) 3 failed: state_dict() sets missing the marker; test_persistent_weight_bytes counted its 8 bytes as a derived cache test-wrong add the marker to the expected sets / to native_names
3c module_tree/test_llama_fusion.py::test_source_operands_share_only_fused_storage_and_unfuse_restores_it[False-gptq, False-awq] (2) 2 failed: export subset check included *.qzeros_format test-wrong exclude the marker from the set that must survive export

Library-wrong: none. All 25 failures are stale test expectations or
missing backend gates.

Evidence per class

1a — QQQ workspace. The failure is raised by validate() ->
cached_validate_once() -> validate_once(), which returns
QQQ_ROCM_UNSUPPORTED on ROCm before the file's existing
qqq_runtime_available / validate_device stubs are reached. The file's own
_build docstring says the probes are stubbed because "the sizing is pure
Python". Stubbing the gate is therefore the faithful fix and gives the sizing
coverage on ROCm instead of a skip. After: 7 passed on R9700, 7 passed on
RTX 4090
.

1b — FP8 NaN test. torch.cuda.get_device_capability() on gfx1201 reports
(12, 0), so the old capability < (8, 9) gate never fired on ROCm and
fp8_pack raised. The QQQ quantizer test in the same file does work on ROCm
and is untouched. After: SKIPPED on R9700 with a reason, PASSED on RTX 4090
(verified it is not skipped on CUDA).

2 — thread cap. Reproduced both ways:

pytest tests/test_thread_caps.py                          -> 5 passed
pytest tests/test_paro_branch_replay_masks.py tests/test_thread_caps.py
                                                          -> 1 failed, AssertionError: (399, 320)

399 threads is 8 DeviceThreadPool workers x their own OMP team plus the
tokenizer's rayon pool, i.e. threads created by an unrelated test. The property
the file documents is "a fresh pytest process does not size its pool from the
advertised CPU count", so the test now measures that in a subprocess (the same
_run_python helper the file already uses for its other cap tests) and keeps
the original max(32, cpu_count // 4) bound and the torch.get_num_threads()
check. After: 7 passed for
test_thread_caps.py + test_paro_branch_replay_masks.py + test_thread_caps.py
in one process — the file runs twice with a quantize test in between.

3 — qzeros_format. The marker is intentional (#4125/#4134):
state_dict() carries it and get_state_dict_for_save deliberately drops it.
#4241 already realigned the same class of expectation in
test_allspark_linear.py, test_allspark_awq_cuda.py and
test_awq_gemv_splitk.py; these three files were simply not in that commit's
list. The fixes follow exactly those forms.

Results

suite before (R9700) after (R9700) after (RTX 4090)
the five affected files 25 failed, 166 passed, 26 skipped 0 failed, 185 passed, 27 skipped 0 failed, 217 passed

(The CUDA run additionally includes test_thread_caps.py; the ROCm run
includes the separate ordering run above.)

No numeric assertion changed, so no FP64 oracle is involved: the qzeros_format
fixes are set-membership and byte-accounting, and the thread-cap fix changes
where the count is measured, not the bound.

Ruff

ruff check gptqmodel docs/eora tests setup.py -> All checks passed.

Out of scope (noted, not touched)

  • Issue section 4 (device-independent pre-existing failures:
    test_weight_only_looper, granitemoe_swa, test_moe_tags,
    test_ret_idx_cache_invalidation load_assign) and section 5 (p2p
    docstring) are not test-side triage and are untouched.
  • The test_rocm_default_env[qqq] reproducibility flake was not reproduced.

Residual risk

  • test_process_thread_count_does_not_scale_with_cpu_count no longer observes
    threads created by other tests. The underlying oversubscription (a
    per-caller OpenMP team per DeviceThreadPool worker, plus the tokenizer's
    rayon pool) is real but belongs to the harness/library, not to this test; a
    long-lived pytest process still grows past the cap. Fixing that is a library
    change, out of scope for a test-triage PR.
  • test_qqq_workspace.py now runs on ROCm by stubbing validate_once. If the
    workspace sizing ever grows a backend-specific branch, this pure-Python test
    will not catch it.

…rker

Three test-side classes from the R9700 suite triage. Each failing test was
reproduced at HEAD and classified before editing.

1. Missing ROCm gates.
   - `kernels/test_qqq_workspace.py`: `validate()` consults the once-gate,
     which returns `QQQ_ROCM_UNSUPPORTED` before the file's runtime/device
     stubs. The workspace sizing is pure Python, so stub `validate_once`
     instead of skipping the file on ROCm (7 tests now run on both backends).
   - `test_nan_activation_quantizers_4220.py`: the E4M3 skip gate only checked
     compute capability, so it ran on ROCm and hit the CUDA-only `fp8_pack`.
     Gate on `IS_ROCM` too; the QQQ quantizer in the same file does work there.

2. Order-dependent thread cap.
   `test_process_thread_count_does_not_scale_with_cpu_count` counted
   process-wide threads, so a prior `quantize()` (DeviceThreadPool teams plus
   the tokenizer rayon pool) pushed it to 399 against the 80 limit. Measure the
   harness contract in a fresh subprocess instead, the pattern this file
   already uses for its other cap tests.

3. Stale `qzeros_format` expectations.
   The marker is intentional (#4125/#4134): `state_dict()` carries it and
   `get_state_dict_for_save` deliberately drops it. Realign
   `kernels/test_torch_int8.py`, `kernels/test_w4a_cache_lifecycle.py` and
   `module_tree/test_llama_fusion.py` the same way #4241 did for its files.

No assertion was weakened and no test was skipped to make it pass.

Fixes #4351
@Qubitium
Qubitium merged commit f789043 into main Nov 16, 2026
7 of 9 checks passed
@Qubitium
Qubitium deleted the fix/issue-4351-rocm-suite-triage branch November 16, 2026 09:37
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.

[TEST] ROCm test-suite triage at 842d666: missing ROCm skips, order-dependent thread-cap test, and tests that still expect no qzeros_format marker

1 participant