Repository navigation
Conversation
This was referenced Dec 4, 2026
…192 I4096 E32 top8 `moe/mxfp4_relu2_norm_h8192_i4096_e32_top8`: one expert-parallel rank's routed experts of Amazon Ergo (256 experts, top 8, 32 local): MXFP8 x MXFP4 gate-only GEMM1 with ReLU² and MXFP8 requant in the epilogue, an unweighted GEMM2, and a combine that RMS-normalizes each slot with its expert's scale before the route-weighted sum in slot order. One launch after the sort; no output atomics. Adapted from moe/mxfp4_h5120_i2304_e48_top6. Co-Authored-By: Claude <noreply@anthropic.com>
…8 ranks `moe/fused_ep_mxfp4_relu2_norm_h8192_i4096_e32_top8_ranks8`: the one-launch EP layer of moe/fused_ep_mxfp4_h5120_i2304_e48_top6_ranks8 for Amazon Ergo's gate-only ReLU² experts (H 8192, I 4096, top 8, 32 experts per rank). GEMM2 returns unweighted bf16 route rows with a square-sum partial per column tile; the combine on the token's rank sums the partials in tile order, normalizes each slot with its expert's scale and sums the route-weighted slots in slot order. Tile table tuned per DP8 decode token count (sweep_dispatch.py). Co-Authored-By: Claude <noreply@anthropic.com>
andyluo7
force-pushed
the
pr-ergo-fused-ep
branch
from
December 4, 2026 22:33
1a3889b to
35a1e20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A new FlyDSL kernel package,
moe/fused_ep_mxfp4_relu2_norm_h8192_i4096_e32_top8_ranks8. It is the one-launch expert-parallel MoE layer ofmoe/fused_ep_mxfp4_h5120_i2304_e48_top6_ranks8, adapted for Amazon Ergo:Depends on #30. The staged baseline in the benchmark uses that entry. This branch is stacked on it, so the diff shows both until it merges.
What changed against the DeepSeek-V4 package.
relu(g)^2and MXFP8 requant in the epilogue.rstd, normalizes the slot with its expert's scale from a[epr * world, 8192]table of every rank's experts, and sums the route-weighted slots in slot order. There is still one rounding and no output atomics.sweep_dispatch.py). Against the DeepSeek-V4 tiers it started from: the same up to T 32, and 8–22% faster from T 64 to 1,024.--hint-fromforrows_hint.Performance
Setup: 8 x MI350X, graph replay of 20 distinct inputs, µs per call (max over ranks); zipf = Zipf 1.2 expert popularity.
Staged = what DP + EP serving runs without this entry: RCCL all-gather of the bf16 rows, ids and weights, then
moe/mxfp4_relu2_norm_h8192_i4096_e32_top8on every gathered token, then RCCL reduce-scatter.The fused layer is 1.16–2.76x faster. From T 256, the return of unreduced route rows over xGMI binds (134 MB per rank at T 1024).
End to end. In vLLM, Ergo on 8x MI350X with DP8 + EP8 and DSpark, the layer runs on decode steps, where every rank has at most 1,024 tokens. Prefill steps keep the all-gather path.
GSM8K is 97.6% with the fused layer and 97.3% without.
Prefill. #29 extends the DeepSeek-V4 fused EP to prefill sizes. The same change would let Ergo's prefill use this layer too.
Tests
The tests run on 8 x MI350X, for 32 and 33 experts per rank, with:
They check:
reference.py: cosine >= 0.99999, each row >= 0.9999;The workload spreads the experts' output magnitudes up to 16x. A kernel that skipped or misplaced the per-expert norm therefore drops the cosine to about 0.7.
🤖 Generated with Claude Code