Repository navigation
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
NOT 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 |
The light 384-expert top-k now lives in aiter's topk_gating dispatch (ROCm/aiter#7846), next to the HIP kernels whose lane layout it follows. V4.1 already reaches topk_gating through FusedMoE.select_experts, so ATOM needs no code for it. Remove router_topk.py, its test and the moe.py hook, and revert the unrelated get_gfx change in router.py. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Active issues include architecture detection that can reject supported GPUs, empty benchmark sweeps that raise KeyError, and missing count-tensor validation that permits an unmasked device load from an empty tensor.
3 open issues
What changed in this PR
Adds a lightweight Triton path for 384-expert sqrtsoftplus routing in topk_gating, supporting DeepSeek-V4.1 decode workloads while preserving HIP selection and weight behavior.
Changes:
- Adds architecture-specific routing layouts for gfx950 and gfx1250.
- Limits dispatch by input format, row count, and graph-capture state, retaining HIP fallback.
- Adds bitwise HIP comparison tests, graph-replay checks, and a timing benchmark.
| File | Description |
|---|---|
op_tests/triton_tests/moe/moe_routing/test_topk_gating_sqrtsoftplus_384.py |
Tests bitwise parity, dispatch limits, strided inputs, and graph replay. |
op_tests/test_moe_topk_gating.py |
Adds the softplus-384 correctness and timing sweep. |
aiter/ops/triton/moe/moe_routing/topk_gating.py |
Adds the public wrapper and architecture-specific layout table. |
aiter/ops/triton/_triton_kernels/moe/moe_routing/topk_gating.py |
Implements sqrtsoftplus scoring, top-k selection, and normalization. |
aiter/ops/topk.py |
Adds guarded dispatch to the Triton specialization. |
Review effort: Balanced
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (4)
- Run the new test on gfx1250 and post the result. On gfx1250
topk_gatingtakes the Triton kernel for every renormalized 384-expert sqrtsoftplus call up to 1024 rows, in eager mode and in graphs (_SQRTSOFTPLUS_384_ROWS,aiter/ops/topk.py:114). TheWAVES=4 / EPT=3branch and the wave-list merge (_triton_kernels/.../topk_gating.py:207-211, 275-297) have never run on hardware for this branch. CI only ran the MI35X layout (test_topk_gating_sqrtsoftplus_384.pypassed there), and the PR body itself asks for a gfx1250 run. Addci:gfx1250-ffm-tritonor run the file on a gfx1250 box. A CPU transliteration of both layouts against the HIP kernels matched on 672 rows covering ties, NaN, ±inf and exhausted lanes, but that check cannot reach device math (exp2/log2/sqrt_rnagainst libm). - Test the first Triton launch under capture. On gfx950 eager calls never reach the Triton kernel (
graph_only=True), so in a real server the first JIT compile and module load happen inside graph capture.test_topk_gating_graph_replay_with_a_changing_row_countcompiles the kernel before capture (:183, "eager topk_gating may run HIP"), so this case is not tested. Either drop that pre-compile in one case and show that capture still works, or warm the kernel up intopk_gating's first eager call on gfx950. - Keep one arch table. The dispatch looks the arch up with
get_gfx_runtime()in_SQRTSOFTPLUS_384_ROWS. The wrapper uses Tritonget_arch()with an uncheckedSQRTSOFTPLUS_384_LAYOUTS[...](moe_routing/topk_gating.py:85).op_tests/test_moe_topk_gating.py:1177hard-codes1024for gfx1250 a third time. Put(waves, lanes, ept, max_rows, graph_only)in one table keyed byget_gfx_runtime(), have the test read its row limit from that table, and addtl.static_assert(EPT == 3 or EPT == 6), because theelsebranch assumes 6. - Clean up the small items.
- The
win_lane == LANESfallback (:230) is dead: NaN choices are mapped to-inf, so some lane always tiesbest. Remove it. best_wave = tl.sum(tl.zeros(...))(:258) is just a zero. Write0.- The
bench_sqrtsoftplus_384docstring (test_moe_topk_gating.py:524) says the bit check runs in a CUDA graph, but it runs eagerly. The graph is only used for timing. - The
rejects_a_bad_row_countparametrize builds CPU tensors and calls.cuda()(:134).op_tests/triton_tests/README.mdrule 1 forbids that. - Fill in the PR Self-Review sections that aiter-bot lists.
- The
Reviewed at 6451736. Copilot's 3 items (num_valid_rows check, runtime arch in the softplus-384 section, empty sweep) are fixed at head. Step 0: this is the light variant asked for in ATOM#3129, and no existing Triton routing top-k gives HIP bit-identity.
|
@valarLip thanks for the review. All four items are addressed in 941a984 (one new commit on top of 6451736, no rebase). 1. gfx1250 run. I added 2. First Triton launch under capture. New test 3. One arch table. 4. Small items.
Checks: black, ruff and py_compile pass on the five files. On gfx950 the whole new test file passes, and |
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (2)
- Post the gfx1250 pytest log of
test_topk_gating_sqrtsoftplus_384.pyat this head. On gfx1250 every captured 384-expert sqrtsoftplus call up to 1024 rows now takes the Triton kernel (SQRTSOFTPLUS_384_ARCHS["gfx1250"],aiter/ops/triton/moe/moe_routing/topk_gating.py:40). TheWAVES=4 / EPT=3branch, the wave-list merge and the newtest_topk_gating_first_triton_launch_under_capturehave no posted gfx1250 result at 941a984. The label does not help:ffm-bringup.yaml:47,57runs only whenhead.repo == repository, so this fork PR skips it. The 6451736 run is reported in prose only. Please paste the pytest summary (pass/fail per test) of the whole file, run at 941a984 on gfx1250 or gfx1250-strict. - Make the aiter-bot Self-Review pass. The bot still reports two FAILs at 941a984, and its own parser (
.github/scripts/pr_self_review.py:264-303) agrees on the current description:### Reviewed revisionmust hold only the SHA.941a984 (941a984…)failshead_sha.startswith(revision). Write941a98479bc7.- The validation answer must contain a word that matches the limitation regex, for example
unverifiedornot run. "Not verified yet" and "Not measured" do not match. Rename that bullet to "Unverified: …".
Re-reviewed at 941a984. Already fixed: first Triton launch under capture is tested in a fresh process with an empty cache, and it passed on MI35X CI (shard 3, job 132319490518). One arch table SQRTSOFTPLUS_384_ARCHS keyed by get_gfx_runtime() is now used by the dispatch, the wrapper and both tests. static_assert(EPT == 3 or EPT == 6) and WAVES*LANES*EPT == 384 are added. The dead win_lane == LANES fallback is removed (a CPU transliteration replay asserts it never fires: 672 rows, 0 mismatches against HIP). best_wave = 0. The bench docstring is corrected. The bad-count test is built on the device. gfx1250 is now graph-only as well.
|
@valarLip sorry for the missing reply on your 05:33Z review. Item 2 (Self-Review) was fixed in the description at 05:33:16Z, a few seconds before your review was posted, but the aiter-bot comment did not refresh then: on that event the required CI still counted as pending, so the bot did not rewrite its report. I triggered a manual refresh (run 44008692536). The bot comment now reads Author self-review accepted at
Item 1, the gfx1250 pytest summary of |
|
Performance on gfx1250 (relative) Measured at Config: DeepSeek-V4.1-Flash router, 384 experts, sqrtsoftplus, top-6, renormalized, routed scale 1.5, FP32 bias, BF16 logits,
Update: re-measured at the current head Same config and method: 5 rounds, median, same process, dispatch alternating with HIP. ids and weights are bit-identical to HIP at every row count in all 5 rounds.
Update: eager host cost after
|
|
@valarLip here is the gfx1250 pytest log of the whole 187 passed, 0 failed in 44.6 s. Per test function:
This exercises the Full log (gfx1250, head 941a984; `-v` lines and summary) |
|
Follow-up on the eager host cost: The gfx1250 eager timing against the merge base and the previous head is added at the end of #7846 (comment). The eager gap shrinks but does not close. What is left is mostly the capture query that the graph-only dispatch needs. At this head on gfx1250, the GPU test file and the new CPU test all passed. gfx950 has not been re-run at this head; the previous head's gfx950 results are in the description. Self-Review updated (Reviewed revision |
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (3)
- Rebase onto main and redo the gfx1250 entry against #7922. The PR conflicts with main (
aiter/ops/topk.pynow has@_routefrom #7874; the kernel, wrapper and op-test files also conflict). #7922 (merged today) moved the gfx1250 HIP path for 384 experts, top-k ≤ 8, ≤ 1024 rows totopk_gating_kernel_opt_vwave<384, WPT=2>(csrc/include/topk_gating_kernels.cuh:1805). Its header says this kernel is bit-identical tomultiwave<384, 2>: 2 waves × 32 lanes × 6 experts, ties broken bye % 64.SQRTSOFTPLUS_384_ARCHS["gfx1250"] = (4, 32, 3)(aiter/ops/triton/moe/moe_routing/topk_gating.py:40) still follows the oldmultiwave<384, 4>layout, so captured gfx1250 calls no longer match HIP. A CPU port of both kernels' selection logic gives 99 of 336 rows with different ids or weights (the ties, NaN, random and constant cases). With(2, 32, 6), which the existing static asserts allow, it gives 0. Example: experts 1 and 64 tie; HIP now picks 64, this kernel picks 1.- The fix: use
(2, 32, 6)for gfx1250. The vwave gate isget_gpu_arch() == "gfx1250", so check which HIP kernelgfx1250-strictruns before you change that entry too. - #7922 also made the HIP E=384 kernel about 2× faster on gfx1250. Keep gfx1250 in the table only if the Triton path still wins against it; otherwise drop the entry.
- Then re-run
test_topk_gating_sqrtsoftplus_384.pyon gfx1250 and gfx950 at the rebased head. Update the PR body and the table comment attopk_gating.py:35to match.
- The fix: use
- Bring eager
topk_gatingback to the merge-base host cost. Your own gfx1250 numbers at0d3cb7ed7still show +6.7 to +8.6% per eager 384-expert sqrtsoftplus call at 1–1024 rows and +5.3% at 4096 rows. Eager calls never take the Triton path, and prefill runs eagerly, so this is a cost on the default path.- Make the reject cheap before any other work: test
score_func,need_renormandgating_output.shape[-1] == 384inline at the call site (aiter/ops/topk.py:284). - Read the arch entry from one module-level value instead of calling
get_gfx_runtime()and_sqrtsoftplus_384_arch()each time. - Query
is_current_stream_capturing()last.
- Make the reject cheap before any other work: test
- Small cleanups. In
sqrtsoftplus_384_topk(topk_gating.py:106-110), storeget_gfx_runtime()in a variable instead of calling it twice. The output-tensor checks attopk.py:153-155repeat the ones attopk.py:71-73in_can_use_gfx1250_exact_sigmoid_topk; move both into one helper.
Re-reviewed at 0d3cb7e. Already fixed: the gfx1250 pytest log is posted (187 passed at 941a984; the GPU file and the new CPU test also passed at this head). aiter-bot Self-Review now passes at 0d3cb7e. Copilot's 3 items were fixed earlier. CI failures (MI35X shards 0/3/4/7 and the Test Gate) are Docker Hub pull-rate-limit errors, not this PR, but CI ran on a tree that main has since moved past. Step 0: this belongs in aiter, as requested in ATOM#3129.
0d3cb7e to
5944ccd
Compare
|
@valarLip thanks. All three items are addressed at 1. Rebase and the gfx1250 entry
2. Eager host cost
On gfx1250 the per-round spread of the merge base itself is about 1% to 2% (one round was 6% slower), so gfx1250 is within noise. Before this change the gfx1250 result was +5.3% to +8.6%. On gfx950 an eager call in range still costs one capture query plus the scalar checks. That is the cost of keeping eager calls on HIP on a graph-only arch. 3. Cleanups
Tests at
|
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (3)
- Add a power-of-two assert for
LANESin the kernel._sqrtsoftplus_384_topkfinds the lane that owns expertidxwithidx & (LANES - 1)(owner mask,aiter/ops/triton/_triton_kernels/moe/moe_routing/topk_gating.py), but only assertsEPT in {3, 6}andWAVES * LANES * EPT == 384. A future table entry with a non-power-of-twolanesvalue would compile and take the weight from the wrong lane. Addtl.static_assert(LANES & (LANES - 1) == 0, ...)next to the two existing asserts. - Make
sqrtsoftplus_384_topkcheck its own tensor contract, or make it private. The wrapper (aiter/ops/triton/moe/moe_routing/topk_gating.py:81) is public, but only thetopk_gatingpredicate checksgating_output.stride(1) == 1,shape[1] == 384, the dtypes and the output column stride. The kernel readsrow_ptr + cols, so a direct caller with column-strided logits gets wrong ids and no error. Either raiseValueErroron these in the wrapper, as it already does fornum_valid_rowsand the arch, or rename it_sqrtsoftplus_384_topk_launchand keeptopk_gatingas the only entry point. - Let the required CI finish at
5944ccd27and refresh the Self-Review. Triton Tests (MI35X) shards 0/2/3/5, the py3.12 wheel build and the Aiter Test run (its MI35X shard 0 runstests/, which includes the new CPU dispatch test) are still pending. The aiter-bot Self-Review comment still reports revision0d3cb7ed7b51.
Re-reviewed at 5944ccd. Already fixed: rebased onto main (merges cleanly). gfx1250 is out of the table (your call), and gfx1250-strict keeps (4, 32, 3), which matches HIP because the vwave gate is get_gpu_arch() == "gfx1250" (topk_gating_kernels.cuh:107-113). A CPU port of both kernels gives 0/504 mismatching rows for gfx950 (1,64,6) vs topk_gating_kernel_opt and for gfx1250-strict (4,32,3) vs multiwave<384,4>, including ties, NaN, ±inf and constant rows. Eager cost: call-site rejects, a module-level arch entry, and the capture query placed before the tensor checks. gfx1250 is now within noise; on gfx950 an eager call of at most 2048 rows still pays the capture query (+2.8–3.6% by your numbers), which is accepted as the cost of the graph-only dispatch. get_gfx_runtime() is read once in the wrapper, and the output checks share _topk_outputs_ok. Copilot's 3 items were fixed earlier.
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Correction to my review above: one more required change (1)
- Drop the
torch.cuda.is_current_stream_capturing()query from thetopk_gatingdispatch and choose the Triton path another way. My review above called the remaining gfx950 eager cost acceptable; I withdraw that. The query runs on every eager call (aiter/ops/topk.py:154, called at:307-316), and your own table shows gfx950 eager calls of 1–1024 rows at +2.8–3.6% versus the merge base. That cost lands on every caller's default path, so it cannot stay. The Triton kernel is bit-identical to HIP for the table layouts (0/504 mismatches in our CPU port), so the choice does not need to depend on capture state. Make it static instead, for example: pick the path from the arch entry and the row bucket alone (Triton wherever it is faster for that shape, HIP otherwise), or let the caller ask for it with an explicit argument (the graph-capturing caller passes it; eager callers keep the HIP default and pay nothing). Either way the eager path should go back to the merge-base host cost.
The three items in my review above still stand.
Correction at 5944ccd.
|
Update at
gfx950 at The PR Self-Review section is updated to |
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (4)
- Remove
torch.cuda.is_current_stream_capturing()from thetopk_gatingdispatch; this is still not done at7fbb94dcd.aiter/ops/topk.py:154still queries capture state on every eager in-range gfx950 call. Your 16:15 update keeps this order on purpose, but my correction at 5944ccd asked to remove the query, and that still stands. Your own data rules out a row-bucket-only choice: in eager mode the Triton launch costs more host time than the HIP kernel saves. So add an explicit argument, for exampletopk_gating(..., prefer_triton_384=False). The graph-capturing caller passesTrue, and every other caller keeps HIP. Test the argument first at the call site (topk.py:307), so eager callers do no extra work beyond what the merge base does. Then removegraph_onlyfromSqrtSoftplus384Archand change the tests that patchis_current_stream_capturing(tests/test_topk_gating_sqrtsoftplus_384_dispatch.py:34-49,test_topk_gating_sqrtsoftplus_384.py:139-160) to use the argument. Update the PR body and the table comment, which still describe capture-based dispatch. - Add a power-of-two assert for
LANESin the kernel. This is still missing._sqrtsoftplus_384_topkfinds the owning lane withidx & (LANES - 1)(_triton_kernels/moe/moe_routing/topk_gating.py:235), but onlyEPT in {3, 6}andWAVES*LANES*EPT == 384are asserted (:173-174). Addtl.static_assert(LANES & (LANES - 1) == 0, ...). - Make
sqrtsoftplus_384_topkcheck its own tensor contract, or make it private. This is still not done. The wrapper (aiter/ops/triton/moe/moe_routing/topk_gating.py:100-112) checks onlynum_valid_rowsand the arch. Its docstring lists limits (BF16[rows, 384]with unit column stride, FP32 bias, FP32/INT32 outputs, top-k 1–8,max_rows) that only thetopk_gatingpredicate enforces. A direct caller with column-strided logits gets wrong ids and no error. RaiseValueErroron these, or rename the function_sqrtsoftplus_384_topk_launch. - Let the required CI finish at the new head. At
7fbb94dcd, Triton Tests (MI35X) shards 0–7 and the py3.12 wheel build are still pending. The PR Self-Review run was cancelled, though the aiter-bot comment shows PASS at7fbb94dcdcce.
Re-reviewed at 7fbb94d. Already fixed: gfx1250-strict is now out of the table, so only gfx950 is measured and enabled. No new getattr/hasattr/inspect/ImportError probing. Off gfx950 the eager cost is a cached None check. Earlier items (rebase, one arch table, _topk_outputs_ok, first launch under capture, gfx1250 log, Self-Review fields, Copilot's 3) remain fixed.
|
@valarLip thanks. All four items of your 17:52Z review are addressed at 1. No capture query in the dispatch: explicit
Which caller passes Eager cost against the merge base (default call, no argument; DSV4.1 router args; one GPU; five rounds, each round a fresh process per tree in rotation; median over rounds; the bare HIP binding is timed in the same process):
On gfx1250 the bare HIP binding in the same processes was itself +0.4% to +2.8% slower for the new tree, so most of that column is process-to-process noise; the cost that Graph replay on gfx950 ( 2. 3.
4. CI at the new head. I will watch the required jobs at Validation at
|
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (3)
- Delete the kernel branches that no table entry can select.
SQRTSOFTPLUS_384_ARCHSnow has onlygfx950: (1, 64, 6, 2048), so theEPT == 3sort and head pick (aiter/ops/triton/_triton_kernels/moe/moe_routing/topk_gating.py:184-187, 218-221) and the multi-wave path (wave_v/w/iat:213-215, theelseat:246-249, the wave merge at:251-273) never compile in production or in CI. Your Validation section lists them as unverified. Keep only the path that runs:tl.static_assert(WAVES == 1 and EPT == 6, ...)(or dropWAVES/EPTfrom the table). When gfx1250 or gfx942 gets a measured entry, that PR can add the branch back along with its own test. - Fix the cache comment in
aiter/ops/topk.py:126-128. It says later calls "neither import the Triton module nor query the arch", but every opted-in call still runs the function-levelfrom .triton.moe.moe_routing.topk_gating import _sqrtsoftplus_384_topk_launchat:322-324. Say that only the arch query is cached. - Let MI35X Standard Tests finish at
1974ec1e7. At this head, shards 0–7 of Standard Tests (1 GPU, MI35X) are still pending. Triton Tests (MI35X) shards 0–7, both wheel builds, Kernel Provider Interface, and Black/Ruff pass.
Re-reviewed at 1974ec1. Already fixed: torch.cuda.is_current_stream_capturing() and graph_only are gone. Dispatch is now static through topk_gating(..., prefer_triton_384=False), and that flag is the first term at topk.py:313, so a default call costs one bool test before running topk_gating_fwd as on the merge base (test_a_default_call_does_no_triton_check). The route is bumped to v2 and plugin_contracts.json is updated. The LANES power-of-two static_assert is in (:175). The launcher is private (_sqrtsoftplus_384_topk_launch) and topk_gating is its only entry point. The PR body and table comment are updated. Earlier items stay fixed: gfx950-only table, _topk_outputs_ok, first launch under capture, and Copilot's 3.
|
@valarLip thanks. Your 04:56Z review is addressed at 1. Kernel branches that no table entry selects: removed. I took the second option, since with one entry the layout parameters had only one valid value:
2. Cache comment in 3. MI35X Standard Tests at black 26.10.1 and ruff 0.16.0 are clean on the changed files, and the Self-Review section validates with 0 issues at |
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (4)
- Keep
topk_gating's default signature and route at v1; give the graph caller its own entry point. Addingprefer_triton_384widens theaiter_routed::topk_gatingcustom-op schema (aiter/ops/topk.py:233-247, route v2). Every eager call parses, defaults and boxes the 10th argument, so every default caller on every arch pays extra host time: +50 to +290 ns per call (~1-3%) in two independent in-process A/Bs against the merge base (realroute(), base and head on one pinned core, alternating order, head slower in every pair; base/base and head/head controls at noise). A 9-arg vs 10-arg signature-only variant reproduces the whole delta, so the cost is the schema, not the bool test. Your own 11-18 eager numbers show the same bias. The v2 bump also stops v1 plugin providers from serving default calls. My 11-17 ask for an explicit argument and my r40 note that a default call "costs one bool test" did not foresee this; sorry for the extra round. Fix: restoretopk_gatingandtests/plugin_contracts.jsonto the merge base (v1, fingerprintb6325c278faa3184), and add a separate aiter entry, e.g.topk_gating_sqrtsoftplus_384(...)with the 9-arg signature, that runs the call-site checks and_can_use_sqrtsoftplus_384_topk, launches Triton, and otherwise callstopk_gating(its own baseline entry if routed). A probe of this layout is back at control level. - Cover the untested dispatch terms in
tests/test_topk_gating_sqrtsoftplus_384_dispatch.py. 13 of 34 single-term deletions of the guard (topk.py:162,:313-318) survive every CPU and GPU test, and 8 of them would corrupt results or read/write out of bounds on the Triton path: e.g.num_shared_experts == 0,gating_output.shape[-1] == 384(a 256-expert call with no bias reaches the 384-only kernel), the biasshape == (384,)/stride(0) == 1, the output column stride, andtopk_ids.shape == (rows, topk). Add rejecting cases:experts=256and512withbias="none",experts=384, shared=1, an fp32 bias of[383]/[192]andzeros(768)[::2], outputs with column stride 2, outputs with fewer rows than the logits. Commit00062f8dsays each term is covered; that is not true at head. - Make HIP-only changes run the HIP/Triton bit-identity check, or correct the PR body.
select_triton_tests.select()picks no tests forcsrc/kernels/topk_gating_kernels.cu,csrc/include/topk_gating_kernels.cuhoraiter/ops/topk.py, and Standard Tests never runop_tests/triton_tests/, so a HIP-only PR (e.g. aiter#7838) would not runtest_topk_gating_sqrtsoftplus_384.py. Either run the softplus-384 section by default on gfx950 inop_tests/test_moe_topk_gating.py, or say the check is caught only by the nightly /ci:triton-355run. - Nit: reword the commit messages, or squash before merge. The repo squashes with
COMMIT_MESSAGES.a9d43667,88549828,5944ccd2,00062f8dand1974ec1edescribe a gfx1250 Triton path,multiwave<384,4>,graph_onlydispatch, an archValueErrorandEPT/LANESasserts; none exist at head.
Pre-existing (not required): aiter/plugin/README.md still says "Five ops are routed today". CI: Standard shard 1 hit the Docker Hub rate limit (please rerun); shard 3 fails test_flydsl_allreduce_rank_agreement (_is_gfx1250), as on main. Triton MI35X shards 0-7 pass.
Reviewed at a935e83 (deep; two independent full passes, 7 hunters, 10 verifiers, 2 C2 miss passes). Items 1-3 were missed by earlier rounds (the code is unchanged since r40). Already fixed: the EPT==3 / multi-wave branches are gone; the cache comment says only the arch query is cached; MI35X CI ran. Kernel bit identity against topk_gating_kernel_opt replayed on CPU: 0 mismatches for topk 1-8 with ties, NaN/±inf and pad rows. Copilot's 3 asks are fixed (moe_routing/topk_gating.py:99-104, test_moe_topk_gating.py:1233,1246); please resolve those outdated threads.
a935e83 to
8bc19ff
Compare
|
@valarLip thanks, and no problem about the extra round. All four items of your 11-19 17:27Z review are addressed at 1.
2. Untested dispatch terms: covered.
I also ran the deletion check myself: each of 29 single-term deletions of the guard, the predicate and 3. HIP-only changes now run the bit-identity check. I took the first option: 4. Commit messages. The seven commits are squashed into one, Also done: the three outdated Copilot threads are resolved. I did not touch Validation at
CI at |
valarLip
left a comment
There was a problem hiding this comment.
A direction change from our side; sorry for the churn after you just reworked this to a separate entry.
We'd like topk_gating to choose the Triton kernel internally again, as in your original version, but without torch.cuda.is_current_stream_capturing():
- Drop
topk_gating_sqrtsoftplus_384and theprefer_triton_384argument.topk_gatingkeeps its merge-base signature and v1 contract, and callers change nothing. - Inside
topk_gating, route a call to the Triton kernel statically, from the arch table and the call's shape: gfx950 entry, renormalized 384-expert sqrtsoftplus, no shared columns, rows within the table limit. Route every other call to HIP as today. No capture-state query, no per-call env read. - Keep the static checks cheap and ordered so that a call that can't match (other arch, other expert count, other scoring) exits on the first test. Please post the default-call host cost against the merge base on gfx950 and one other arch.
- Please also post eager timings for the shapes that now go to Triton, next to the graph-replay table you already have, so the eager trade-off is on record.
- Keep the bit-identity test, the dispatch-term tests and items 2–4 of our last review (dispatch-term coverage, HIP-only changes running the bit-identity check, squash text).
8bc19ff to
455c4e4
Compare
|
@valarLip thanks, no problem. The 03:58Z direction is implemented at Dispatch
Default-call host cost against the merge base (gfx950 hardware; eager
There is no gfx1250 or other non-gfx950 GPU among the machines I may use, so the "other arch" row is gfx950 hardware with the cached entry set to Shapes that now take Triton: eager next to graph replay (gfx950, DSV4.1 router args with an FP32 bias; eager = wall clock per
So in eager mode these calls pay about a quarter more per call. That is host time: the Triton launch path costs more than the HIP binding, and the kernel time is too small to hide it. Under graph replay, where decode runs, the Triton kernel is faster than or within noise of HIP. That is the trade-off of a static choice. Both graph runs (these 10 configs and the 20-config default grid) have 0 id and 0 weight-bit mismatches. Items 2–4 of the previous review are kept.
Validation at
On CI: at |
455c4e4 to
2273c95
Compare
|
Follow-up: the Black check failed at |
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (7)
The static dispatch inside topk_gating, with no capture query, follows our 11-20 direction. Thanks for posting the cost tables. Kernel bit identity against topk_gating_kernel_opt was replayed on CPU: 0 mismatches over 4,500 fuzz cases (ties, NaN/±inf, lane exhaustion, pad rows, top-k 1-8).
- Resolve the arch entry on the first
topk_gatingcall, not on the first 384-expert call.aiter/ops/topk.py:124-131, 145-149, 306-318._sqrtsoftplus_384_archleaves_UNSET(which is truthy) only from inside_can_use_sqrtsoftplus_384_topk. A process that never makes a renormalized 384-expert sqrtsoftplus call stays at_UNSETforever, so every sqrtsoftplus call runs all five tests, includinggating_output.shape[-1](~180 ns). Examples: gfx942/gfx1250 serving 256-expert DSV4-Flash, or any non-384 model. Three independent in-process A/Bs (base vs a same-file mutant, one pinned core, with controls) measured +235 to +273 ns per call on that default path; controls stayed within ±10 ns. The comments at:126-130and:306-308("a call on any other arch ends here") are false in this state, and the CPU testtest_an_arch_outside_the_table_stops_at_the_first_testpasses only because its first call has 384 experts. Fix: at the top of the gate,if _sqrtsoftplus_384_arch is _UNSET: _sqrtsoftplus_384_arch = _runtime_sqrtsoftplus_384_arch(), then drop that step from the predicate. Measured at +13 to +22 ns vs main, with identical routes over 34,560 fuzzed calls per arch. Also add a CPU test whose first call is 256-expert. - Make
tests/test_topk_gating_sqrtsoftplus_384_dispatch.pyrun in CI. #8352 (11-20) removed the onlypytest testsstep. In run 44721913054 no job runstests/, so the coverage of every dispatch term (our earlier item 2) is local only. Move the file toop_tests/(split_tests.shfinds it there, and Standard Tests run it on every PR) and addif __name__ == "__main__": sys.exit(pytest.main([__file__, "-q"])), becauseaiter_test.shruns op_tests files withpython3 file. - Add NaN, all-NaN, tie and no-bias rows to
bench_sqrtsoftplus_384(op_tests/test_moe_topk_gating.py:523). For a HIP-only PR (.cuh,.cu,topk.py),select_triton_testspicks nothing. That leaves this section as the only bit-identity check, and its input is_make_gating(unique finite values) plus a random bias. So #7838 would merge green while gfx950 HIP and Triton diverge, and the body's claim that "the bit-identity checks here have all-NaN rows" is false on that path. Add one all-NaN row, one row with NaN every 3rd column, and one constant row, and run each config both with and without a bias (Nonevstorch.empty(0)for HIP). - Drop the per-call
triton.next_power_of_2and the function-local import on the Triton path. Ataiter/ops/triton/moe/moe_routing/topk_gating.py:118,next_power_of_2is aConstexprFunctioncosting 1.7-3.4 µs per eager call, vs 35-90 ns for1 << (topk - 1).bit_length(), which gives the same value for top-k 1..8. Also bind_sqrtsoftplus_384_topk_launchonce instead of importing it insidetopk_gatingon each call (topk.py:319, ~0.6 µs). Both costs land on every eager prefill MoE layer on gfx950. - Nit: keep
--section-less runs working when no config fits (op_tests/test_moe_topk_gating.py:1152-1161, :1249-1253). On gfx950,--num-tokens 4096,16384or--topk 16with the default sections now raisesValueErrorafter the softplus section, so softmax/nan/ties/eplb/shared/pad-rows/unaligned and the summary never run. Skipsoftplus-384with a message when it was added by default, and raise only when the user named it. - Nit: add one GPU case with strided outputs. Every Triton-path test allocates outputs as contiguous
[rows, k], so a launcher that swappedstride_weightsandstride_idswould pass. ATOM's fused-shared path passestotal[:, :top_k]views, which reach this kernel. Slice weights and ids from[rows, k+2]buffers and compare bits against HIP. - Nit: pass
float(routed_scaling_factor)in the launcher. An int value compiles the scale as i32 and failstl.math.div_rn("Expected dtype ['fp32']"). Today only the_as_custom_opfallback can deliver an int, but the HIP path accepts one.
Not required: the HIP topk module is built -fgpu-flush-denormals-to-zero, while this Triton launch is IEEE. It differs only for nonzero denormal biases on zero-score experts or a scale below ~1e-33, so it is unreachable with real routers. allow_flush_denorm=True would make "bit-identical" hold by construction. CI: Standard shard 3 fails test_flydsl_allreduce_rank_agreement (_is_gfx1250), the same as on main. PR Self-Review was cancelled and needs a re-run. softplus-384 ran in shard 3 with 0 mismatches, and the new pytest ran on Triton shard 4 (189 passed).
Reviewed at 2273c95 (deep; two independent full passes, 3+3 hunters, 4 verifiers, C2 miss pass). Items 1, 4 and 6 are in code unchanged since a935e83, so earlier rounds missed them. Already fixed: v1 signature and contract restored (no prefer_triton_384, plugin_contracts.json unchanged); static dispatch without a capture query or env read; every single-term guard deletion is killed by the CPU test (when it runs); softplus-384 is on by default on gfx950; the squash text matches the head; Copilot's 3 asks.
topk_gating sends a renormalized 384-expert sqrtsoftplus call without shared columns to a Triton kernel when the runtime arch has an entry in SQRTSOFTPLUS_384_ARCHS and the call fits its limits: BF16 logits with unit column stride, rows up to the entry's max_rows, an FP32 bias of [384] or none, FP32/INT32 outputs of [rows, topk] with unit column stride, top-k 1 to 8. The choice is static, from the arch and the call's shape; it does not read the capture state or the environment. Every other call runs HIP as before. The signature and the routed contract of topk_gating do not change. The first topk_gating call resolves the arch entry and binds the launcher, whatever its shape; after it, a call on an arch that is not in the table ends the dispatch at its first test. The table has gfx950 only, up to 2048 rows; gfx1250 keeps HIP, since its single-wave HIP kernel is at least as fast. The Triton kernel uses the lane layout of topk_gating_kernel_opt: one wave of 64 lanes, six experts in each lane, the same sort network, the same lowest-lane tie break and the renorm sum in selection order. So the ids and the weights are bit-identical to the HIP kernel. num_valid_rows is read on the device. The output checks of the gfx1250 sigmoid specialization and of this dispatch share one helper. The softplus-384 section of op_tests/test_moe_topk_gating.py compares the two kernels and times them under graph replay; it is in the default sections on an arch in the table, so a HIP-only change also runs the bit-identity check. The section checks bit identity with a bias and with none, on its benchmark rows and on all-NaN, NaN-every-third-column, constant and tied rows. Tests: bit identity against the HIP binding over row counts, top-k, ties, NaN/inf and constant rows, biases, pad rows and column-sliced outputs; graph capture and replay with a changing num_valid_rows; the first compile inside capture in a fresh process; and a CPU test of the dispatch with one case for each term, under op_tests/ so that Standard Tests run it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
2273c95 to
9909b70
Compare
|
@valarLip thanks. All seven items of your 11-20 16:41Z review are addressed at 1. The arch entry is resolved on the first
As before, there is no non-gfx950 GPU among the machines I may use, so "off the table" is gfx950 with the cached entry set to 2. The dispatch test runs in CI. Moved to 3.
The mismatch columns sum all four checks. Graph timing stays with the bias. The section asserts that the dispatch takes Triton for each of these inputs, so the comparison cannot silently be HIP against HIP. The body's statement about all-NaN rows now holds on the HIP-only path too. 4. No per-call Updated eager vs graph table (gfx950; eager as above; graph =
One measurement note. With the inputs passed to 5. A 6. A GPU case with strided outputs. 7. Not done: Validation on gfx950
CI. Standard shard 3 at |
|
CI at
|
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (2)
All 7 items from the last review are fixed, thanks. But main has changed under this PR:
- Rebase onto main and re-time Triton against the new gfx950 HIP kernel. Keep the
SQRTSOFTPLUS_384_ARCHSentry only where Triton still wins, otherwise close this PR in favour of #8258.- What changed: #8258 (9a6a02b, merged 11-23) fixed the slow path in HIP itself. On gfx950, sqrtsoftplus with 384 experts and top-k ≤ 8 now runs
topk_gating_kernel_opt_vwave<384, WPT=1>in wave64, and it shifts each lane's list instead of reading it through a runtime cursor. - #8258's three-way MI355X table against this PR's Triton kernel:
- eager GPU time: HIP is 13-19% faster;
- unprofiled graph replay: HIP is 16-23% faster;
- profiled graph: tied at 128-512 rows; at 2048 rows, top-k 8, HIP takes 4.39 µs and Triton 5.38 µs.
- On top of that, the Triton path costs +2.65-2.98 µs of host time per eager call.
- So after the clean auto-merge, every call this PR routes to Triton (gfx950, 1-2048 rows) is at best equal to HIP and usually slower. This is the same rule as our 11-17 gfx1250 ask: keep an entry only if Triton wins.
- If an entry survives:
- narrow
max_rowsto the range where Triton wins; - re-run bit identity against the vwave kernel;
- fix the text that names
topk_gating_kernel_optas gfx950's HIP kernel (moe_routing/topk_gating.py:27-30, the kernel docstring, the squash message); - read
gating_output.shapeonce in the gate. Todaytopk.py:317readsshape[-1]and the predicate readsndimandshape[0]again (:151-153). That is ~150-330 ns on every gfx950 384-expert call, about 9-20 µs per step at 61 layers.shape = gating_output.shape;len(shape) == 2 and shape[1] == 384; passrows = shape[0]. Also drop the predicate'sarch is Nonetest, which can never decide.
- narrow
- What changed: #8258 (9a6a02b, merged 11-23) fixed the slow path in HIP itself. On gfx950, sqrtsoftplus with 384 experts and top-k ≤ 8 now runs
- Nit: drop the
Co-Authored-By: Claude …trailer from the squash message.aiter/ops/triton/README.mdrule 29 asks for AI co-author lines to be removed, and this PR touchesaiter/ops/triton/.
Root cause vs patch
This is a patch. The root problem was that gfx950's topk_gating_kernel_opt reads register lists at a runtime index in the k-way merge, and the Triton kernel's speed came from avoiding that with select chains. The clean root fix is a shift-based merge in HIP. It has now landed (#8258), and it needs no second kernel, arch table or default-path gate.
Reviewed at 9909b70 (deep re-review: two independent full passes; merges cleanly with main). Both passes found item 1 independently. It was missed by earlier rounds because #8258 landed after the last review.
Already fixed:
- the arch is resolved on the first call;
- the dispatch test runs in Standard shard 1 (41 passed);
- the NaN/tie/no-bias rows (0 mismatches in shard 3);
- no per-call
next_power_of_2or import; - the SKIP when no config fits;
- the strided-output GPU case;
float(routed_scaling_factor).
Kernel bit identity against the merge-base HIP kernel was replayed on CPU: 0 mismatches over 1,500 cases, and a mutant gives 34. CI: the Standard shard 7 test_flydsl_hgemm failure is unrelated, and shard 4 appears to be the known test_flydsl_allreduce_rank_agreement failure (log truncated). Triton shards are green. No review threads are open.
|
Closing this PR in favour of #8258, as suggested in the last review. I rebased this branch onto main, which merged cleanly, and re-timed the Triton path on gfx950 against the new HIP kernel from #8258 (
So no shape is left where Triton wins, and there is no The branch stays on the fork. Thanks for the reviews. |

Summary
topk_gatinggets a light Triton kernel for 384-expert sqrtsoftplus routing (DeepSeek-V4.1) at decode widths on gfx950. The choice is static, from the arch table and the call's shape: a renormalized 384-expert sqrtsoftplus call without shared columns, within the table's row limit, on gfx950, runs the Triton kernel; every other call runs HIP as before. The kernel follows the lane layout of the HIP kernel thattopk_gatingruns there, so ids and weights are bit-identical. The signature and the routed contract (v1) oftopk_gatingdo not change, so callers change nothing. Every call on other arches (gfx1250 and gfx1250-strict included) keeps HIP.This moves the routing top-k of ROCm/ATOM#3129 into aiter, as requested in that review: ATOM then calls
topk_gatingand keeps no copy of the aiter lane layouts. This PR does not change ATOM.Motivation
For 384 experts at decode widths,
topk_gatinglaunches a register kernel that is heavier than a short row needs. This launch is on the routed critical path of every MoE layer, and decode runs it inside CUDA graphs, where the Triton kernel is faster. In eager mode the Triton launch costs more host time than the HIP launch; that trade-off is measured and posted in the PR comments.Technical details
_sqrtsoftplus_384_topk(Triton, one program per row) uses the layout of the HIP kernel that it replaces. On gfx950 that istopk_gating_kernel_opt(one 64-lane wave, six experts per lane,sort_network_desc<6>), which the HIP dispatch uses for all row counts. The kernel has only that layout.Each lane sorts its experts with the same network. Top-k rounds of a lane argmax (lowest lane on a tie) then select the experts. The weights are summed in selection order and the sum has the same floor. So ties, NaN/inf rows and the renorm sum order give the same bits as the HIP kernel.
num_valid_rowsis read on the device (pad rows get id -1 and weight 0), so a replayed CUDA graph follows each step's count. An arch whose HIP kernel has another layout needs its own kernel path and test before it can have a table entry.gfx1250-strict is not in the table: the Triton kernel was never timed against its HIP kernel on hardware, so it keeps HIP.
gfx1250 is not in the table. Since [HIP] topk_gating: single-wave register kernel for wave32 (gfx1250) #7922 its HIP path for 384 experts, top-k up to 8 and up to 1024 rows is
topk_gating_kernel_opt_vwave<.., 384, 2, ..>. The Triton kernel with that layout (two 32-lane waves, six experts per lane) is bit-identical to it, but it is not faster under graph replay, so gfx1250 keeps HIP.One table,
SQRTSOFTPLUS_384_ARCHSinaiter/ops/triton/moe/moe_routing/topk_gating.py, keyed byget_gfx_runtime():max_rowsfor each arch. The dispatch and the test row limits read it.Dispatch in
topk_gating, after the existing HERD check and beforetopk_gating_fwd. The firsttopk_gatingcall that reaches it, whatever its shape, resolves the module-level arch entry (the entry of the runtime arch, orNone) and binds the Triton launcher once (importing aiter needs no GPU). The first test is thenarch is not None, so on an arch that is not in the table every later call ends there. On gfx950 the next tests arescore_func == "sqrtsoftplus",need_renorm, no shared columns andgating_output.shape[-1] == 384; only a call that passes all of them pays for_can_use_sqrtsoftplus_384_topk, which checks the row range (gfx950: up to 2048, above which HIP is faster) and the tensor contract (BF16 logits[rows, 384]with unit column stride, FP32 bias of[384]with unit stride or none, FP32/INT32 outputs of[rows, topk]with unit column stride and row stride at leasttopk, top-k 1 to 8). A call that does not fit runs HIP. No capture-state query and no per-call environment read. gfx942 runs the same HIP kernel as gfx950, but it is not enabled until it is measured there.The launcher is private,
_sqrtsoftplus_384_topk_launch.topk_gatingis the one place that checks the tensor contract; the launcher checks onlynum_valid_rows. It computes the padded top-k with a shift instead oftriton.next_power_of_2and passes the scale as a float, so an introuted_scaling_factoralso works.The output-tensor checks of this predicate and of the gfx1250 sigmoid specialization are one helper,
_topk_outputs_ok.op_tests/test_moe_topk_gating.pyruns thesoftplus-384section by default on an arch in the table, so a HIP-only change totopk_gating(which Standard Tests run through that file) also runs the bit-identity check against the Triton kernel. The section checks every config with a random bias and with none, on its benchmark rows and on four special rows (all NaN, NaN in every third column, constant, few distinct values). When it was added by default and no config fits the given--num-tokens/--topk, it is skipped with a message and the other sections still run; it raises only when named with--section.select_triton_testsdoes not picktest_topk_gating_sqrtsoftplus_384.pyforcsrc/oraiter/ops/topk.pychanges; that pytest file runs in the Triton tests when Triton paths change, and in the nightly orci:triton-355run.No new environment variables.
Note: #7838 (open) changes how the HIP kernels pick a NaN expert. Whichever of the two PRs lands second must update the other side; the bit-identity checks here have all-NaN rows and fail if they differ.
PR Self-Review
Reviewed revision
9909b700251dBehavior and intent
topk_gatingsends renormalized 384-expert sqrtsoftplus calls (no shared columns, BF16 logits, FP32 or no bias, top-k 1 to 8, rows up to the arch'smax_rows) to the new Triton kernel instead of the HIPtopk_gating_fwd, in eager mode and in CUDA graphs, with the same bits. Other score functions, other expert counts, shared columns, other dtypes, larger row counts and other arches, gfx1250 and gfx1250-strict included, keep the HIP path. The signature and routed contract oftopk_gatingare unchanged.op_tests/test_moe_topk_gating.pyruns itssoftplus-384section by default on gfx950.Validation and unverified scope
9909b700251d:pytest op_tests/triton_tests/moe/moe_routing/test_topk_gating_sqrtsoftplus_384.py op_tests/test_topk_gating_sqrtsoftplus_384_dispatch.py tests/test_plugin_contracts.py op_tests/triton_tests/moe/moe_routing/test_topk_gating.pypasses, andpython3 op_tests/test_topk_gating_sqrtsoftplus_384_dispatch.pypasses, including the first-launch-under-capture case (the gfx1250-only sigmoid cases skip).python op_tests/test_moe_topk_gating.pywith no arguments runs every default section and thesoftplus-384section passes with no id or weight-bit mismatch; with--num-tokens 4096it skipssoftplus-384and runs the rest.python3 -m pytest -q testshas the same single failure as the merge base (test_mega_moe_gfx1250_recipe.py::test_layout, which fails there too) and adds the new passing cases. Deleting any single term of the dispatch guard makes the CPU dispatch test fail.pytest tests, the deletion check and the eager timings ran at73f2e1949, which differs from this revision only in how the op-test section passes its inputs to the graph timer. Eager host cost of default calls against the merge base, the cost on an arch off the table, and eager and graph-replay timings of the shapes that now take Triton are in the PR comments.None), which the CPU dispatch test checks and which was timed on gfx950 with the cached entry set toNone. The gfx1250 sigmoid specialization uses the shared_topk_outputs_okhelper;op_tests/triton_tests/moe/moe_routing/test_topk_gating.pypassed on gfx1250 with the same helper at1974ec1e7708.ci:gfx1250-ffm-tritonlabel is set, but that job is skipped for PRs from forks, and for same-repo branches it swaps in theshared/reduced_tests_for_FFM_CItree, so it does not run this file.PR-specific question
What behavior would each changed op test fail on before this PR, and why is that coverage not already provided by an existing canonical test?
test_topk_gating_sqrtsoftplus_384.pyfails before this PR at import: the arch table and the kernel do not exist. Against a wrong implementation it fails on any id or weight-bit difference betweentopk_gating(asserted not to call HIP) andtopk_gating_fwd(wrong lane layout, tie order, NaN handling, renorm sum order or pad rows), on a non-renormalized or sigmoid call reaching the Triton kernel, on a dispatch range that differs from the table, on a graph that ignores a changednum_valid_rows, and on a first compile that breaks inside capture. No canonical test covers this: the existing sections ofop_tests/test_moe_topk_gating.pycheck the HIP kernels against a torch reference with a tolerance; they do not check bit identity between two kernels, this dispatch, or a Triton compile during capture.op_tests/test_moe_topk_gating.py(softplus-384section) fails before this PR because the section does not exist. On gfx950 it now runs by default, so it also fails a later HIP-only change that makestopk_gating_fwddiffer from the Triton kernel in any bit, with or without a bias, including on all-NaN, partly-NaN, constant and tied rows.Changed op tests
op_tests/triton_tests/moe/moe_routing/test_topk_gating_sqrtsoftplus_384.py(new): bit identity of eagertopk_gating(asserted not to call HIP) against the raw HIP binding on every arch in the table, for row counts up to the arch's limit, top-k 1/6/8, random / heavy ties / NaN+inf and all-NaN / constant rows, no / linear / random bias, withnum_valid_rows; strided logits; column-sliced outputs with different row strides for weights and ids; rejection of a badnum_valid_rows; the dispatch range; HIP for a non-renormalized or sigmoid call;topk_gatingcaptured and replayed with a changingnum_valid_rows(asserts it does not call HIP); and, in a fresh process with an empty Triton cache, a first compile and load inside capture, with replays checked against HIP. Not redundant: it is the only test of this kernel and of this dispatch.op_tests/test_topk_gating_sqrtsoftplus_384_dispatch.py(new, CPU; inop_tests/so that Standard Tests run it, and it runs pytest on itself underpython3 file): the dispatch on CPU tensors with the arch patched and both kernels replaced by recorders: the row range of every arch in the table (gfx950); that an arch off the table stops at the cachedNoneafter a first call of another shape (256 experts or softmax); that a first call of another shape on gfx950 resolves the entry; that a call in range runs Triton (FP32 bias, empty bias,None); that calls which cannot match (no renorm, sigmoid, softmax, a shared column, 256 or 512 experts) never reach the tensor checks; that the arch is queried once; and one case for each term of the guard that must go to HIP: zero rows, 256 and 512 experts with no bias, FP16 logits, a BF16 bias, FP32 biases of[383],[192]and a column-strided[384], top-k 0 and 9, column-strided and[8, 1, 384]logits, column-strided, overlapping-row, short and wider outputs, FP16 weights, INT64 and 1-D ids. Not redundant: the GPU test file needs an arch in the table, so CI on other runners never reaches the dispatch.op_tests/test_moe_topk_gating.py(sectionsoftplus-384, default on an arch inSQRTSOFTPLUS_384_ARCHS): the same comparison throughtopk_gatingover the chosen row counts and top-k, with graph timing of both kernels. Not redundant with the pytest file: it is the check that Standard Tests run when only the HIP side changes.Test plan
pytest op_tests/triton_tests/moe/moe_routing/test_topk_gating_sqrtsoftplus_384.py op_tests/test_topk_gating_sqrtsoftplus_384_dispatch.py tests/test_plugin_contracts.pyon gfx950.python op_tests/test_moe_topk_gating.pyon gfx950 (runs thesoftplus-384section by default).🤖 Generated with Claude Code