Repository navigation
[Test] Shrink the default shapes of test_topk_per_row.py - #7323
Conversation
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: |
Standard CI runs this file without arguments, and the default sweep of about 5000 timed shapes took 2264 s of one shard. Shrink the defaults to -c 8 4096 90000, -k 512 2048, -b 4 and -n 1 4. They still reach short rows, the FlyDSL one-workgroup and split decode, ragged rows, both one-block prefill kernels, the stable and value variants, and widths past 65535. --full sets the previous lists for perf runs; the sweep loops and checks are unchanged. A bare run is 148 cases on gfx950 and took 327 s on one MI355X.
52232bf to
5ceff8f
Compare
|
The direction is right — the old defaults put 336 of their 456 decode calls (74%) into a single dispatch gate — but dropping
Adding Two things that are not caused by this PR but are worth folding in while the defaults are being redesigned:
A cheap guard against this class of regression: assert at startup that every gate in |
Dropping 32768 from -c left the stable (32768, 65535, 16) gate on gfx950 without a hit, so put it back in the defaults. Add the flydsl-decode-gates regression: for each gate in this arch's _FLYDSL_TOPK_DECODE_GATES and each k in _FLYDSL_TOPK_DECODE_KS, run one default-dispatch decode at the gate's smallest width (at least 2k) and its row limit, assert that it routes to FlyDSL decode and matches torch.topk. This also covers the gates from 131072 up and k=4096, which the sweep never reached, without growing the prefill shapes that share -c. A bare run is now 192 cases on gfx950 and took 413 s on one MI355X.
@zufayu Ready for review at 8f93aae. 32768 is back in |
zufayu
left a comment
There was a problem hiding this comment.
Verified at 8f93aae: 32768 is back in the default -c, and test_flydsl_decode_gates is a better fix than the startup assert I suggested — you are right that an assert cannot work while -c also drives the prefill rows.
Driving each gate at its smallest width and row limit for every k in _FLYDSL_TOPK_DECODE_KS, and asserting the route rather than just the result, covers more than the regression I flagged: k=4096 and the three gates neither of us had hits for (gfx950 non-stable from 131072, gfx942 stable from 131072 and non-stable from 524288) were all dark before this.
413s for 192 cases is a good trade against the ~2226s this file measures today on MI35X.
Conflict in op_tests/test_topk_per_row.py with #7323: this branch moved the argument parser into build_parser()/main(), #7323 shrank the default shapes and added --full. Kept the functions and moved the new defaults, --full and _FULL_MATRIX into them. #7323's test_flydsl_decode_gates called _should_use_flydsl_topk_decode, which this branch replaced with decode_backend_for_call; it now asserts the call resolves to BACKEND_SINGLE (no max_row_len, so the adaptive path is declined).
* [Test] Shrink the default shapes of test_topk_per_row.py Standard CI runs this file without arguments, and the default sweep of about 5000 timed shapes took 2264 s of one shard. Shrink the defaults to -c 8 4096 90000, -k 512 2048, -b 4 and -n 1 4. They still reach short rows, the FlyDSL one-workgroup and split decode, ragged rows, both one-block prefill kernels, the stable and value variants, and widths past 65535. --full sets the previous lists for perf runs; the sweep loops and checks are unchanged. A bare run is 148 cases on gfx950 and took 327 s on one MI355X. * [Test] Cover every FlyDSL decode gate in test_topk_per_row.py Dropping 32768 from -c left the stable (32768, 65535, 16) gate on gfx950 without a hit, so put it back in the defaults. Add the flydsl-decode-gates regression: for each gate in this arch's _FLYDSL_TOPK_DECODE_GATES and each k in _FLYDSL_TOPK_DECODE_KS, run one default-dispatch decode at the gate's smallest width (at least 2k) and its row limit, assert that it routes to FlyDSL decode and matches torch.topk. This also covers the gates from 131072 up and k=4096, which the sweep never reached, without growing the prefill shapes that share -c. A bare run is now 192 cases on gfx950 and took 413 s on one MI355X. --------- Co-authored-by: lirui927 <[email protected]>
Summary
Shrink the default shapes of
op_tests/test_topk_per_row.pyto keep CI short.Motivation
CI runs the file without arguments; the default sweep of about 5000 timed shapes took 2264 s of one shard in run 41382065915.
Changes
-c 8 4096 90000 -k 512 2048 -b 4 -n 1 4reach the same kernel paths as the old lists.--fullsets the old lists; loops and checks are unchanged.Performance (if applicable)
Testing
Changed op tests
op_tests/test_topk_per_row.py: smaller default shapes and--full; no check changes.