Large-Scale Sparse MoE Model Inference: Deployment and Parallelization Strategies
This article examines how to deploy and optimize inference for very large, sparsely activated MoE models. It analyzes two asymmetries—total versus activated parameters, and the different bottlenecks of prefill and decode—then discusses expert parallelism, prefill/decode disaggregation, and multilevel KV caching. It also covers attention compression, parallel-domain sizing, scheduling, performance evaluation, and deployment guidance for small-scale, production, long-context, and cloud environments.
1. Background: Two Asymmetries That Shape the Cost Structure
Very large sparsely activated models—such as mixture-of-experts (MoE) architectures with total parameter counts in the hundreds of billions and only a small fraction activated per token—face two fundamental asymmetric constraints in inference system design.
1. Asymmetry between total parameters and activated parameters. In a typical sparse MoE architecture, the total parameter count can be on the order of 671B, while only about 37B parameters participate in computation for each token. This means that compute cost, measured in FLOPs, is based on activated parameters and remains manageable. GPU memory, however, must hold the weights of all experts, because the router cannot know in advance which experts a future token will select. This asymmetry directly determines the lower bound of deployment: even when compute pressure is modest, the weight footprint of a single replica remains enormous, so expert weights must be partitioned across multiple GPUs through parallelism.
2. Asymmetry in phase workload. Inference consists of two phases with very different workload characteristics:
- Prefill: Processes all input tokens at once. Tokens can be parallelized extensively, making this phase compute-bound. Its main bottleneck is compute, and it directly determines time to first token (TTFT).
- Decode: Generates tokens autoregressively one at a time. Each step must read the full KV cache, making this phase memory-bandwidth-bound. Its main bottleneck is memory access, and it directly determines time per output token (TPOT).
The two phases are bottlenecked by different resources, require different optimal batch sizes, and need different scheduling policies. Co-locating them on the same GPU pool causes interference. This observation is the starting point for the architectural evolution of modern inference systems.
2. Three Core Technology Categories
To address these workload characteristics, mainstream inference systems generally combine three categories of techniques.
2.1 Expert Parallelism (EP)
The core idea of expert parallelism is to distribute the expert weights in MoE layers across different GPUs. Tokens are routed through All-to-All communication to the nodes holding the corresponding experts for computation. EP provides benefits at two levels:
- Memory sharing: The GPU memory pressure of expert weights is split across multiple devices, making single-replica deployment of very large models feasible.
- Batch amplification: If all experts are deployed independently on a single GPU, the number of tokens routed to each expert is sparse, resulting in small per-expert batches and low GPU utilization. EP aggregates global requests before routing, which effectively increases the batch size seen by each expert and significantly improves compute efficiency.
Note that the wider the EP domain, the greater the All-to-All communication overhead, and the higher the requirements on cluster network bandwidth and topology. The minimum parallelism domain must therefore be chosen by weighing weight size, GPU memory capacity, and interconnect bandwidth.
2.2 Prefill/Decode Disaggregated Deployment
This approach deploys the two phases on separate GPU instances and tunes each independently:
- Prefill instances can be configured with larger input batches to pursue compute saturation and protect TTFT.
- Decode instances can be configured with more concurrent sessions to pursue bandwidth utilization and sustained token throughput, protecting TPOT.
The two phases are connected through KV cache transfer. The cost of the disaggregated architecture is KV cache migration overhead and increased cluster management complexity, so it is suitable for large-scale production scenarios. For small-scale deployments, hybrid approaches such as chunked scheduling can also be used as a trade-off.
2.3 Multilevel Caching
In conversational and agent applications, many requests share common prefixes, such as system prompts, tool definitions, and historical context. Multilevel caching mechanisms reuse computed KV caches hierarchically:
- Instance-local cache: Requests that hit a prefix on the same instance can reuse the KV cache directly and skip repeated prefill.
- Cross-instance cache: Through routing affinity or a centralized cache layer, requests with similar prefixes are scheduled to instances that already hold the corresponding KV cache.
- Cross-session cache: Very long common prefixes are persisted so that they can still be hit after service restarts or scaling events.
The higher the cache hit rate, the more repeated prefill computation is saved. This is a key lever for improving effective throughput.
3. Key Dimensions of Generational Evolution
When comparing successive generations of inference systems, differences are concentrated mainly in three dimensions.
1. Attention compression ratio. With compression mechanisms such as multi-head latent attention (MLA), KV cache occupancy can be reduced from roughly 70 KB per token to close to 1 KB per token. A smaller KV cache lowers memory-access pressure during decode and allows a single GPU to carry more concurrent sessions. In 1M-token ultra-long-context scenarios, together with mechanisms such as sparse attention, new-generation architectures can reduce per-token compute and KV cache occupancy to a few tens of percent of the previous generation or lower.
2. Parallelism domain width. Model weight size and per-replica GPU memory requirements directly limit the minimum parallelism domain. For example, for a model with about 700 GB of total weights, a single-machine 8-GPU configuration—8-way data parallelism combined with expert parallelism—is a typical choice. A Flash variant that has been quantized and structurally streamlined may require less GPU memory per replica; it can then use a narrower parallelism domain, such as 4 GPUs, and deploy efficiently on medium-sized clusters.
3. Cache hierarchy and scheduling mechanisms. From a single level of instance-local caching to multilevel cross-instance caching, together with prefix-aware routing, priority scheduling, speculative decoding, and other mechanisms, these choices jointly determine actual performance under different workload patterns.
A typical deployment reference configuration can be abstracted as follows:
deployment:mode: prefill-decode-disaggregatedprefill:replicas: 4max_batch_tokens: 32768 # favor compute saturationdecode:replicas: 8max_concurrent_seqs: 256 # favor bandwidth utilizationparallel:expert_parallel_size: 8data_parallel_size: 2cache:L1: instance-kv-cacheL2: cross-instance-prefix-cachequantization: per-block-fp8
4. Evaluating Performance Correctly
There is no universal metric for the relationship between throughput and latency. It depends on hardware specifications, input and output length distributions, cache hit rate, and whether speculative decoding is enabled. A sound evaluation should cover at least:
- TTFT and TPOT percentiles such as P50 and P99 under both fixed-length and variable-length inputs;
- Throughput curves at different concurrency levels, identifying the inflection point rather than looking only at the peak;
- The contribution of cache hit rate to effective throughput.
In addition, cross-system comparisons must account for limitations such as portability across heterogeneous platforms, numerical determinism (batch composition can affect floating-point summation order), cache economics (the trade-off between GPU memory consumed by cache and the benefit of cache hits), and whether evaluation methodologies are consistent.
5. Selection Guidance
- Small-scale validation: Prioritize model variants with low per-replica GPU memory requirements and good quantization compatibility, and avoid the operational burden of excessively wide parallelism domains.
- Scaled production: Adopt prefill/decode disaggregation together with prefix-aware routing and multilevel caching, with a focus on optimizing cache hit rate.
- Long-context workloads: Treat KV compression ratio and caching strategy as primary evaluation criteria. At 1M-token contexts, differences in KV cache occupancy can reach an order of magnitude.
- Cloud deployment: Use general cloud platform capabilities—container services, high-performance networking, object storage, and monitoring and alerting—to build elastic inference clusters, and adjust the ratio of prefill to decode instances according to workload peaks and troughs.
In summary, deploying large sparse MoE models is essentially a matter of balancing four constraints: GPU memory capacity, interconnect bandwidth, compute, and cache economics. Understanding the sources of the two asymmetries and using them to choose expert parallelism width, phase-disaggregation strategy, and cache hierarchy is a general methodology for building efficient inference systems.
