add A4W4 and FP8 P2P transport support to MegaMoE - #972
Conversation
Extend the fused operator to A4W4 and reduce Stage2 transport cost with quantized scatter, paired configuration tuning, and regression coverage.
Keep the MegaMoE feature branch scoped to APIs used by the implementation.
Use MegaMoE as the canonical public and internal name, and align the kernel test path and CI references with the unversioned operator.
Resolve MegaMoE conflicts while retaining A4W4 and configurable FP8 P2P support alongside upstream dispatch, tuning, and SwiGLU fixes. Co-authored-by: Cursor <cursoragent@cursor.com>
Restore A4-specific Stage2 pipeline and geometry choices while keeping P2P auto-selection rank-invariant. Co-authored-by: Cursor <cursoragent@cursor.com>
Restore tuned medium-batch FP8 profiles and honor the two-stage B pipeline to recover performance after merging main. Co-authored-by: Cursor <cursoragent@cursor.com>
Preserve A4W4 and FP8 P2P tuning while integrating upstream fixes. Co-authored-by: Cursor <cursoragent@cursor.com>
A4W4 misses two committed goldens, and CI cannot see itBoth shapes CI never catches this because It entered with #985
Ruled out by measurementLLVM bump #945, two ways: running What is leftIn the slower build the shader does strictly less work — SQ_BUSY_CYCLES -1.8%, Total work down, critical path up. That points at intra-kernel workgroup @GwilliamHu — does the payload-overlap schedule assume the A8W4 payload size? A FP4 Small patch, not worth a PROn Interleaved A/B, 5 rounds: bs=512 -1.3% but the distributions overlap (4/5, p≈0.19, |
Use measured grid multipliers for BS2/4/16 and refresh tight-MTPR accuracy and performance gates.
Thanks for the detailed investigation. The A4W4 performance numbers in this PR are indeed outdated after PR #985 (2d65dea) was merged. I'll update the A4W4/A8W4 benchmark results and corresponding baselines to reflect the latest measurements. The regression does not appear to come from the A4W4 functionality itself, and accuracy remains unchanged. I'll also investigate the payload-overlap scheduling changes from #985 to better understand the A4W4 impact. Agreed that the CI failure/skipped test issue should be addressed separately since it prevented this regression from being caught. Note: |
Preserve fixed-MTPR and tight-capacity behavior behind a cached resolver while consolidating geometry formulas and measured residuals. Extend benchmark topology metadata and remove the redundant config-only unit suite in favor of E2E coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
Apply the repository Black formatting rules so the Python style pre-check accepts the capacity-aware tuning changes. Co-authored-by: Cursor <cursoragent@cursor.com>
Motivation
Extend MegaMoE V2 to support the DeepSeek V4 Pro A4W4 path alongside A8W4, while reducing Stage2 cross-rank traffic and latency with blockwise FP8 P2P scatter.
Technical Details
fp8_blockwise_1x32Stage2 transport:Test Plan
fp8_blockwise_1x32P2P transport for both A4W4 and A8W4.Test Result
8× AMD Instinct MI355X DeepSeek V4 Pro
hidden/intermediate:7168/3072 , experts/top-k:384/6 .
Note: A4W4 and A8W4 performance data has been updated following the merge of PR #985 (2d65dea), which changed the benchmark results.
1、A4W4 vs A8W4

2、A4W4 FP8 P2P vs BF16 P2P

3、A8W4 FP8 P2P vs BF16 P2P

4、MegaMoE vs local mxfp_moe serial chain

Submission Checklist