Repository navigation
[CI] [MLA] test_mla_v4_nm: make the script perf sweep opt-in - #7321
Conversation
Running `python3 op_tests/test_mla_v4_nm.py` with no arguments (how aiter_test.sh runs op_tests) launched the full perf sweep: 10 batches x 6 kv lengths, each timing ref / asm kernel / asm total for 50 iters. That took ~2000 s in CI against an ~870 s timing estimate. The sweep now runs only with --full-sweep, or with an explicit -b / -c / -q to sweep a subset. With no arguments the script prints a skip notice and exits 0. The gfx950 guard, the --oob-worker subprocess paths used by the pytest OOB tests, the sweep defaults, and every pytest test are unchanged.
NOT READY FOR HUMAN REVIEWPR Self-ReviewRevision Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision. Questions to answer in the PR description
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
|
Making the perf sweep opt-in is right, but as it stands this makes the file run nothing in standard CI, not just skip the sweep.
Fix: add This is not hypothetical —
The tell is the recorded time: Worth checking the same thing in the other opt-in PRs going out (#7318, #7331, #7323): if a file's default path can now exit without running cases, confirm how |
With the perf sweep opt-in, `python3 op_tests/test_mla_v4_nm.py` exits 0 without running anything, and the file's smoke / determinism / kernarg / OOB suite only runs under pytest. Add the file to a pytest dispatch branch so standard CI executes those 50 cases instead of reporting an empty run as success.
|
Correction to my earlier comment, and some numbers that change the stakes here. Correction: I wrote that this change stops the pytest suite from running. That was wrong — those 29 What this PR does change is that the sweep stops running too, so the file goes from "sweep only" to "nothing at all", and returns 0 either way. The file is bigger than the recorded time suggests. From two against Three ways to keep CI covering something, roughly in order of effort: A. Add the file to the pytest branch in op_tests/test_fhmoe.py|op_tests/tuning_tests/test_fhmoe_tuner.py|op_tests/test_hipb_grouped_gemm.py|op_tests/test_mla_v4_nm.py)
test_cmd=(timeout 60m python3 -m pytest -q "$file")One line. The sweep stays opt-in exactly as designed here, and the 29 smoke / determinism / kernarg tests run in CI for the first time. Worth knowing they may not be green on first contact, since nothing has been running them — but that is the point of running them. B. Have C. Both. A is the smallest change and the only one that adds coverage rather than just preserving it. For context on why "returns 0 having run nothing" is worth avoiding specifically: |
* [MLA] test_mla_v4_nm: make the script perf sweep opt-in Running `python3 op_tests/test_mla_v4_nm.py` with no arguments (how aiter_test.sh runs op_tests) launched the full perf sweep: 10 batches x 6 kv lengths, each timing ref / asm kernel / asm total for 50 iters. That took ~2000 s in CI against an ~870 s timing estimate. The sweep now runs only with --full-sweep, or with an explicit -b / -c / -q to sweep a subset. With no arguments the script prints a skip notice and exits 0. The gfx950 guard, the --oob-worker subprocess paths used by the pytest OOB tests, the sweep defaults, and every pytest test are unchanged. * [CI] aiter_test.sh: run test_mla_v4_nm.py through pytest With the perf sweep opt-in, `python3 op_tests/test_mla_v4_nm.py` exits 0 without running anything, and the file's smoke / determinism / kernarg / OOB suite only runs under pytest. Add the file to a pytest dispatch branch so standard CI executes those 50 cases instead of reporting an empty run as success.
Summary
When CI runs
python3 op_tests/test_mla_v4_nm.pywith no arguments, the script launches the full perf sweep: 10 batch sizes x 6 kv lengths, and for each shape it times ref / asm kernel / asm total at 50 iters each. This took ~2000 s in CI, against a timing estimate of ~870 s.This PR makes only the sweep opt-in:
--full-sweepruns the full sweep (same default shape lists as before).-b/-c/-qsweeps just that subset.Unchanged: the gfx950 guard, the
--oob-workersubprocess entry points, all pytest tests, and the CI scriptaiter_test.sh.PR Self-Review
Reviewed revision
4943058
Behavior and intent
Only the
__main__script driver ofop_tests/test_mla_v4_nm.pychanges. Before this PR, a barepython3 op_tests/test_mla_v4_nm.py(how.github/scripts/aiter_test.shruns op_tests) always ran the full perf sweep over 60 shapes. Each shape runs an accuracy check plus three 50-iteration perf timings. That is a benchmarking workload, not a CI check: it took ~2000 s in CI (run 41382065915) against the ~870 s estimate in.github/split-test-times/aiter.tsv, which unbalances the shard.After this PR, the sweep runs only when asked for explicitly:
--full-sweepfor the full default grid, or any explicit-b/-c/-qfor a subset. A bare invocation prints a skip notice and exits 0. The default shape lists, the sweep loop, the perf summary and the exit-1-on-failure behavior are all unchanged. The gfx950 guard and the--oob-workerentry points, which the pytest OOB tests launch as subprocesses, are untouched.Validation and unverified scope
Hardware: MI350 (gfx950), single GPU (
HIP_VISIBLE_DEVICES=6), aiter dev container, clean worktree at this revision.python3 op_tests/test_mla_v4_nm.py: prints the skip notice, exit 0, 4 s wall.python3 op_tests/test_mla_v4_nm.py -b 2 -c 256 --iters 5: runs accuracy + perf for that shape, prints the perf summary, exit 0.python3 op_tests/test_mla_v4_nm.py --help: shows--full-sweepand the defaults.python3 -m pytest -q -p no:cacheprovider op_tests/test_mla_v4_nm.py: 50 passed.black --checkandruff check(ruff 0.16.0, matching the CI pin): clean.Unverified: I did not run
--full-sweepend to end in this PR, because it executes the same loop over the same default lists that previously ran unconditionally. I also have not yet seen the new CI shard time for this file; it should drop from ~2000 s to a few seconds of import plus the skip.PR-specific question
No test assertion was added or changed, so there is no behavior that fails before this PR and passes after it. The PR removes a CI cost, not a coverage gap. Correctness coverage for the v4 nm MLA kernel stays in the file's pytest suite (smoke / accuracy, determinism, kernarg, OOB). Those tests are unchanged and still pass. The perf sweep never contributed coverage beyond them for CI purposes: its accuracy checks run on the same kernel path, and its perf numbers are not asserted against any threshold.
Changed op tests
op_tests/test_mla_v4_nm.py: covers the gfx950 v4 nm MLA decode asm kernel (accuracy against the reference, determinism, kernarg layout, OOB guards via--oob-workersubprocesses), plus a manual perf-sweep driver. This PR changes only the driver's default: it becomes opt-in, so standard CI no longer runs a ~2000 s benchmark. Every pytest test and the worker entry points are byte-for-byte unchanged. The file is not redundant: it is the only op test for the v4 nm MLA asm kernel. No coverage is added or removed.