Large-Scale MoE Model Deployment and Parallelism Strategies

    This article breaks down the core challenges of deploying large-scale Mixture-of-Experts (MoE) inference services, including the asymmetry between total and activated parameters and the differing demands of the prefill and decode stages. It explains three key techniques—expert parallelism, prefill/decode disaggregation, and multi-tier caching—along with how attention compression affects minimum parallelism width, a recommended tuning order for concurrency, batching, and speculative decoding, and four practical constraints to consider when comparing deployment options.

    1. Why Deploying Large-Scale MoE Inference Is Harder Than Training

    Running a large-scale Mixture-of-Experts (MoE) inference service is not difficult because of “getting the model to run.” The real difficulty comes from two hard asymmetries in the cost structure, which drive hardware selection, parallelism domain width, and concurrency limits.

    The first is the asymmetry between total parameters and activated parameters. For publicly documented sparse models, the total parameter count can reach the hundreds of billions, while the experts that actually compute for a single token make up only a small fraction of that. In other words, compute cost (FLOPs) scales with activated parameters, but GPU memory must hold all expert weights. Capacity and compute are decoupled—this is the first-principles constraint of MoE deployment.

    The second is the load asymmetry between the two stages. The prefill stage processes all input tokens at once. It is compute-intensive and determines time to first token (TTFT). The decode stage generates tokens autoregressively one at a time, reading the full KV cache and activated weights at every step. It is memory-bandwidth-intensive and determines time per output token (TPOT). The two workloads demand almost opposite things from hardware, so co-locating them on the same instance inevitably causes interference.

    Once these two points are clear, every parallelism and caching strategy that follows can be seen as a direct response to them.

    2. Three Core Techniques and How They Work

    2.1 Expert Parallelism: Spread the Weights, Grow the Batch

    Expert parallelism (EP) distributes different experts across devices, so each device holds only a subset of expert weights. This spreads the capacity pressure of “fitting all weights” horizontally. The side benefit matters just as much: when tokens are routed to multiple experts on the same device, a larger matrix-multiply batch can be aggregated locally, raising arithmetic intensity and easing low compute utilization at small batch sizes.

    Three things need close attention in practice:

    • Routing balance: Hot experts cause load skew across devices, which requires capacity factors and drop policies to work together.
    • Communication pattern: EP relies on frequent all-to-all dispatch and combine, so inter-node bandwidth is often the bottleneck. The parallelism domain is therefore usually kept closed within a single node.
    • Combination with data parallelism: A common setup uses data parallelism (DP) to serve multiple request replicas, with expert parallelism splitting weights inside each replica, forming a hybrid DP+EP topology.

    2.2 Prefill/Decode Disaggregation: Give Each Workload Its Own Resources

    Stage disaggregation (PD disaggregation) places TTFT-sensitive prefill and TPOT-sensitive decode in separate resource pools, each with its own concurrency, batch-size limit, and parallelism strategy. The gains go both ways: the prefill side can open large batches to saturate compute, while the decode side avoids queueing interference from large requests reading the KV cache, so tail latency converges noticeably.

    Two things must be added after separation: KV cache transfer and scheduling affinity. Cache produced by prefill must be moved to the decode side with low latency, and transfer bandwidth plus lifecycle management directly determine the end-to-end benefit. The scheduler must also keep the same session on a node where its cache already resides.

    2.3 Multi-Tier Caching: Cut Repeated Prefill

    Prefix reuse is the biggest lever for long system prompts, multi-turn conversations, and fixed-template workloads. A sensible tiering is a hot cache in device memory, a warm cache in single-node host memory, and a cold cache backed by object storage or a distributed cache. One prefix hit equals one full prefill saved, and the TTFT improvement is often more significant than a hardware upgrade.

    3. How Attention Compression Couples With Parallelism Domain Width

    Efficiency gains across model generations almost always come from co-design of model architecture and system implementation. As attention evolves from multi-head attention to latent low-rank compression, per-token KV cache usage can drop by one to two orders of magnitude (publicly reported figures fall from tens of KB per token to the hundreds of bytes range). This creates two knock-on effects:

    1. The same memory holds longer context and more concurrency, which raises cache hit rates.
    2. Per-replica memory demand falls, so the minimum parallelism domain narrows. Large-weight models often have to start at single-node 8-GPU DP+EP, while lighter models can start at 4 GPUs—deployment density and fragmentation differ entirely.

    Capacity planning can be expressed with a simplified inequality:

    1. Per-GPU memory >= weight shard + KV cache(context x concurrency) + activations and temporary buffers + runtime overhead
    2. Minimum parallelism domain = ceil(total weight memory / (usable per-GPU memory x target headroom factor))

    In practice, reserve 20%–30% headroom; otherwise bursts of long requests trigger preemption and recomputation.

    4. Tuning Order for Concurrency, Batch Size, and Speculative Decoding

    After stage disaggregation, tune the two sides separately in this recommended order:

    1. 1) Fix the context-length distribution and stress-test the decode side: raise concurrency step by step to find the knee where TPOT starts degrading
    2. 2) Stress-test the prefill side: raise the batch-size limit to find the Pareto frontier of TTFT and throughput
    3. 3) Enable prefix caching, then re-measure hit rate and TTFT
    4. 4) Add speculative decoding last: below a threshold acceptance rate it adds overhead instead, so evaluate it against your workload distribution

    Throughput and latency are different points on the same curve, shaped jointly by hardware bandwidth, input-length distribution, cache hit rate, and speculative decoding configuration. No single metric is enough to judge whether a deployment is good or bad. In cloud deployments, container platforms can handle elastic scaling, object storage can back the cold cache, and logging plus monitoring and alerting can track TTFT/TPOT percentiles, closing the tuning loop.

    5. Four Practical Constraints When Comparing Options

    • Heterogeneous platform portability: Differences in interconnect topology and operator support across accelerators can make the same parallelism configuration perform very differently.
    • Deterministic inference: Dynamic changes in batch concurrency affect reduction order, so scenarios that require reproducible results need explicit constraints.
    • Cache economics: Deeper cache tiers bring larger hit gains, but memory and storage costs must also be counted into per-token cost.
    • Evaluation methodology: Input/output length distributions and whether cache warm-up is counted can reverse conclusions.

    6. Summary

    The deployment methodology for large-scale MoE reduces to one sentence: use the two asymmetries to set resource boundaries, then use expert parallelism for capacity, stage disaggregation for workload interference, and multi-tier caching for repeated computation—and accept tail latency percentiles rather than averages as the sign-off criterion. In engineering such inference services, Baidu AI Cloud typically advances along three lines: containerized orchestration, elastic scaling, and full-link observability. Exact configurations still depend on measured data.