RankCast: Phase-Aware Rank Balancing in MoE Serving

Kaidi Fu, Xu-Hao Lu, Pingwei Sun, Jianchao Tan, Yuchen Xie, Xunliang CaiarXiv 2026

TL;DR

Serving massive Mixture-of-Experts (MoE) language models is like running a grocery store where every customer must wait until the longest checkout line finishes—one overloaded GPU stalls the entire fleet. RankCast breaks this bottleneck by dynamically nudging lower-priority token routing choices away from swamped GPUs, tailoring its strategy to whether the system is processing a prompt (compute-bound) or generating words (memory-bound). The result is up to 19% faster prompt processing and 10% faster token generation, with virtually no extra memory overhead and less than a 1% dip in accuracy.

What Problem Does This Paper Address?

In Mixture-of-Experts (MoE) models, only a few specialized sub-networks ("experts") process each token. To fit giant MoEs into memory, systems use Expert Parallelism (EP), scattering experts across multiple GPUs (ranks). Because GPUs must synchronize at every layer, the whole cluster runs at the speed of the single busiest GPU.

Even if a model is trained to use experts evenly over the long run, real-world user traffic causes sudden, batch-by-batch popularity spikes on specific GPUs. Existing fixes replicate popular experts across GPUs or prefetch weights on the fly, eating up precious GPU memory (needed for long-context KV caches) or clogging network bandwidth.

Worse, modern LLM serving splits inference into two distinct phases—Prefill (digesting the input prompt) and Decode (generating output tokens one by one)—and they suffer from completely different bottlenecks:

  • Prefill is compute-bound: Latency is dictated by the maximum number of tokens sent to the busiest GPU.
  • Decode is memory-bound: At moderate batch sizes, the math is fast, and latency is dominated by loading expert weights from memory—meaning the bottleneck is the maximum number of unique active experts on the busiest GPU.

Methods

Instead of moving heavy expert weights around, RankCast gently alters routing at inference time. Normally, a router picks the Top-$k$ experts for each token. To protect model quality, RankCast locks in each token's favorite Top-$p$ experts (e.g., top 2), and restricts the remaining $k - p$ "flexible" choices to a viable pool of Top-$L$ candidates ($p \le k \le L$).

Figure 1: RankCast overview. (a) Predicted next-layer routing defines protected Top-p experts and Top-L candidates. (b) Prefill uses rank prices to redistribute flexible assignments and reduce peak token load. (c) Decode closes low-cost experts to reduce the peak active-expert count while preserv- ing protected experts and at least k candidates per token.

Under this unified safety constraint, RankCast runs two phase-specific algorithms:

  1. Congestion Pricing for Prefill: Formulated as a mathematical transportation problem, each GPU is assigned a "price" based on demand (estimated via compact, shared score histograms). Crowded GPUs get high prices, subtracting from their experts' scores and steering flexible tokens toward quieter GPUs.
  2. Expert Shedding for Decode: Starting from standard Top-$k$ choices, a greedy solver iteratively "closes" (masks out) low-impact experts on the busiest GPUs, forcing tokens to consolidating onto experts that are already active—while guaranteeing every token keeps its Top-$p$ favorites and at least $k$ open options.

Hiding the Latency: You can't pause a GPU to haggle over prices. RankCast predicts layer $\ell+1$'s routing scores early using layer $\ell$'s hidden states. It runs its lightweight solvers on a parallel CUDA stream and piggybacks its tiny metadata onto token-count messages that the communication library (DeepEP) already sends, adding zero synchronization barriers.

Figure 2: Cross-layer execution of RankCast on one EP rank. Prediction and balancing overlap with model execution, using metadata carried by existing DeepEP communication to compute (a) prefill rank prices or (b) a decode expert mask for the next layer. Dashed dependencies indicate CUDA events; slack denotes the interval between solver completion and next-layer selection. LL: low-latency. Timelines are schematic.

Datasets

RankCast introduces no new datasets, evaluating instead on established public benchmarks:

  • Throughput & Latency: ShareGPT, CodeContests, LongBench v2 (32K-token long-context windows), and WildChat.
  • Model Quality: MMLU-Redux 2.0, MATH-500, MMMLU, RULER, GPQA-Diamond, AIME 2025, IFEval, and LiveCodeBench v5.

Key Insights and Ideas

  • One size does not fit both phases: Steering individual tokens away from a GPU helps prefill, but does nothing for decode if at least one token still triggers an expert's weights to load. Recognizing that prefill needs token flattening while decode needs expert consolidation is the core insight enabling end-to-end speedups.
  • Cross-layer prediction doesn't need to be perfect: Predicting the next layer's exact top-2 experts using current hidden states only succeeds 48–66% of the time. However, the true top-2 land inside the broader Top-$L$ candidate pool 98.0–99.8% of the time, and mis-rankings mostly swap experts of nearly identical weight—keeping model quality remarkably intact.
  • Static biases fail on shifting domains: Tracking historical load with a slow-moving offset works fine when consecutive batches look alike (e.g., short ShareGPT chats), but completely stalls on diverse 32K-token LongBench inputs where expert demand shifts wildly from batch to batch. Per-batch pricing adapts instantly.

Key Results

Tested on Qwen3-235B-A22B (EP=8) and Qwen3.5-397B-A17B (EP=16) using SGLang and DeepEP across H800 GPUs:

  • Prefill Speedup: Removes 76–95% of the busiest GPU's excess token load, boosting input throughput by 10.4–19.4% on ShareGPT/CodeContests and 4.2–7.3% on 32K LongBench v2—outperforming online expert-placement baselines (EPLB), especially when replica memory eats into batch concurrency.
  • Decode Speedup: Cuts the average peak active experts per rank from 14.4 down to 9.7 (on Qwen3-235B), reducing median Time Per Output Token (TPOT) and boosting generation speed by 6.1–11.1%.
  • Minimal Quality Cost: Across eight reasoning, coding, and knowledge benchmarks, accuracy shifts stay under 1 percentage point (max drop of 0.84 pp when combining both phases).
  • Near-Zero Overhead: Overlapping computation keeps system step-time overhead below 0.5% in prefill and 0.9% in decode.

Limitations and Future Work

  • Not bit-for-bit lossless: Because RankCast alters expert assignments, deployments strictly requiring exact trained routing must stick to weight placement/replication. However, routing and placement act on orthogonal axes and could be combined in future work.
  • Architecture & Scale Scope: Evaluation covers two Qwen models up to 16 GPUs (EP=16). Routers using sigmoid or group-limited gating (like DeepSeek-V3) and massive multi-node EP scales ( tested only via offline replay up to EP=128) remain to be tested live.

Summary updated

Abstract

Modern large language model (LLM) inference increasingly adopts disaggregated architectures that separate Prefill (P) and Decode (D) phases. Meanwhile, Expert Parallelism (EP) has been widely adopted in large Mixture-of-Experts (MoE) model serving. However, load imbalance still slows down MoE inference because each layer must wait for the busiest EP rank. The main source of latency differs between prefill and decode. Prefill is compute-bound, and its MoE layers' latency is determined by the maximum token count of the busiest rank. At the same time, under moderate batch sizes, Decode is memory-bound, so the latency is dominated by the maximum active-expert count across ranks. To solve both problems under a unified framework, we present RankCast, a system that reduces rank-level maximum token counts during prefill and active-expert counts during decode. For every token, RankCast preserves the predicted Top-p experts and chooses the remaining k-p from its Top-L candidates (L > k). In prefill, RankCast yields a price per rank that steers flexible assignments to less loaded ranks. In decode, RankCast closes experts on the busiest ranks while preserving the constraints for each token. Both paths are implemented and tested in the state-of-the-art inference frameworks SGLang and DeepEP. We overlap RankCast's kernels with model execution and reuse the existing DeepEP communication channel for metadata transmission. On Qwen3-235B-A22B with EP=8 and Qwen3.5-397B-A17B with 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 by up to 10%. The quality cost is below one percentage point.
BibTeX
@misc{fu2026rankcast,
  author = {Kaidi Fu and Xu-Hao Lu and Pingwei Sun and Jianchao Tan and Yuchen Xie and Xunliang Cai},
  title = {{RankCast: Phase-Aware Rank Balancing in MoE Serving}},
  year = {2026},
  eprint = {2611.33542},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.33542},
}
Figure