Repository navigation
[FlyDSL] [CI] [JIT] comm fused moe - #4985
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags: |
e98477f to
a289fea
Compare
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
ruff
Undefined name case
Function definition does not bind loop variable metadata
Function definition does not bind loop variable case
Undefined name case
Function definition does not bind loop variable baseline_partial
Undefined name baseline_partial
Function definition does not bind loop variable baseline_partial
Undefined name baseline_partial
Function definition does not bind loop variable baseline_partial
Undefined name baseline_partial
Function definition does not bind loop variable shared
Undefined name shared
Function definition does not bind loop variable baseline_partial
Undefined name baseline_partial
Function definition does not bind loop variable candidate_partial
Undefined name candidate_partial
Function definition does not bind loop variable shared
Undefined name shared
Function definition does not bind loop variable candidate_partial
Undefined name candidate_partial
Function definition does not bind loop variable candidate_partial
Undefined name candidate_partial
Function definition does not bind loop variable flydsl_partial
Undefined name flydsl_partial
Function definition does not bind loop variable shared
Undefined name shared
Function definition does not bind loop variable flydsl_partial
Undefined name flydsl_partial
Function definition does not bind loop variable flydsl_partial
Undefined name flydsl_partial
Function definition does not bind loop variable flydsl_ar
Function definition does not bind loop variable flydsl_partial_base
Function definition does not bind loop variable flydsl_state
Undefined name flydsl_state
Function definition does not bind loop variable flydsl_state_base
Function definition does not bind loop variable flydsl_output
Undefined name flydsl_output
Function definition does not bind loop variable flydsl_output
Undefined name flydsl_output
Import block is un-sorted or un-formatted
Use a single with statement with multiple contexts instead of nested with statements
aiter/op_tests/multigpu_tests/probe_flydsl_small_m_allreduce_tp8.py
Lines 68 to 69 in a289fea
Function definition does not bind loop variable launcher
Function definition does not bind loop variable input_flat_base
Function definition does not bind loop variable state
Undefined name state
Function definition does not bind loop variable state_flat_base
Function definition does not bind loop variable output
Undefined name output
Function definition does not bind loop variable output
Undefined name output
Function definition does not bind loop variable custom_input
Undefined name custom_input
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/multigpu_tests/test_flydsl_comm_fused_full_tp8_perf.py
Lines 162 to 164 in a289fea
Import block is un-sorted or un-formatted
aiter/op_tests/multigpu_tests/test_flydsl_comm_fused_full_tp8_perf.py
Lines 336 to 342 in a289fea
Import block is un-sorted or un-formatted
aiter/op_tests/multigpu_tests/tune_comm_fused_moe.py
Lines 4 to 21 in a289fea
Consider using a list literal instead of str.split
aiter/op_tests/multigpu_tests/tune_comm_fused_moe.py
Lines 25 to 27 in a289fea
Use a single with statement with multiple contexts instead of nested with statements
aiter/op_tests/multigpu_tests/tune_comm_fused_moe.py
Lines 113 to 114 in a289fea
6ef3d63 to
ad9c031
Compare
408ec5f to
92f7f50
Compare
92f7f50 to
338e9a1
Compare
338e9a1 to
e643300
Compare
Dispatch configured token buckets through the communication-fused runners and package the DSV4 MXFP8 winners. Compare tuned candidates with the ordinary graph baseline and write explicit fallback rows when the fused path does not win.
Exercise the production dispatch path against ordinary MoE for uniform and skewed routing in eager and graph modes. Run the focused eight-GPU test from the multi-GPU CI entry point.
Compose the MXMoE GEMM2 producer with direct, atomic, and window TP services under the comm-fused kernel shell.\n\nPreserve dynamic-MXFP8 partials and the existing synchronization protocol, optimize tuned small-token direct reductions, support atomic shared BF16 partials, and size window services for independent reduce-scatter and all-gather grids.
e643300 to
41217d3
Compare
130 commits, no conflicts. Nine of them touch aiter/fused_moe.py, including the MXFP4 fused-MoE work in ROCm#5300, ROCm#4526 and ROCm#4985, so the three things this guard rests on were re-checked against the merge result: * tuned_fmoe.csv still carries no mxfp4 row with a non-256-aligned inter_dim, so the tuned path cannot hand an affected shape to CK-Tile behind the guard. * The CK-Tile stage-2 scale indexing is still unfixed (ROCm#5233 open), so the host-side guard is still needed. * Dispatch is unchanged: inter_dim 128/384/640 to FlyDSL, 192/320 and the 256-aligned values on CK-Tile, with _fused_moe_impl's validation firing on exactly the re-routed shapes.
Motivation
Communication-fused MoE currently executes the Stage2 GEMM and TP reduction as
separate operations. For decode-sized batches, kernel launches, intermediate
workspace traffic, and cross-rank synchronization account for a significant
part of the end-to-end latency.
This PR adds a config-driven FlyDSL communication-fused Stage2 path for gfx950
A8W4 MXFP4 MoE workloads. The initial production target is DeepSeek-V4 TP8
decode. Unsupported shapes and token buckets continue to use the existing
ordinary Stage2 + TP AllReduce path.
Performance
Single-operator latency
Representative TP8 graph measurements collected during development are shown
below. Each value is the median of three rounds using the maximum latency across
all eight ranks. The fused path includes GEMM2 and the TP collective; the
ordinary path includes Stage2 followed by TP AllReduce.
The production table enables the direct comm-fused megakernel only for
M = 1, 2, 4, 8, 16. Larger buckets remain explicit ordinary fallbacks unlessa fused candidate has been separately validated and selected.
End-to-end model performance
The end-to-end comparison used DeepSeek-V4-Pro with TP8/EP1, FULL CUDA graph,
ISL=8192, OSL=1024, random-range-ratio=0.8, and concurrency
1, 2, 4, 8, 16. Each arm started the model once and ran all five concurrencylevels. Results use three adjacent
A/Bpairs in the fixed orderA1 -> B1 -> A2 -> B2 -> A3 -> B3, where A enables comm-fused MoE and B setsAITER_DISABLE_COMM_FUSED_MOE=1. The reported improvements are the median ofthe three paired improvements.
All five concurrency levels improved both TPOT and total-token throughput. The
observed paired-median TPOT improvement is 1.65% to 5.58%, while total-token
throughput improves by 1.78% to 5.86%.
Technical Details
Add gfx950 A8W4 comm-fused MoE kernels under
aiter/ops/flydsl/kernels/comm_fused_moe/gfx950/a8w4/.protocol inside the comm-fused shell.
selecting them in the current production CSV.
Add AITER runtime and config dispatch.
CommFusedMoeRuntimereuses the existing routing and Stage1 implementation,then replaces Stage2 + TP AllReduce with a prepared fused runner.
supplied.
configs/model_configs/*tuned_comm_fused_moe*.csv.fallbackrows for buckets without a validated fused winner.Add dynamic MXFP8 TP partials.
BF16.
comm-fused Stage2 input layout without an extra reorder kernel or workspace.
incompatible cached code object.
Add peer-VMM workspace handling.
small-allocation peer-VMM performance cliff.
that dereference peer mappings.
Correctness and Accuracy
The current source was validated on gfx950 TP8 with ROCm 7.2.4 using the full
production matrix:
M = 1, 2, 4, 8, 16;All cases were finite and passed the error thresholds. Direct-path relative L2
error ranged from
0.013351to0.014934; the complete M=3 to M=4 runtime pathreported
rel_l2=0.021019.Full GSM8K regression used 3-shot evaluation over all 1,319 examples with TP8,
FULL CUDA graph, concurrency 8, and the production small-M comm-fused path:
The difference is smaller than the single-run statistical uncertainty; the
result is treated as evidence of no observed accuracy regression, not as an
accuracy improvement claim. Both arms completed all requests without NaNs,
rank failures, or invalid server responses.
Test Plan and Results
Static validation:
git diff --check: passed.TP8 production correctness:
Result: all 10 production route cases plus runtime padding, distinct-stream
execution, and graph replay passed.
Additional retained-kernel validation:
321.584 usordinary versus265.063 usfused, withmax_abs=0.75andrel_l2=0.02998.short run and therefore remains outside the production CSV.
Submission Checklist
multigpuPR label so the gfx950 8-GPU CI job executes the fullcomm-fused MoE test.
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.