Skip to content

[FlyDSL] Dev/yadai moe v1 - #6269

Merged
junhaha666 merged 32 commits into
mainfrom
dev/yadai_moe_v1
Oct 13, 2026
Merged

junhaha666 merged 32 commits into
mainfrom
dev/yadai_moe_v1

Conversation

@yadaish

@yadaish yadaish commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Improve gfx1250 FlyDSL grouped MoE execution for MXFP4 workloads by adding persistent scheduling that processes the live routing workload during graph replay. Add a configurable pipeline drain loop and update tuning configurations to support further performance tuning.

Strengthen expert-parallel (EP) validation by matching dispatch buffer sizing and activation quantization more closely to the runtime behavior.

Technical Details

  • Persistent grouped GEMM scheduling: Add independent worker counts for GEMM1 and GEMM2, configurable through tuning CSVs and environment overrides. Workers read the live device-side routing extent on each graph replay and iterate over populated tiles. Worker counts align with N-cluster geometry, and a barrier protects LDS reuse between tasks. Persistent
    execution requires cluster_m=1 and supports unquantized EP scatter; quantized scatter retains the existing nonpersistent path.

  • Configurable pipeline drain: Add rolled_drain to select a runtime loop instead of fully unrolling the pipeline drain. Preserve fence and prefetch ordering, with the final prefetched tile handled separately to avoid a runtime branch that can cause VGPR spills.

  • Tuning configuration updates: Normalize the grouped MoE and Qwen3.5-397B CSV schemas, remove obsolete fields, populate stage-specific settings, and update selected configurations. Persistent scheduling remains opt-in; the committed CSV rows set both worker counts to zero.

  • More representative tests: Correct real-EP activation buffer sizing so top-k expands routing tensors rather than token storage. Add balanced routing and reproducible seeds, enable gfx1250 A4W4 EP coverage with a reference that models both MXFP4 activation quantization stages, and make numerical tolerance failures assert. Enable graph-based grouped GEMM
    timing and increase EP benchmark iterations.

Implementation and test changes: PR diff.

yadaish added 16 commits October 5, 2026 23:08
Enable persistent execution with unquantized EP scatter and select its
worker count from explicit fused tuning rows. Add the default configuration
for the 8192-token bucket, hidden 7168, intermediate 2048, and 64 local
experts, so no tuning environment variables are required.

On the four-GPU run_mega workload, K2048 GEMM2 improves from 173.5 to
166.4 us and fused pipeline latency from 480.3 to 473.0 us per layer.
Validated with rocprofv3, repeated measurements, and a passing 16-layer
FP32-reference accuracy check using the default CSV configuration.
@yadaish
yadaish requested a review from a team October 8, 2026 12:13
@github-actions

github-actions Bot commented Oct 8, 2026

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: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: 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 6269 --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.

@github-actions github-actions Bot changed the title Dev/yadai moe v1 [FlyDSL] Dev/yadai moe v1 Oct 8, 2026
@github-actions github-actions Bot added the FlyDSL label Oct 8, 2026
@github-actions github-actions Bot changed the title [FlyDSL] Dev/yadai moe v1 [CK] [FlyDSL] Dev/yadai moe v1 Oct 9, 2026
@github-actions github-actions Bot added the CK label Oct 9, 2026
yadaish and others added 3 commits October 10, 2026 15:21
Keep the PR's grouped-MoE tuning columns and expert65/topk9 row while
retaining main's removal of the duplicate 512-token config. Use main's
upstream CK pin 96afae1d, which includes the same half_t intrinsics fix.
Format the persistent-EP assertion with Black.

Validation against pre-merge PR head ce2fdec, using FlyDSL 0.3.4.1:
- Cross-compiled 92 gfx1250 MoE GEMM specializations on each version;
  all 92 final-assembly pairs are byte-identical (184 compilations).
- Covered both stages, FP4/FP8, rolled drain, persistent workers,
  and unquantized/FP4/FP8 EP scatter.
- Passed 22 config collision tests and 10 gfx950 routing checks,
  including eager/graph execution, expert-count boundaries, and
  preservation of the EP route counter.
- Black, Ruff, Python parsing, and PR diff whitespace checks passed.

No gfx1250 hardware was available for GEMM execution or performance tests.
@github-actions github-actions Bot changed the title [CK] [FlyDSL] Dev/yadai moe v1 [FlyDSL] Dev/yadai moe v1 Oct 12, 2026
@github-actions github-actions Bot removed the CK label Oct 12, 2026
@github-actions github-actions Bot changed the title [FlyDSL] Dev/yadai moe v1 [CK] [FlyDSL] Dev/yadai moe v1 Oct 12, 2026
@github-actions github-actions Bot added the CK label Oct 12, 2026
@github-actions github-actions Bot changed the title [CK] [FlyDSL] Dev/yadai moe v1 [FlyDSL] Dev/yadai moe v1 Oct 12, 2026
@github-actions github-actions Bot removed the CK label Oct 12, 2026
@junhaha666
junhaha666 merged commit e24d012 into main Oct 13, 2026
@junhaha666
junhaha666 deleted the dev/yadai_moe_v1 branch October 13, 2026 02:11
jhinpan added a commit that referenced this pull request Oct 17, 2026
… write-back

- rolled_drain and persistent_workers2 get the value grouped_moe_gfx1250
  reads a blank cell as (0), like the other columns the tuner does not set.
- A written row takes the file's columns; only a missing key is added.
  Re-tuning a row of tuned_grouped_fmoe.csv no longer adds max_m and
  grouped_persistent_m, which #6269 dropped, blank in every other row.
- A column without blank cells and without a known blank value stops the
  tuner before it times a candidate, and result_to_csv before it writes.
- _csv_text writes an integral number in any notation as the integer.
yzhou103 pushed a commit that referenced this pull request Oct 22, 2026
* fix(moe-tuner): write grouped MoE tuning results back in place

GroupedFmoeTuner.result_to_csv went through update_tunedf and a pandas
round trip, which broke tuned_grouped_fmoe.csv in two ways:

- The tuner keys on gate_mode, which the CSV does not have, so a
  re-tuned row was appended next to the old one, with a new gate_mode
  column, instead of replacing it. The lookup ignores gate_mode and
  takes the row with the lower us, so the stale row could still win.
- pandas reads a column that has a blank cell as floats, so the other
  rows came back with "16.0" for 16.

Read the file as text, match rows on the key columns the file has,
replace a re-tuned row in place, and keep the other rows byte for byte.
In a column without blank cells, a re-tuned row gets the value a blank
cell means rather than a blank, so the config merge does not turn that
column into floats.

Signed-off-by: Jin Pan <[email protected]>

* fix(moe-tuner): keep the grouped config's columns and filled cells on write-back

- rolled_drain and persistent_workers2 get the value grouped_moe_gfx1250
  reads a blank cell as (0), like the other columns the tuner does not set.
- A written row takes the file's columns; only a missing key is added.
  Re-tuning a row of tuned_grouped_fmoe.csv no longer adds max_m and
  grouped_persistent_m, which #6269 dropped, blank in every other row.
- A column without blank cells and without a known blank value stops the
  tuner before it times a candidate, and result_to_csv before it writes.
- _csv_text writes an integral number in any notation as the integer.

---------

Signed-off-by: Jin Pan <[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.

3 participants