UltraEP: Exact-Load Real-Time Load Balancing for MoE on Rack-Scale Nodes
Summary (Overview)
- UltraEP is the first exact-load, real-time load balancer for large-scale expert parallelism (EP) in MoE training and serving prefill on rack-scale nodes (RSNs), rebalancing every microbatch and layer on the critical path.
- Achieves 94.6% of force-balanced ideal throughput in training and 93.9% in serving prefill on average across models from 106B to 671B parameters on up to 256 GPUs.
- Introduces a quota-driven planner that jointly optimizes expert replication and token rerouting using exact post-gating load, with a threshold-based binary search feasibility oracle.
- Implements RSN-native communication via persistent tile streaming and chunk-streaming relay trees for hot-expert fan-out, achieving 3.1×–5.5× speedup over mainstream communication backends.
- Reduces final inter-rank imbalance from 1.30–4.01 to 1.01–1.04, with stable production performance exceeding 92% of ideal throughput while preserving training convergence.
Introduction and Theoretical Foundation
Motivation
Large-scale expert parallelism (EP) is essential for training and serving frontier MoE models but amplifies expert load imbalance. The paper identifies three key challenges:
- Compute stragglers: Tokens distribute unevenly across experts due to routing dynamics
- Token all-to-all bottlenecks: Communication hotspots on overloaded devices
- Activation-memory spikes: Memory pressure on overloaded devices
Limitations of Existing Approaches
Existing balancers (e.g., EPLB) rely on historical load prediction and periodic rebalancing, which becomes unreliable with non-stationary load patterns. The paper demonstrates that expert popularity shifts sharply across microbatches, layers, and data domains, making stale predictions produce inaccurate placements.
Rack-Scale Node (RSN) Opportunity
The emergence of RSNs fundamentally changes the design space by extending scale-up connectivity across 64+ GPUs in a full rack, making hot-path balancing physically viable. Key properties:
- Scale-up bandwidth: hundreds of GB/s per GPU (8–10× scale-out)
- Load/store-style memory semantics
- EP groups can be contained within one RSN
Methodology
System Architecture
UltraEP implements a replication-only balancing strategy with several key design decisions:
1. Expert Layout and Memory Management:
- Logical experts (model-defined) map to physical experts (replicas on ranks)
- Fixed layout: one main instance + zero or more redundant replicas per logical expert
- Cross-layer buffer reuse: redundant slots share weight/gradient buffers across layers, reducing per-slot memory from 3.3GB to 36MB for weights
2. Quota-Driven Planning (Algorithm 1):
The planner solves a joint replication-reroute problem:
Key components:
- Threshold formulation: Binary search for the smallest load threshold such that all ranks can be brought below it via replication
- Feasibility oracle: Greedy transfer of excess load from overloaded ranks to admissible ranks with slack
- Quota construction: Each replica carries a minimum useful quota tokens
3. Reroute with Locality:
RSN-Native Communication
Persistent Tile Streaming:
- Expert weights/gradients divided into fixed-size tiles
- Persistent kernel with double-buffered shared memory
- Overlap-aware footprint: configurable SM residency for forward vs. backward paths
Chunk-Streaming Relay for Hotspot Fan-Out:
- Two-stage relay for experts with replica count > 4
- Relay frontier at approximately
- Chunk-level pipelining without global barriers
- Load-aware relay scheduling to balance outgoing traffic
GPU-Native Solving
- Fully on-device implementation (no CPU synchronization)
- Warp-level parallelism with shared memory staging
- Multiple threshold probes evaluated across warps
Empirical Validation / Results
Setup
| Model | Experts (Top-k) | Parallelism (Train | Serve) | |
|---|---|---|---|
| GLM4.5-106B-A12B | 128 (8) | EP64-DP2 | - | 2 |
| Qwen3-235B-A22B | 128 (8) | EP64-DP4 | EP64 | 2 |
| GLM4.7-358B-A32B | 160 (8) | - | EP40 | 4 |
| DeepSeek-V3-671B-A37B | 256 (8) | EP64-PP4 | - | 2 |
Key Results
Training Throughput Improvement:
- 1.42× over Megatron-LM (average)
- 1.56× over SGLang for serving prefill
- 93.9–94.6% of force-balanced ideal throughput
Balancing Quality:
- Post-balancing imbalance: 1.01–1.04 (vs. 1.30–4.01 without)
- 57.9% fewer redundant slots than EPLB+
- 3.9% traffic reduction via locality
Communication Speedup:
- 3.1×–5.5× over torch.distributed and DeepEP
- Relay provides additional 1.3×–1.8× for large fan-out
Comparison with Baselines
| Metric | EPLB+ | UltraEP |
|---|---|---|
| Result Imbalance | 1.19 | 1.03 |
| Solving Time (ms) | 0.153 | 0.111 |
| Total Replicas | 107 | 45 |
| Max Fan-out | 8.5 | 6.8 |
| In-flight Token Ratio | 99.9% | 96.0% |
Theoretical and Practical Implications
System Design Insights
-
Exact load beats prediction: Reacting to realized load with efficient planning (0.111ms solve time) outperforms history-based prediction that can be arbitrarily wrong under non-stationary loads.
-
Joint planning is crucial: Directly optimizing post-reroute load (quota) is superior to decoupled placement-then-reroute approaches, using 57.9% fewer resources.
-
RSN-native communication is essential: Purpose-built communication kernels for dynamic expert traffic achieve near-constant latency (0.28ms) even with increasing fan-out, while generic backends scale linearly.
Production Impact
- Memory efficiency: Reduces MoE activation peak memory by up to 11× in serving, lowering OOM risk
- Convergence preservation: Loss curve follows expected pretraining trajectory (replication-only, no reordering)
- Scalability: Stable performance >92% of ideal throughput in production across multiple racks
Conclusion
UltraEP demonstrates that exact-load, real-time expert balancing is both feasible and near-optimal on RSNs. The key insight is that with sufficient communication bandwidth (RSN scale-up), the balancing problem shifts from "how to predict and hide" to "how to solve and communicate fast enough."
Future Directions
- Reinforcement learning pipelines: Extending the same abstraction to RL training that alternates training and inference
- Decode-phase optimization: Currently focused on prefill; decode presents different challenges due to memory-bound characteristics
- Cross-RSN balancing: Handling models that span multiple RSNs where bandwidth is more constrained
- Adaptive slot allocation: Dynamic adjustment based on observed load patterns
The work establishes that with appropriate system co-design, the theoretical benefits of load balancing can be realized in practice, achieving near-force-balanced performance in production MoE deployments.
Related papers
- The Scaffold Effect in Coding Agents: Harness Choice as a Hidden Variable in Coding-Agent Evaluation
Harness choice drives up to a 40x token cost difference per solved coding task while shifting pass rates by only 0-8 percentage points, making harness-model pairs the correct evaluation unit.
- COBS: Cumulant Order Block Sparse Attention
COBS stores compressed per-block key covariances to raise block sparse attention selection from first-order to second-order approximations, closing 86% of the gap to dense attention with minimal extra KV cache reads.
- OasisKV: Scaling In-Decode KV Cache Beyond HBM with Lookahead Sparse Prefetching
OasisKV uses speculative decoding's draft tokens to predict future KV-cache access, enabling asynchronous prefetching that boosts LLM inference throughput up to 2.1x with negligible accuracy loss.