Skip to content

perf(hip): MoE t-rows path takes the one-launch top-k and blend under BATCH_SMALL (byte-identical, +2-4% C8) - #389

Merged
AzeezIsh merged 1 commit into
mainfrom
perf/hip-moe-rows-t-small
Nov 16, 2026
Merged

AzeezIsh merged 1 commit into
mainfrom
perf/hip-moe-rows-t-small

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

What

forward_rows_t, the gfx1151 C>1 / verify MoE rows path, still launched moe_topk_softmax and moe_weighted_sum_blend once per row per layer. At Flash-Next C8 on strix that is about 216k launches each, roughly 4% of decode GPU time.

Under ATLAS_QWEN4EXP_BATCH_SMALL (the recipe default above batch 1), it now takes the same one-launch twins forward_rows already uses: moe_topk_softmax_rows and moe_weighted_sum_blend_rows. Their rows are the single-row kernels' bytes. Without those kernels it keeps the per-row loops.

Evidence (strix DevLab runner + framework)

gate result
in-situ C8 profile (43924706025 vs 43872204318) topk 2410 → 290 (rows) + 208 ms, blend 1097 → 206 + 92 ms; C8 GPU total 86.1 → 82.5 s (−4.2%)
Flash-Next C1 greedy shas (43924712497) 09714ec21a48 / 103770824dbe / 242c7689320c, identical to main
framework f322 same-box C8 A/B, 3 × 8 × 256 tokens main 49.5 / 51.7 / 50.4 vs branch 50.6 / 53.6 / 51.0 tok/s agg (+2.3%); per-stream shas from the same set

🤖 Generated with Claude Code

… BATCH_SMALL (byte-identical)

forward_rows_t (the gfx1151 C>1 / verify MoE rows path) still launched
moe_topk_softmax and moe_weighted_sum_blend once per row per layer: at C8
on strix that is ~216k launches each (topk 10.9 us apiece, ~4% of decode).
Under ATLAS_QWEN4EXP_BATCH_SMALL (the recipe default above batch 1) it now
takes the same one-launch twins forward_rows already uses,
moe_topk_softmax_rows and moe_weighted_sum_blend_rows, whose rows are the
single-row kernels' bytes; without them it keeps the per-row loops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AzeezIsh
AzeezIsh merged commit acf072c into main Nov 16, 2026
24 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant