Skip to content

[FlyDSL] [MoE] Add herd_fused_topk drop-in selector for fused_moe 2-stage - #5693

Merged
coderfeli merged 10 commits into
mainfrom
cguo/herd
Oct 13, 2026
Merged

coderfeli merged 10 commits into
mainfrom
cguo/herd

Conversation

@charlieguo1106

@charlieguo1106 charlieguo1106 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Technical Details

Test Plan

AITER_FLYDSL_USE_HERD=1

Test Result

bias = randn((E,), dtype=dtype)

image

Kimi-K3's real gate bias has std 0.024, so 0.025 reproduces production routing (uniq 714 vs the real tensor's 766 at token=128) -- use it for any MoE perf number.

bias = randn((E,), dtype=dtype) *0.025

image

Submission Checklist

@charlieguo1106
charlieguo1106 requested a review from a team September 20, 2026 05:46
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
multigpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 5693 --add-label <label>

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to opt this PR out.

@github-actions github-actions Bot changed the title [Triton] [MoE] Add herd_fused_topk drop-in selector for fused_moe 2-stage [Triton/Gluon] [MoE] Add herd_fused_topk drop-in selector for fused_moe 2-stage Sep 20, 2026
…routing

Replace the Triton herd_fused_topk overlay with FlyDSL candidate top-(k+1) plus LDS popularity finalize, so fused_moe still owns moe_sorting and decode selector no longer pays for bitmatrix/hist.
@github-actions github-actions Bot changed the title [Triton/Gluon] [MoE] Add herd_fused_topk drop-in selector for fused_moe 2-stage [Triton/Gluon] [FlyDSL] [MoE] Add herd_fused_topk drop-in selector for fused_moe 2-stage Sep 20, 2026
Kimi-K3 decode HERD stays on FlyDSL candidate+finalize; Triton routing_minunique is unchanged and fused_moe no longer re-exports the 30us drop-in.
@github-actions github-actions Bot changed the title [Triton/Gluon] [FlyDSL] [MoE] Add herd_fused_topk drop-in selector for fused_moe 2-stage [FlyDSL] [MoE] Add herd_fused_topk drop-in selector for fused_moe 2-stage Sep 20, 2026
@zufayu
zufayu requested a review from coderfeli September 21, 2026 01:11
Comment thread aiter/ops/flydsl/herd_topk.py Resolved
@github-actions

Copy link
Copy Markdown
Contributor

No activity for 15 days, so this is now labelled stale. A push or a comment clears it; keep-open exempts it. Nothing is closed automatically.

@github-actions github-actions Bot added the stale The PR hasn't been updated in 2 weeks label Oct 10, 2026
@gbyu-amd

Copy link
Copy Markdown
Contributor

HERD optimization on Kimi-K3:

  1. Accuracy is acceptable, 0.95 (HERD ON) vs 0.953 (HERD OFF)
  2. Performance benefit on 1k/1k w.r.t. conc:
image 3. Performance benefit on agentic benchmark with conc 64: image

@coderfeli
coderfeli merged commit ab20344 into main Oct 13, 2026
@coderfeli
coderfeli deleted the cguo/herd branch October 13, 2026 09:30
TianDi101 added a commit to TianDi101/ATOM that referenced this pull request Nov 17, 2026
aiter.ops.topk._FLYDSL_HERD_{MIN,MAX}_M and _FLYDSL_USE_HERD were added
in ROCm/aiter#5693 (v0.1.26). Containers built against older aiter fail at
import time. Fall back to False/0 — use_flydsl_herd requires is_gfx1250
anyway so MI355X runs are unaffected.

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FlyDSL stale The PR hasn't been updated in 2 weeks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants