Memory-Efficient Expert Routing for Distributed MoE Training
cs.DC, cs.AI, cs.NI
Submitted: 2026-10-05
Updated: 2026-10-05
Code: https://github.com/deepseek-ai/DeepEP
License: http://creativecommons.org/licenses/by/4.0/
The gist: As Mixture-of-Experts (MoE) models scale toward hundreds of experts and higher top- k routing, memory efficiency in distributed training becomes a critical bottleneck.
Abstract
As Mixture-of-Experts (MoE) models scale toward hundreds of experts and higher top- k routing, memory efficiency in distributed training becomes a critical bottleneck. Peak memory is dominated by the MoE block, not attention: every intermediate buffer in the MoE dispatch pipeline is individually scaled by top-k routing. The standard all-to-all dispatcher sends all routed tokens in a single collective step, requiring the full top- k-expanded buffer to be constructed at once. In this work, we propose RelayMoE, a ring-based MoE execution model that computes locally as expert weights or tokens circulate, avoiding full top- k-expanded dispatch buffers. RelayMoE selects between expert and token routing according to communication volume and overlaps transfers with computation. The ring structure naturally supports memory-efficient MoE recomputation during backward: each hop reconstructs expert intermediates, uses them to compute gradients, and releases them before the next hop. The saved memory supports longer sequences and larger batches, or retains more attention activations to reduce attention recomputation and improve training throughput. We evaluate RelayMoE on 30B - 57B production MoE models and varied expert configurations. In single-layer MoE experiments, RelayMoE achieves a 2 times average speedup over Megatron-LM. In full-model training under the same GPU memory budget, it improves throughput by up to 2.02 times and extends the largest tested trainable sequence length by up to 2.85 times.
Sources
- Training Deep Nets with Sublinear Memory Cost
- DeepSeek-V3 Technical Report
- SonicMoE: Accelerating MoE with IO and Tile-aware Optimizations
- DeepSpeed Ulysses: System Optimizations for Enabling Training of Extreme Long Sequence Transformer Models
- Mixtral of Experts
- MegaScale-MoE: Large-Scale Communication-Efficient Training of Mixture-of-Experts Models in Production
- MoE Parallel Folding: Heterogeneous Parallelism Mappings for Efficient Large-Scale MoE Model Training with Megatron Core
- UCCL-EP: Portable Expert-Parallel Communication
- ZeRO-Infinity: Breaking the GPU Memory Wall for Extreme Scale Deep Learning
- Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism
- MoEBlaze: Breaking the Memory Wall for Efficient MoE Training on Modern GPUs
- MemFine: Memory-Aware Fine-Grained Scheduling for MoE Training
Related papers
- iScheduler: Reinforcement Learning-Driven Continual Optimization for Large-Scale Resource Investment Problems
- SAMM: Sharded Automated Market Maker
- InferScale: GPU-Native KV Injection for Personalized LLM Serving
- Vigil: Accountable Liveness against Selective Silence
- Steelhead: Interleaving Partially Synchronous and Asynchronous Commit Rules on a Shared DAG
- Democratizing MoE inference on commodity GPUs with CoMoE