Repository navigation
test: realign ROCm suite expectations, thread-cap probe and qzeros marker - #4360
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4351
Summary
Three test-side classes from the R9700 suite triage at
842d666, reproduced atcurrent
main(25 failures). Every failing test was classified before editing;no assertion was weakened and no test was skipped just to make it pass.
kernels/test_qqq_workspace.py(7)NotImplementedError: QQQ (BACKEND.QQQ) has no ROCm kernelvalidate_oncegate the file's helper already bypasses for the other probes; the sizing is pure Python and runs on both backendstest_nan_activation_quantizers_4220.py::test_fp8_triton_quantizer_propagates_nanNotImplementedError: W4A Triton kernels are CUDA-only(12, 0); addIS_ROCMto the gatetest_thread_caps.py::test_process_thread_count_does_not_scale_with_cpu_countAssertionError: (399, 320)aftertest_paro_branch_replay_maskskernels/test_torch_int8.py::test_native_int8_checkpoint_save_strict_reload_and_oracle(12)projection.qzeros_formatthatstate_dict()carrieskernels/test_w4a_cache_lifecycle.py(3)state_dict()sets missing the marker;test_persistent_weight_bytescounted its 8 bytes as a derived cachenative_namesmodule_tree/test_llama_fusion.py::test_source_operands_share_only_fused_storage_and_unfuse_restores_it[False-gptq, False-awq](2)*.qzeros_formatLibrary-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 returnsQQQ_ROCM_UNSUPPORTEDon ROCm before the file's existingqqq_runtime_available/validate_devicestubs are reached. The file's own_builddocstring says the probes are stubbed because "the sizing is purePython". 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 oldcapability < (8, 9)gate never fired on ROCm andfp8_packraised. The QQQ quantizer test in the same file does work on ROCmand 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:
399 threads is
8 DeviceThreadPool workers x their own OMP teamplus thetokenizer'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_pythonhelper the file already uses for its other cap tests) and keepsthe original
max(32, cpu_count // 4)bound and thetorch.get_num_threads()check. After: 7 passed for
test_thread_caps.py + test_paro_branch_replay_masks.py + test_thread_caps.pyin 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 andget_state_dict_for_savedeliberately drops it.#4241 already realigned the same class of expectation in
test_allspark_linear.py,test_allspark_awq_cuda.pyandtest_awq_gemv_splitk.py; these three files were simply not in that commit'slist. The fixes follow exactly those forms.
Results
(The CUDA run additionally includes
test_thread_caps.py; the ROCm runincludes the separate ordering run above.)
No numeric assertion changed, so no FP64 oracle is involved: the
qzeros_formatfixes 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)
test_weight_only_looper, granitemoe_swa,test_moe_tags,test_ret_idx_cache_invalidationload_assign) and section 5 (p2pdocstring) are not test-side triage and are untouched.
test_rocm_default_env[qqq]reproducibility flake was not reproduced.Residual risk
test_process_thread_count_does_not_scale_with_cpu_countno longer observesthreads created by other tests. The underlying oversubscription (a
per-caller OpenMP team per
DeviceThreadPoolworker, plus the tokenizer'srayon 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.pynow runs on ROCm by stubbingvalidate_once. If theworkspace sizing ever grows a backend-specific branch, this pure-Python test
will not catch it.