MegaFlux: Skew-Resilient MoE Megakernels via Pipelined Expert Replication
Jianzhu Yao, Siva Kumar Sastry Hari, Vignesh Balaji, Sana Damani, Insu Jang, Pramod Viswanath, Christos Kozyrakis
Abstract
Mixture-of-experts (MoE) megakernels fuse expert-parallel communication with expert computation. However, under fixed expert placement, routing skew creates GPU stragglers: overloaded GPUs determine layer latency while others sit idle. Replicating hot experts can shift work to underloaded GPUs, but dynamic replicas introduce additional work: replicas must receive expert weights to execute and, during training, their partial weight gradients must be reduced at the expert owners. We present MegaFlux, which makes expert replication a runtime decision and pipelines the communication induced by replication within persistent MoE execution. An on-device planner jointly selects replica locations and assigns tile-aligned token blocks under a per-GPU replica budget, leaving router outputs unchanged. The forward and backward megakernels realize pipelined expert replication: replicas begin computation as their required weights arrive, while backward overlaps replica-gradient reduction with ongoing expert computation. MegaFlux extends TensorRT-LLM's CuTeDSL MegaMoE forward kernel and introduces a new backward MoE megakernel. Across 147 configurations per direction on eight NVIDIA B200 GPUs, MegaFlux achieves geometric-mean speedups of for forward and for backward over the same megakernels with fixed placement, peaking at and . In ablations, pipelining hides --% of replica-weight transfer cost in forward and --% of combined weight-transfer and replica-gradient-reduction cost in backward, yielding up to % and % additional layer-latency reductions over the same replication plans with these operations executed separately. Integrated into vLLM for DeepSeek-V4-Pro prefill, MegaFlux delivers -- median end-to-end speedups over fixed placement.
Create a lesson
Metadata
- Comments
- 15 pages, 7 figures, 1 table
Related papers
Preserving Optimizer Updates When Experts Move in MoE Training
Shared title terminologycs.DCYanming Lai, Yi Qin, Yongxin Hu et al.
ASHE: Asynchronous Stage-owned Heterogeneous Elastic-averaging for Pipeline-Parallel Training
Shared title terminologycs.DCHamin Jung, Sookwang Lee, Shinyoung Ahn et al.
Activation-Aware Balancing of Fused CPU and GPU Expert Execution for Offline MoE Inference
Shared title terminologycs.DCBorui Xu, Weihao Cui, Yao Chen et al.
Anatomy of a Data Pipeline in Deep Learning Training
Shared title terminologycs.DCJens Birk Andersen, Vivek Shah, Javier González et al.
Mind the Gap: Minimizing Bubbles in Pipeline-Parallel LLM Serving
Shared title terminologycs.DCYouhe Jiang, Yi Xu, Haoran Wu et al.
PipeAxes: Decoupling Compute and Communication Granularities for Pipeline-Parallel LLM Serving
Shared title terminologycs.DCXiaoqiang Guo, Yifan Lin, Yang Liu et al.