Repository navigation
mrope cache-quant test: covering default set, full matrix behind --full - #7318
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
… --full The default entry point swept 602 cases (1131 s on MI355X standard CI, run 41382065915). Each case costs ~1.9 s regardless of token count, so the time is a fixed per-case cost rather than kernel work. Run a 46-case covering set by default: one case per kernel instantiation the full matrix reaches (<head_size, neox, interleaved, KV dtype> for MRoPE, <head_size, neox, KV dtype> for RoPE), with token count, head count and return-kv rotating so every head size runs bf16 and fp8 KV with return-kv on and off, plus the strided vLLM KV view, partial-rotary RoPE/MRoPE and GemmaRMSNorm cases (incl. Qwen3.8-27B TP1, 24 q / 4 kv). The previous matrix is unchanged behind --full. Sweep-axis flags (-n/-t/-hd/-hs/-i/-k) now error out without --full instead of being silently ignored; -d/-m apply to both, and default token counts are clamped to --max_positions. Signed-off-by: Vorapol Assavasangthong <[email protected]>
a55c48b to
a7d523e
Compare
|
Checked the default covering set against the sweep it replaces — it holds up, and the split it makes is the right one: full cartesian on the dimensions that pick a kernel ( Replaying the rotations over the 24 + 12 cases: No value of any rotated axis is dropped, and For reference, measured on an idle GPU with the baseline and the narrowed run back to back (rc=0 both):
Two things worth confirming before this lands:
|
… --full (ROCm#7318) The default entry point swept 602 cases (1131 s on MI355X standard CI, run 41382065915). Each case costs ~1.9 s regardless of token count, so the time is a fixed per-case cost rather than kernel work. Run a 46-case covering set by default: one case per kernel instantiation the full matrix reaches (<head_size, neox, interleaved, KV dtype> for MRoPE, <head_size, neox, KV dtype> for RoPE), with token count, head count and return-kv rotating so every head size runs bf16 and fp8 KV with return-kv on and off, plus the strided vLLM KV view, partial-rotary RoPE/MRoPE and GemmaRMSNorm cases (incl. Qwen3.8-27B TP1, 24 q / 4 kv). The previous matrix is unchanged behind --full. Sweep-axis flags (-n/-t/-hd/-hs/-i/-k) now error out without --full instead of being silently ignored; -d/-m apply to both, and default token counts are clamped to --max_positions. Signed-off-by: Vorapol Assavasangthong <[email protected]>
What
op_tests/test_fused_qk_norm_mrope_cache_quant.pynow runs a 46-case covering set by default. The previous ~600-case matrix is unchanged and runs with--full(for a perf or nightly job).Why
In standard CI the default entry point took 1131 s on MI355X (run 41382065915, shard 2/8, 602 cases). Each case costs about 1.9 s at any token count (1257 tok: 1.88 s, 127: 1.86 s, 3: 1.85 s), so the time is a fixed per-case cost (test setup and the perftest loops for kernel and torch reference) rather than kernel work. Fewer cases is the fix. Requested by @zufayu.
Default set (46 cases)
The kernels are templated on
<head_size, neox, interleaved, KV dtype>(MRoPE) and<head_size, neox, KV dtype>(RoPE); everything else is a runtime argument.Every runtime value the full matrix uses (tokens, heads, return-kv, rotary dims, Gemma norm, strided layout) also appears in the default set.
Expected runtime is about 90 s (46 × ~1.9 s). This PR's own CI run gives the measured number.
How tested
--full, everymrope_sectionsums torotary_dim / 2, and--fullruns the same 602 cases as before.__main__exercised with stubbed GPU deps: no args runs 46 cases,--fullruns 602,-t 513 --fullruns 202, and a sweep-axis flag such as-t 513without--fullexits with an error instead of being silently ignored.-d/-mstill apply to the default set (token counts are clamped to-m)..github/split-test-times/aiter.tsvstill lists 1120 s for this file. I left it for the automated split-times update.PR Self-Review
Reviewed revision
a7d523e
Behavior and intent
Running
python op_tests/test_fused_qk_norm_mrope_cache_quant.pywith no arguments now runs 46 cases instead of 602, and--fullruns the old matrix unchanged. Before this PR, every standard CI run spent about 19 minutes on this one file (1131 s in run 41382065915), mostly re-running the same kernel instantiations at different token and head counts. The kernel and op code are not changed.Validation and unverified scope
Validated without a GPU, by stubbing torch, triton and aiter and recording every call to
test_mrope_3d_rms_set_kv_shuffle:--fullreaches.--fullruns the same 602 cases as before.mrope_sectionsums torotary_dim / 2.--fullexit with code 2.Checked against the kernel source:
fused_mrope_rms_set_kvlaunches one warp per (token, head), so the new 24 q / 4 kv case is not limited by head count.Unverified until this PR's standard CI runs on MI35X:
PR-specific question
Which regressions could the default set now miss that the old default caught? A bug that only shows at a particular combination of runtime arguments, for example fp8 KV with GPT-J style at 64 heads and 1257 tokens. Every compiled kernel instantiation still runs, and every runtime value appears at least once, so only cross-combinations of runtime arguments go untested.
--fullcovers those and is meant for a perf or nightly job.Changed op tests
op_tests/test_fused_qk_norm_mrope_cache_quant.pyis the only test forfused_qk_norm_mrope_3d_cache_pts_quant_shuffleandfused_qk_norm_rope_cache_pts_quant_shuffle, so it is not redundant with any other test.checkAllcloseagainst the torch reference, and a bit-exact comparison of the strided layout against the contiguous one.