Deploying Sparse Large Models: Parallelism Strategies for Compute, Memory, and Bandwidth
This article breaks down the structural asymmetries that make sparse mixture-of-experts (MoE) models hard to deploy in production: the gap between total and activated parameters, and the opposite hardware demands of prefill and decode. It then explains three core techniques—expert parallelism, prefill/decode disaggregation, and multi-level KV caching—along with how KV compression shifts minimum parallel-domain width across generations. Practical guidance on capacity planning, paired metrics, and observability is included.
1. Where the Problem Starts: Two Structural Asymmetries in Sparse LLMs
Once very large sparse (mixture-of-experts) models reach production, the hard part is not whether they run at all. It is the mismatch between compute, memory, and bandwidth. Understanding the two asymmetries below is the prerequisite for designing any parallelism plan.
1.1 Total Parameters vs. Activated Parameters
Take a common sparse design with 671B total parameters and roughly 37B activated per token. FLOPs are driven mainly by the activated parameters, but memory must hold every expert’s weights. Three consequences follow directly:
- The compute budget and the memory budget are decoupled, so scaling usually hits the memory wall first, not the compute wall.
- A single device cannot hold the full weight set, so weights must be sharded, and the sharding scheme determines communication volume.
- Expert routing is data-dependent and the load is inherently skewed, so static sharding is hard to balance.
In practice, teams size the system in this order: use memory capacity to determine the minimum parallel domain, then use the throughput target to determine the number of replicas. Peak compute is not the starting point.
1.2 Prefill vs. Decode: Asymmetric Workloads
- Prefill: processes all input tokens at once, with large matrices and high arithmetic intensity. It is compute-bound and determines time to first token (TTFT).
- Decode: generates tokens autoregressively one at a time, reading the full KV cache and weights at every step. Arithmetic intensity is low, so it is memory-bandwidth-bound and determines time per output token (TPOT).
The two workloads want almost opposite things from the hardware. Mixing them in one instance makes them compete for resources: a long-prompt prefill pushes up the TPOT of requests that are already decoding, while the low compute utilization during decode leaves expensive compute idle.
2. Three Key Techniques and Design Points
2.1 Expert Parallelism: Spread Weights, Enlarge Batches
Expert parallelism (EP) places different experts on different devices. It spreads weight memory and also aggregates tokens routed to the same expert into larger batches, which improves matmul efficiency. Implementation points:
- The communication pattern is an all-to-all dispatch before routing plus an all-to-all reduction after compute. It is sensitive to interconnect bandwidth and must be orchestrated together with data parallelism and tensor parallelism.
- A capacity factor and a drop policy are needed to avoid overloading hot experts while cold experts sit idle.
- Expert grouping and routing strategy should align with the parallel topology to reduce cross-node hops.
Illustrative configuration (pseudocode, expressing orchestration relationships only):
# dp: data parallel degree, ep: expert parallel degree, tp: tensor parallel degreeparallel = ParallelPlan(dp=8, ep=8, tp=1)# one replica must hold all expert weights; parallel domain width is derived from per-device memorymin_world_size = ceil(total_weight_bytes / usable_hbm_per_device)assert parallel.world_size >= min_world_size
2.2 Prefill/Decode Disaggregation: Isolate the Two Workloads
Stage disaggregation (PD disaggregation) deploys the two stages onto separate resource pools: the prefill pool is optimized for compute and long sequences, the decode pool for memory capacity and bandwidth, with the KV cache handed off in between. After splitting, concurrency and batch limits must be set separately for each side:
- Prefill side: cap the total tokens per batch (not the number of requests), and use chunked prefill so a long prompt cannot monopolize the batch.
- Decode side: derive maximum concurrency from the memory capacity constraint, and treat KV cache occupancy as a first-class scheduling metric.
- The two sides scale on different rhythms and must elastically scale independently against their own bottleneck metrics.
2.3 Multi-Level Caching: Cut Repeated Prefill
Prefix reuse is the key lever for cost reduction in long-context scenarios. Multi-level caching (device memory → host memory → remote cache/object storage) keeps the KV of shared prefixes, and a hit skips the repeated computation. Hit rate depends on how much prefixes overlap in the workload, cache capacity, and the eviction policy. Cache economics must account for hit savings together with storage and transfer costs, not hit rate alone.
3. Cross-Generation Evolution: Structural Compression and Parallel Domain Width
The main line of cross-generation optimization is the coordination of attention compression and parallel orchestration. Using publicly reported magnitudes as a reference: KV cache drops from about 70 KB/token under a multi-head latent attention (MLA) scheme to about 890 B/token in the newer generation. At a 1M context, the newer flagship configuration uses roughly 27% of the previous generation’s per-token FLOPs and about 10% of its KV cache.
Parallel domain width is determined by weight size and the memory needed per replica: the flagship tier typically pairs 8-way data parallelism within a single node with expert parallelism, while the lightweight tier can pair 4-way data parallelism with expert parallelism under the same memory conditions. The pattern is clear—the larger the weights, the wider the minimum parallel domain, the higher the share of communication completed inside a single node, and the fewer cross-node all-to-alls.
4. Practical Recommendations and Evaluation Criteria
- Capacity planning: size memory from weights and KV cache first, then set the parallel domain and replica count, and finally verify that the interconnect can sustain all-to-all.
- Use metrics in pairs: TTFT and TPOT must be constrained together, alongside throughput (tokens/s) and effective concurrency, so optimizing one metric does not degrade the other.
- Evaluate caching and speculative decoding together: the acceptance rate of speculative decoding, the input length distribution, and the cache hit rate all change the optimal batch size, so determine it with load tests rather than rules of thumb.
- Portability and determinism: operator support on heterogeneous platforms and numerical differences from reduction order affect reproducibility, so state them explicitly in acceptance criteria.
- Observability: connect queueing latency, batch size, cache hits, and expert load skew across monitoring, alerting, and logging services to close the tuning loop.
In short, deployment efficiency for sparse LLMs comes from the coordination of model structure and system implementation: the structure side compresses KV and activated size, while the system side uses expert parallelism, stage disaggregation, and multi-level caching to place each workload on the most suitable resources. When comparing across systems, unify the evaluation criteria and disclose hardware, input length, and cache conditions, otherwise the conclusions will not be reproducible.
