Skip to content

[Config] Add Muse Spark Open 816B MXFP4 fused-MoE FlyDSL configs for gfx950 (MI350P, 128 CUs) - #7109

Merged
zufayu merged 2 commits into
ROCm:mainfrom
mpashkovskii:configs/muse-spark-open-mxfp4-fmoe-gfx950
Nov 25, 2026
Merged

zufayu merged 2 commits into
ROCm:mainfrom
mpashkovskii:configs/muse-spark-open-mxfp4-fmoe-gfx950

Conversation

@mpashkovskii

@mpashkovskii mpashkovskii commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Serving Muse-Spark-Open-816B-A42B on 4x MI350P (gfx950, 128 CUs, PCIe) with TP4 + expert parallel, muse-spark-open-mxfp4_fp4_tuned_fmoe.csv has no cu_num=128 rows for this layout's MoE shape, so every token count logs no tuned FlyDSL config ... using heuristic FlyDSL fallback.

This replaces this PR's earlier cu_num=128 rows, which were tuned for a different parallel layout of the same model (256 experts, inter_dim 1024, topk 1) and were MXMOE rows (flydsl_mxmoe_*). fused_moe rejects MXMOE rows whenever an expert_mask is present (discarding MXMOE config: the MXMOE output_aux sort drops expert_mask), so with expert parallel they were never used.

Technical Details

Shape (per rank): 64 local experts, model_dim=4096, inter_dim=4096, topk=2, SiLU, MXFP4 activations and weights (per_1x32), g1u1. Token counts from vllm serve logs of the served configuration.

Tuned with the default fmoe tuner, csrc/ck_gemm_moe_2stages_codegen/gemm_moe_tune.py (without --mxfp4-flydsl), one process per GPU. The winners are FlyDSL flydsl_moe1_afp4_wfp4_* (stage 1) + flydsl_moe2_layout_afp4_wfp4_* (stage 2), which fused_moe accepts with an expert_mask:

token 8 16 32 64 128 256 512 2048 8192 16384
us 136.1 261.1 491.7 500.9 504.7 510.0 523.8 569.7 1204.4 2255.9

For comparison, the best MXMOE (--mxfp4-flydsl) kernels for the same shape, which can't be used under expert parallel: 686.8 us at token 2048 and 1307.0 us at 8192, so the rows here are 18% / 8% faster at the prefill sizes.

  • The rows need no new MXFP4 aux instances: verified on an aiter without the (64, 4096, 4096, 2) aux shape (the rows are used, nothing is discarded).
  • No nt column is added (the file has none): with no nt column the tuned path uses use_non_temporal_load = False, which is what these rows were tuned with (nt=0).
  • Config only: no kernel or runtime changes. The file's cu_num=256 (MI355X) rows are unchanged; only this PR's cu_num=128 rows are replaced.

Not a duplicate

The cu_num=128 rows are disjoint in key from the existing cu_num=256 rows in the same file. No other open PR adds MI350P (128-CU) fused-MoE configs for this model. Related: #7938 adds the MXFP4 aux kernels for this shape (needed for MXMOE rows and the --mxfp4-flydsl tuner); this PR does not depend on it.

Test Plan

python3 -m pytest op_tests/tuning_tests/test_config_shape_collision.py -q

End to end on 4x MI350P, TP4 + EP4, with and without these rows (AITER_CONFIG_FMOE = the default tables plus this file):

VLLM_ROCM_USE_AITER=1 VLLM_ROCM_MUSE_MOE_REDUCE_DTYPE=bf16 VLLM_USE_BREAKABLE_CUDAGRAPH=1 \
VLLM_KV_CACHE_LAYOUT=LBHNC SAFETENSORS_FAST_GPU=1 \
vllm serve amd/Muse-Spark-Open-816B-A42B-Quark-MXFP4 \
  --tensor-parallel-size 4 --enable-expert-parallel --dtype bfloat16 --language-model-only \
  --compilation-config '{"cudagraph_mode":"FULL_AND_PIECEWISE"}' --enable-chunked-prefill \
  --enable-prefix-caching --attention-backend ROCM_AITER_FA --kv-cache-dtype fp8 --block-size 16 \
  --gpu-memory-utilization 0.97 --max-model-len 131072 --max-num-seqs 4 --max-num-batched-tokens 2048 \
  --speculative-config '{"method":"dflash","model":"RadixArk/Muse-Spark-Open-DFlash2","quantization":"fp8","num_speculative_tokens":7,"draft_sample_method":"probabilistic","rejection_sample_method":"synthetic","synthetic_acceptance_length":5.2,"enable_adaptive_verification":false,"attention_backend":"TRITON_ATTN"}'

Crossover on one 8-GPU node: GPUs 0-3 run stock then tuned, GPUs 4-7 tuned then stock, so each config is measured on both halves. vllm bench serve --dataset-name random --ignore-eos: 4096 in / 512 out at concurrency 1 / 2 / 4 (8 x C prompts, seeds 0-2), and 32768 in / 16 out at concurrency 1 (16 prompts) for TTFT. GSM8K (lm_eval, 500 questions) with "rejection_sample_method":"block".

Test Result

  • test_config_shape_collision: 30 passed. 10 cu_num=128 rows; the 28 cu_num=256 rows are byte-identical to the base.
  • With these rows the server logs no no tuned FlyDSL config and no discarding for the shape (64 untuned lookups without them).
stock with these rows Δ
TTFT, 32k-token prompt (mean) 4331.9 ms 4246.3 ms −2.0% (both GPU halves: 4328 / 4336 → 4248 / 4244)
TTFT, 4k prompt, concurrency 1 497.4 ms 491.7 ms −1.2%
Output tok/s, concurrency 1 / 2 / 4 196.8 / 305.4 / 405.1 197.6 / 304.5 / 406.0 within ±0.4%
KV cache 517,784 tokens 515,970 tokens −0.35%
GSM8K flexible / strict (500 q) 0.950 / 0.948 0.952 / 0.952

Prefill improves by ~2%; decode is unchanged, since in this configuration most decode MoE work does not go through fused_moe.

Tuning note: the installed aiter used for tuning predates #6860, so the fix was applied locally; without it every candidate timed as 0 us.

PR Self-Review

Reviewed revision

9cdd49b

Behavior and intent

Adds 10 gfx950, cu_num=128 (MI350P) rows to aiter/configs/model_configs/muse-spark-open-mxfp4_fp4_tuned_fmoe.csv for Muse-Spark-Open-816B served with TP4 + EP4. Without them, fused_moe finds no tuned config for this layout's MoE shape and logs no tuned FlyDSL config ... using heuristic FlyDSL fallback at every token count. The rows select non-MXMOE FlyDSL kernels (flydsl_moe1_afp4_wfp4_* + flydsl_moe2_layout_afp4_wfp4_*) because fused_moe discards MXMOE rows when an expert_mask is set, as it is under expert parallel. No kernel, dispatch or runtime code changes.

Validation and unverified scope

This head is a merge of main into the branch; the CSV is unchanged since 9e2ce89b2, the commit the tuning and measurements below were done for.

Validated (4x MI350P, gfx950, 128 CUs; details under Test Plan / Test Result):

  • python3 -m pytest op_tests/tuning_tests/test_config_shape_collision.py -q: 30 passed.
  • vllm serve TP4 + EP4 with these rows: no no tuned FlyDSL config and no discarding lines for the shape (64 untuned lookups without them).
  • Crossover A/B on one 8-GPU node: 32k-token TTFT −2.0% (on both GPU halves), 4k TTFT −1.2%, output tok/s at concurrency 1/2/4 within ±0.4%, GSM8K (500 q) 0.952 / 0.952 vs 0.950 / 0.948.

Unverified:

  • The tuning and measurements ran on an installed aiter, not on a build of this head; the tuning aiter predates [fix] Clear rocprofiler env vars before spawning mp_tuner workers #6860 and had that fix applied locally.
  • Token counts other than the ten tuned ones (8 to 16384) have no row here.
  • Only this model and layout were run end to end; no other hardware (no MI355X, no MI300X) was tested, which is outside these rows' key (cu_num=128).
  • The tuner's err1 / err2 (0.9% / 1.1%) are its own checks; no separate element-wise comparison of the selected kernels against a reference was run.

PR-specific question

The rows are keyed by fused_moe's _INDEX_COLS: gfx=gfx950, cu_num=128, token ∈ {8, 16, 32, 64, 128, 256, 512, 2048, 8192, 16384}, model_dim=4096, inter_dim=4096, expert=64, topk=2, act_type=ActivationType.Silu, dtype=torch.bfloat16, q_dtype_a=q_dtype_w=torch.float4_e2m1fn_x2, q_type=QuantType.per_1x32, use_g1u1=1, doweight_stage1=0. That is the per-rank MoE of Muse-Spark-Open-816B (MXFP4) under TP4 + EP4 on MI350P: 64 local experts, hidden 4096, intermediate 4096, top-2.

Unrelated shapes keep their selection because the diff only appends these rows: the file's 28 existing cu_num=256 rows are byte-identical to main, no other row in the file has cu_num=128, and test_config_shape_collision.py (30 passed) finds no key collision with the other tuned tables. A lookup with any other gfx, cu_num or shape field does not match these rows.

Changed op tests

None.

AI assistance (Claude) was used to collect the shapes, run the tuning and the measurements, and write this description; a human must review every line before merge.

🤖 Generated with Claude Code

@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 (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu 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: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
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 7109 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

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 stop the title rewrites; labels stay in sync either way.

@mpashkovskii
mpashkovskii marked this pull request as ready for review October 28, 2026 20:46
@mpashkovskii
mpashkovskii requested review from a team and a balanced review from Copilot October 28, 2026 20:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

All 11 new tuning rows select an unsupported FlyDSL shape, causing dispatch to discard the tuned configurations and fall back to heuristic selection.

1 open issue
What changed in this PR

This PR adds model-specific FlyDSL fused-MoE tuning entries intended to replace heuristic selection for Muse Spark Open 816B MXFP4 on MI350P (gfx950, 128 CUs) at TP4.

Changes:

  • Adds 11 configurations covering token counts from 8 through 8192 with inter_dim=1024.
  • Preserves existing 256-CU entries and leaves larger token counts without new configurations.
File Description
aiter/​configs/​model_configs/​muse-spark-open-mxfp4_fp4_tuned_fmoe.csv Adds 128-CU stage-one and stage-two kernel selections and tuning measurements.

Review effort: Balanced

@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 Nov 13, 2026
@mpashkovskii
mpashkovskii force-pushed the configs/muse-spark-open-mxfp4-fmoe-gfx950 branch from b15a589 to fccf0be Compare November 13, 2026 10:55
Copilot AI balanced review requested due to automatic review settings November 13, 2026 10:55
@aiter-bot

aiter-bot commented Nov 13, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 9cdd49bde55c · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

Adds 10 `gfx950`, `cu_num=128` (MI350P) rows to `aiter/configs/model_configs/muse-spark-open-mxfp4_fp4_tuned_fmoe.csv` for Muse-Spark-Open-816B served with TP4 + EP4. Without them, `fused_moe` finds no tuned config for this layout's MoE shape and logs `no tuned FlyDSL config ... using heuristic FlyDSL fallback` at every token count. The rows select non-MXMOE FlyDSL kernels (`flydsl_moe1_afp4_wfp4_*` + `flydsl_moe2_layout_afp4_wfp4_*`) because `fused_moe` discards MXMOE rows when an `expert_mask` is set, as it is under expert parallel. No kernel, dispatch or runtime code changes.

Validation and unverified scope

This head is a merge of `main` into the branch; the CSV is unchanged since `9e2ce89b2`, the commit the tuning and measurements below were done for.

Validated (4x MI350P, gfx950, 128 CUs; details under Test Plan / Test Result):
- `python3 -m pytest op_tests/tuning_tests/test_config_shape_collision.py -q`: 30 passed.
- `vllm serve` TP4 + EP4 with these rows: no `no tuned FlyDSL config` and no `discarding` lines for the shape (64 untuned lookups without them).
- Crossover A/B on one 8-GPU node: 32k-token TTFT −2.0% (on both GPU halves), 4k TTFT −1.2%, output tok/s at concurrency 1/2/4 within ±0.4%, GSM8K (500 q) 0.952 / 0.952 vs 0.950 / 0.948.

Unverified:
- The tuning and measurements ran on an installed aiter, not on a build of this head; the tuning aiter predates #6860 and had that fix applied locally.
- Token counts other than the ten tuned ones (8 to 16384) have no row here.
- Only this model and layout were run end to end; no other hardware (no MI355X, no MI300X) was tested, which is outside these rows' key (`cu_num=128`).
- The tuner's `err1` / `err2` (0.9% / 1.1%) are its own checks; no separate element-wise comparison of the selected kernels against a reference was run.

PR-specific question

The rows are keyed by `fused_moe`'s `_INDEX_COLS`: `gfx=gfx950`, `cu_num=128`, `token` ∈ {8, 16, 32, 64, 128, 256, 512, 2048, 8192, 16384}, `model_dim=4096`, `inter_dim=4096`, `expert=64`, `topk=2`, `act_type=ActivationType.Silu`, `dtype=torch.bfloat16`, `q_dtype_a=q_dtype_w=torch.float4_e2m1fn_x2`, `q_type=QuantType.per_1x32`, `use_g1u1=1`, `doweight_stage1=0`. That is the per-rank MoE of Muse-Spark-Open-816B (MXFP4) under TP4 + EP4 on MI350P: 64 local experts, hidden 4096, intermediate 4096, top-2.

Unrelated shapes keep their selection because the diff only appends these rows: the file's 28 existing `cu_num=256` rows are byte-identical to `main`, no other row in the file has `cu_num=128`, and `test_config_shape_collision.py` (30 passed) finds no key collision with the other tuned tables. A lookup with any other `gfx`, `cu_num` or shape field does not match these rows.

Changed op tests

None.

AI assistance (Claude) was used to collect the shapes, run the tuning and the measurements, and write this description; a human must review every line before merge.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • PASS — Aiter Test Gate: passed

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

All ten new configs are rejected by the dispatcher due to an unsupported MXMOE stage-1 shape and, independently, incompatible expert-mask handling, leaving serving and masked expert-parallel calls on the fallback.

3 open issues

Review effort: Balanced

…gfx950 (MI350P, 128 CUs)

Tuned MXFP4 a4w4 fused-MoE rows for Muse-Spark-Open-816B-A42B served on
4x MI350P (gfx950, cu_num=128) with TP4 + expert parallel: 64 local
experts, model_dim 4096, inter_dim 4096, topk 2, for token 8 to 16384.

Tuned with csrc/ck_gemm_moe_2stages_codegen/gemm_moe_tune.py (the
default fmoe tuner), one process per GPU. The winners are FlyDSL
flydsl_moe1_afp4_wfp4 / flydsl_moe2_layout kernels, which fused_moe
accepts with an expert_mask; MXMOE rows (--mxfp4-flydsl) are rejected
under expert parallel. The rows need no new MXFP4 aux instances.

Config only. The cu_num=256 rows in the file are unchanged.

Co-Authored-By: Claude <[email protected]>
@mpashkovskii
mpashkovskii force-pushed the configs/muse-spark-open-mxfp4-fmoe-gfx950 branch from fccf0be to 9e2ce89 Compare November 13, 2026 14:18
Copilot AI balanced review requested due to automatic review settings November 13, 2026 14:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The MI350P kernel-selection changes lack hardware validation tied to the reviewed head, so a human must confirm numerical correctness and latency on gfx950/128-CU hardware.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

@github-actions github-actions Bot removed the stale The PR hasn't been updated in 2 weeks label Nov 14, 2026
Copilot AI balanced review requested due to automatic review settings November 25, 2026 12:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The GPU kernel-selection changes require human judgment because correctness and latency under gfx950 expert parallelism were not verified on the reviewed head, and the tuning used an older aiter installation.

No open issues 🎉

Review effort: Balanced

@zufayu
zufayu merged commit d99b87c into ROCm:main Nov 25, 2026
69 checks passed
samremes added a commit to samremes/aiter that referenced this pull request Dec 1, 2026
The helper had grown to ~450 lines plus ~450 lines of tests, mostly
special cases for renames, moves, multi-file groups, ambiguity and
summary counts. It is an advisory hint the reviewer checks against the
diff, so drop them: a tuned CSV pairs with the one untuned CSV in its
folder whose name has the same tokens, and the four mismatch kinds are
set differences over the rows the PR changed. Same findings on recent
tuning merges (ROCm#8016, ROCm#8161, ROCm#7109, ROCm#8566, ROCm#8490); renames and moves
are left to the reviewer.

Also drop the triage audit plumbing for tuning_coverage.txt (A5 findings
are backed through verdicts like any other rule), the .toml/tuning JSON
triggers (aiter tracks no tuning .toml files) and the unrelated
pre-commit change. Key columns are no longer dropped for the whole pair
when one untuned cell is blank, which hid real changes.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants