Large-Scale MoE Model Deployment and Parallelism Strategies
This article breaks down the deployment of large-scale Mixture of Experts (MoE) models, focusing on two structural asymmetries: the gap between parameter count and active computation, and the gap between prefill and decode workloads. It explains three key techniques—expert parallelism, prefill/decode disaggregation, and multi-tier caching—along with a formula for sizing the minimum parallel domain, the evolution of KV cache compression such as Multi-head Latent Attention (MLA), and the evaluation metrics needed for meaningful comparisons. Readers will find practical capacity-planning and deployment guidance for running sparse models efficiently.
1. Where the Problem Starts: Two Asymmetries in Ultra-Large Sparse Models
When deploying inference for large-scale Mixture of Experts (MoE) models, the shape of the solution is not determined by “how big the model is,” but by two structural asymmetries. Once you understand these two points, the subsequent choices around parallel partitioning, stage orchestration, and cache design become natural conclusions.
1.1 Parameter Scale vs. Compute Scale
Take a publicly known class of ultra-large sparse architectures as an example: the total parameter count is in the hundreds of billions, while only a small fraction of those parameters actually participate in computation for each token. This leads to a frequently overlooked conclusion: the compute budget is counted by activated parameters, while the memory budget is counted by all expert weights. In other words, FLOPs and memory capacity follow two completely different conversion rules. If you estimate the number of accelerators based only on activation volume, you will run into weights that do not fit on launch day; if you estimate throughput based only on memory, you will underestimate the actual concurrency capacity.
In engineering practice, capacity planning is usually split into three lines: weights resident in memory, dynamic memory for the KV cache, and headroom reserved for communication and temporary tensors. The peaks of these three do not occur at the same time, but planning must leave a safety margin for the worst-case combination.
1.2 Prefill vs. Decode Workload Asymmetry
The second asymmetry appears along the time dimension:
- Prefill: processes all input tokens at once, with large matrix sizes and high arithmetic intensity. It is compute-intensive and directly determines time to first token (TTFT).
- Decode: generates tokens autoregressively one by one, reading the entire KV cache at every step. It has low arithmetic intensity, is memory-bandwidth-intensive, and directly determines time per output token (TPOT).
Putting these two types of workloads on the same set of devices causes typical mutual interference: prefill of a long prompt raises the latency of decode steps, causing stuttering output; meanwhile, limiting batch size to smooth out token output leaves expensive prefill compute idle.
2. Three Key Technical Approaches
2.1 Expert Parallelism: Spreading Weights and Expanding Batches
Expert Parallelism (EP) distributes different experts across different devices, and the benefits are twofold: a single accelerator does not need to hold all expert weights, and tokens for the same expert are aggregated into a larger effective batch, easing bandwidth pressure during decode. The cost is two rounds of global routing communication (dispatch and combine), so the benefits of EP depend heavily on interconnect bandwidth and topology. In practice, a common layered combination is to run EP over high-bandwidth intra-node interconnects, while carrying data parallelism or pipeline parallelism across nodes.
2.2 Prefill/Decode Disaggregation: Isolating the Two Workloads
Stage disaggregation lets each stage choose its own parallelism strategy, concurrency level, and batch size limit. The prefill side pursues compute utilization and can use larger batches and larger tensor parallelism; the decode side pursues bandwidth efficiency and stable latency, favoring a smaller batch size limit and stricter queuing policies. After disaggregation, the concurrency and batch parameters on both sides must be reconfigured; otherwise, you have merely moved the coupling from the “resource layer” to the “scheduling layer.”
2.3 Multi-Tier Caching: Reducing Repeated Prefill
Prefix sharing, system prompt reuse, and reuse of multi-turn conversation history all cause the same prefix to be prefilled repeatedly. Multi-tier caching (memory—host memory—external storage) pushes reusable KV state down layer by layer, trading bandwidth for recomputation. Hit rate, eviction policy, and cache economics often affect the final payoff more than cache capacity itself.
3. What Constrains Parallel Domain Width
A rule of thumb you can apply directly:
Minimum memory per replica ≈ all expert weights + dense weights such as attention + peak KV cache + runtime headroomMinimum parallel domain width ≥ ceil(minimum memory per replica / usable memory per accelerator)
The larger the weight scale, the higher the per-replica memory requirement, and the wider the minimum parallel domain is pushed. This explains why large model tiers often use “data parallelism 8 + expert parallelism” as a typical single-node configuration, while lighter tiers can use a narrower parallel domain (such as data parallelism 4 + expert parallelism) with the same memory, leaving the remaining memory for longer context and higher concurrency.
4. Attention Compression and the Generational Evolution of Caching
The KV cache is the main memory consumer in long-context scenarios. A class of low-rank compression schemes represented by Multi-head Latent Attention (MLA) compresses the per-token cache to the tens of kilobytes range; further cross-generational optimization can bring it down to roughly the kilobyte range. A smaller cache triggers a chain of three effects: higher concurrency that a single accelerator can hold, less data read per decode step, and lower migration cost across layers and across nodes.
At the same time, under long context, the per-token computation and cache footprint of the model also drop significantly (relative to earlier generations, as low as roughly one quarter and one tenth, respectively). It should be emphasized that these ratios depend heavily on context length, compression ratio, and implementation details, and can only serve as a trend reference, not a committed metric.
5. Evaluation Criteria: Do Not Draw Conclusions from a Single Number
The relationship between throughput and latency is jointly determined by hardware bandwidth, input length distribution, cache hit rate, and speculative decoding configuration. It is recommended to report at least the following at the same time: TTFT percentiles, TPOT percentiles, token output per unit time, cache hit rate, and the combined cost per million tokens. For cross-system comparisons, four prerequisites must also be stated: portability across heterogeneous platforms, whether deterministic inference is enabled, the billing and economics basis for caching, and whether the evaluation dataset and sampling parameters are consistent. Comparisons lacking these prerequisites usually do not hold.
6. Deployment Recommendations
- First do the three capacity calculations (weights, KV, headroom), then determine the minimum parallel domain, and only then discuss throughput tuning.
- For disaggregated deployment, set concurrency limits and batch size limits for each of the two stages, and observe queuing latency separately.
- Monitor cache hit rate as a first-class metric, and establish a regression baseline with logging services and monitoring alerts.
- If running on Baidu AI Cloud’s container platform and high-performance interconnect network, you can prioritize placing expert parallelism within nodes and data parallelism across nodes, and use object storage to carry the offloaded cache tier.
