Summary (Overview)
- RankCast is a unified framework for rank-level load balancing in expert-parallel (EP) Mixture-of-Experts (MoE) inference serving, addressing the distinct bottlenecks of prefill (compute-bound) and decode (memory-bound) phases.
- Key insight: Prefill latency is determined by the maximum token count on the busiest EP rank, while decode latency is dominated by the maximum number of active experts across ranks. RankCast optimizes both objectives under a single routing constraint.
- Routing constraint: For every token, RankCast preserves the predicted Top-p experts () and selects the remaining experts from a Top-L candidate set (), limiting quality degradation.
- Results: On Qwen3-235B-A22B (EP=8) and Qwen3.5-397B-A17B (EP=16), RankCast removes over 75% of the busiest rank's excess prefill load, improves prefill input throughput by up to 19%, and reduces decode time per output token (TPOT) by up to 10%, with quality cost below one percentage point.
- Implementation: Integrated into SGLang and DeepEP, with balancing decisions overlapped with model execution using existing communication channels—no additional synchronization barriers.
Introduction and Theoretical Foundation
Background and Motivation
Modern LLM inference increasingly adopts disaggregated architectures separating Prefill (P) and Decode (D) phases, alongside Expert Parallelism (EP) for large MoE models. However, load imbalance across EP ranks creates synchronization bottlenecks: each layer must wait for the busiest rank due to dispatch/combine collectives.
Phase-Dependent Bottlenecks
The paper identifies that the source of latency differs fundamentally between phases:
- Prefill is compute-bound: MoE layer latency is determined by the maximum token count assigned to the busiest rank, since computation and communication grow linearly with tokens.
- Decode is memory-bound (at moderate batch sizes): Latency is dominated by loading weights of active experts; additional tokens matter little until exceeding one block's capacity. The paper cites OEA's observation that MoE decode latency scales approximately linearly with active-expert count.
Limitations of Existing Approaches
| Approach | Limitation |
|---|---|
| Placement (e.g., UltraEP) | Cannot track fast load shifts; can worsen imbalance |
| Replication (e.g., CRAFT) | Occupies HBM needed for KV cache; reduces goodput (19–75% KV-cache loss) |
| Prefetching (e.g., PROBE) | Must fit weight transfers into short hiding window; impractical across nodes |
| Training-time balancing | Frozen router faces batch-level variation and domain drift at serving time |
Key Innovation
RankCast reroutes tokens to less-loaded ranks (prefill) or already-active experts (decode) instead of moving expert weights. This avoids memory/communication costs while preserving quality through constrained rerouting.
Methodology
Unified Routing Constraint
For token with router scores , the candidate set and protected set are defined as:
Every token's final selection satisfies with .
Prefill Algorithm: Rank Prices
Prefill balances rank load by adjusting each token's flexible assignments via a transportation problem:
This is solved through its dual using token thresholds and rank prices :
where are residual scores. Prices are computed from compact distributed histograms rather than individual scores, with data size dependent only on (ranks) and (bins). Final prices are centered:
The target layer selects experts by price-adjusted scores:
Decode Algorithm: Expert Shedding
Decode minimizes the maximum active-expert count per rank via greedy expert closure:
Each rank orders closable experts by closure cost:
where is the token's slack and is the quality weight. The maximum feasible reduction is:
where is rank headroom and is the number of closable experts on rank .
System Implementation
- Cross-layer prediction: The next layer's routing is predicted from current hidden states: (Equation 9)
- Four-stage pipeline: (1) predict routing, (2) exchange compact metadata via DeepEP's existing dispatch communication, (3) compute balancing decision, (4) apply at next router
- Overlap: Kernels run on a side stream, overlapping with model execution (statistics: 54µs, price: 44µs per layer on Qwen3-235B)
Empirical Validation / Results
Prefill Throughput (Table 1)
RankCast achieves significant improvements across workloads:
| Workload | Throughput Gain (Qwen3-235B) | Throughput Gain (Qwen3.5-397B) | Imbalance Reduction |
|---|---|---|---|
| ShareGPT | +16.4% to +19.4% | +10.4% to +11.2% | 1.75 → 1.08–1.11 |
| CodeContests | +16.4% to +19.3% | +13.9% to +14.6% | 1.66 → 1.03–1.04 |
| LongBench v2 | +4.3% to +7.3% | +4.2% to +4.4% | 1.66 → 1.10–1.16 |
RankCast outperforms online EPLB by 2.7–6.8 percentage points, and EPLB with redundant experts (EPLB-R) by even more.
Decode TPOT (Table 3)
| Workload | Qwen3-235B Gain | Qwen3.5-397B Gain |
|---|---|---|
| WildChat | +6.1% | +10.8% |
| ShareGPT | +6.1% | +8.8% |
| ShareGPT (tiled 1K) | +7.9% | +9.9% |
| CodeContests | +8.2% | +11.1% |
Decode shedding lowers the mean active-expert count on the busiest rank from 14.4 to 9.7, with median TPOT linear in this count (slope 0.52 ms/expert, ).
Quality Impact (Table 4)
- Qwen3-235B: Largest drop with both phases enabled is 0.84 pp (LiveCodeBench v5)
- Qwen3.5-397B: No benchmark drops more than 0.43 pp
- Several benchmarks show improvements (e.g., MMLU-Redux +0.18 pp, AIME 2025 +0.32 pp on Qwen3.5-397B)
Prediction Accuracy (Table 5)
- True top-2 set matches prediction for 63.1% (235B prefill), 66% (235B decode), 48% (397B decode)
- True top-2 lies within predicted Top-L for 98.0–99.8% of tokens
- After shedding, 97.6–97.8% (235B) and 87.9–94.5% (397B) of tokens keep both true top-2 experts
Overhead
- Prefill balancing: ~0.5% added to prefill step time
- Decode shedding: 0.7–0.9% added to decode step time
- Solver: 9–17 µs/layer (Qwen3-235B), 58 µs/layer (Qwen3.5-397B), mostly hidden by overlap
Theoretical and Practical Implications
Theoretical Contributions
- Phase-aware formulation: The paper formalizes EP balancing as two distinct optimization problems—max-token-load minimization (prefill) and max-active-expert minimization (decode)—unified under a single routing constraint framework.
- Dual-based solution: Prefill prices play the same dual role as Kimi K3's Quantile Balancing biases, but for physical ranks at serving time rather than training-time expert balancing.
- Feasibility guarantees: The transportation problem has an integral LP optimum whenever feasible (Appendix A.1), and histogram-based price estimation has bounded error (at most one bin width).
Practical Implications
- No extra memory/communication: Unlike replication and prefetching, RankCast adds no HBM pressure or communication overhead—critical for long-context serving where KV-cache capacity is scarce.
- Composability: RankCast acts on routing while placement acts on weights, so the two can be combined (though not yet measured together).
- Scalability: Offline replay experiments show effectiveness up to P=128 (imbalance reduction of 51–72% of excess), though native imbalance grows with more ranks.
- Compatibility: Integrates with existing inference frameworks (SGLang, DeepEP) and is CUDA-graph compatible.
Conclusion
RankCast provides a unified, phase-aware solution to rank-level load balancing in expert-parallel MoE serving:
- Prefill uses rank prices derived from compact histograms to redistribute flexible token assignments, reducing peak token load.
- Decode uses greedy expert closure with token-level constraints to reduce peak active-expert counts.
- Both phases preserve each token's Top-p protected experts and maintain at least k candidates per token, keeping quality costs below one percentage point.
Future directions and limitations:
- Evaluation limited to two models from one family (Qwen); routers with group-limited or sigmoid gating remain untested
- Experiments use at most 16 GPUs at EP=16; larger-scale deployments need validation
- Kernels and serving integration are not fully optimized; reported overhead is an upper bound
- RankCast is not lossless (unlike placement); deployments requiring exact trained routing should use placement instead
- Combining RankCast with placement/replication strategies remains unexplored
Related papers
- How to build and train your recurrent-depth model: A fixed-point perspective
Input injection in recurrent-depth models is exactly Halpern iteration, enabling depth-independent truncated backpropagation windows and guiding a new Lipschitz-aware optimizer called Sparrow.
- When Are Parallel Subagents Effective for Coding? An Empirical Study on Repository Construction
Parallel subagents add only 1-5 points on repository-construction tasks at 2.6-3.8x cost, with a single probe sentence recovering most of the gain.
- You don't need long context
Compaction and selective input reading let frontier models match full-context accuracy on long-context benchmarks while cutting context length and cost by up to 233x.