Deployment Strategies and Parallelism for MoE Model Inference
MoE models introduce two key asymmetries—total vs. activated parameters, and Prefill vs. Decode workloads—that make their inference deployment fundamentally different from dense models. This article explains four core techniques (expert parallelism, Prefill/Decode disaggregation, multi-level caching, and KV cache compression), how to combine parallelism domains like DP, EP, TP, and PP, how to measure performance correctly, and the scheduling mechanisms that hold disaggregated architectures together. Use it as a practical framework for choosing a deployment topology based on model size, memory budget, and traffic patterns.
Deployment Strategies and Parallelism for MoE Model Inference
Why MoE Inference Deployment Is Different
For traditional dense models, cost scales linearly with parameter count. Mixture-of-Experts (MoE) models, however, introduce two critical asymmetries that force deployment designs to treat them differently:
- Total parameters vs. activated parameters. Take a well-known open-source MoE model as an example: it has hundreds of billions of total parameters, but each token activates only tens of billions of them. Compute cost follows the activated parameters, so inference compute demand stays manageable; but GPU memory must hold all expert weights, making memory pressure far greater than compute pressure. This tension is a major driver behind the adoption of Expert Parallelism (EP).
- Prefill vs. Decode workload asymmetry. Prefill processes all input tokens at once and is compute-intensive, determining Time to First Token (TTFT). Decode generates tokens one at a time, reading the full KV cache at every step, making it memory-bandwidth-intensive and determining Time Per Output Token (TPOT). These two workloads have very different hardware requirements, and running them together often causes interference.
Understanding these two asymmetries is the prerequisite for evaluating any MoE inference deployment.
Four Core Techniques: The Foundation of Any Deployment
2.1 Expert Parallelism (EP)
Expert parallelism shards expert weights across multiple GPUs, which:
- Spreads memory pressure: each GPU holds only a subset of expert weights, making very large models feasible;
- Scales up batch size in the expert dimension: tokens routed to the same expert are aggregated for computation, improving matrix arithmetic efficiency and amortizing weight-loading overhead.
The cost of EP is all-to-all communication. During token routing, tokens must be sent to the GPUs hosting their assigned experts and sent back after computation. EP effectiveness therefore depends heavily on interconnect bandwidth—it is typically best to keep EP within a single node using high-speed interconnects, and only expand across nodes when necessary.
2.2 Prefill/Decode Disaggregation (PD Disaggregation)
PD disaggregation runs the two workloads on separate instances (or even separate hardware pools):
- Prefill instances get higher compute capacity and larger concurrency to finish context encoding quickly;
- Decode instances get higher memory bandwidth and ample KV cache space to sustain generation throughput.
Once separated, each phase can have its own concurrency limits, batch size caps, and scheduling policies. This prevents Decode’s bandwidth bottleneck from being starved by Prefill’s large-batch compute, and prevents long-context Prefill from blocking short generation tasks. One caveat: the disaggregated architecture must transfer KV cache between instances, so network bandwidth and latency become new bottlenecks.
2.3 Multi-Level Caching
In chat, multi-turn retrieval, and long-document QA scenarios, many requests share repeated prefixes (system prompts, conversation history). Multi-level caching stores previously computed KV cache across tiers such as GPU memory and host memory, allowing repeated Prefill to be skipped and significantly reducing TTFT and compute consumption. Cache design hinges on hit rate, capacity allocation, eviction policy, and coordination with routing and load balancing.
2.4 Attention Structure and KV Cache Compression
Improvements to attention have a major impact on deployment topology. Compression techniques such as Multi-head Latent Attention (MLA) can shrink per-token KV cache from tens of kilobytes to the order of hundreds of bytes. This is not just a performance optimization—it directly changes the feasible deployment boundary: with a smaller KV cache, the same memory can serve more concurrent requests or longer contexts, and Decode instances face lower bandwidth pressure.
Combining Parallelism Domains: Choosing a Configuration for MoE
Real-world deployments combine multiple parallelism dimensions:
- DP (Data Parallelism): replicates the full model to handle different requests; good for throughput-oriented workloads, but every replica must hold all weights, so memory cost is high;
- EP (Expert Parallelism): shards weights by expert; a natural fit for MoE;
- TP (Tensor Parallelism): splits individual operators, reducing per-layer latency, but with heavy communication overhead—generally limited to high-speed interconnects within a node;
- PP (Pipeline Parallelism): splits by layer and can scale across nodes, but suffers from pipeline bubbles.
A practical decision process:
- First determine the minimum parallelism width dictated by total weight size and per-GPU memory;
- For MoE models, use EP to carry expert weights first, then add DP for throughput;
- If single-layer compute becomes the bottleneck, introduce TP within a node;
- When scaling across nodes, prefer PP or EP and avoid TP across nodes.
For example, a smaller model can run on a DP4 + EP level configuration, while a larger model—with higher per-replica memory requirements—often needs DP8 + EP or an even wider parallelism domain as its single-node baseline. The takeaway: model structure directly constrains the minimum deployment shape. You cannot discuss parallelism strategy in isolation from your memory budget.
Measuring Inference Performance: Don’t Trust a Single Metric
The throughput/latency trade-off depends on input length distribution, cache hit rate, speculative decoding configuration, batch scheduling, and more. When evaluating a deployment, track these together:
- TTFT and TPOT: corresponding to Prefill and Decode efficiency respectively;
- Normalized throughput (tokens/s/GPU): always normalize when comparing parallelism configurations—otherwise raw gains from adding GPUs are meaningless;
- Tail latency under different cache hit rates: cache hits can mask architectural problems, so benchmark cold-cache and warm-cache scenarios separately;
- Cost metrics: cost per million tokens in GPU-hours is what the business actually cares about.
Notably, in long-context scenarios, per-token FLOPs and KV cache size jointly determine the performance ceiling—both must be optimized, and neither can be ignored.
Scheduling: The Invisible Skeleton of Deployment
In disaggregated architectures, the scheduler carries key responsibilities:
- Request routing: assign requests to suitable Prefill/Decode instances based on load and cache hit likelihood;
- KV cache migration/reuse decisions: decide whether a prefix cache can be reused and whether cross-instance transfer is worthwhile;
- Concurrency and batch control: set separate concurrency limits per phase and dynamically adjust batch size to prevent OOM on Decode instances or idle Prefill instances;
- Elastic scaling: adjust the resource ratio between Prefill and Decode pools based on traffic (e.g., increase the Decode share during daytime interactive traffic peaks).
A simplified pseudocode sketch of the scheduling logic:
def route_request(req, prefill_pool, decode_pool):node = cache_lookup(req.prefix) # multi-level cache lookupif node:req.kv = node.kv # reuse existing KV cachereturn decode_pool.assign(req)inst = prefill_pool.pick(least_loaded=True)kv = inst.prefill(req) # compute and cachecache_put(req.prefix, kv)return decode_pool.assign(req, kv)
Cross-Platform and Engineering Realities
Inference deployment also faces several engineering constraints:
- Portability across heterogeneous platforms: differences in compute/bandwidth ratio and interconnect topology across accelerators mean the same parallelism configuration can behave very differently on different hardware—solutions should be parameterized, not hard-coded;
- Deterministic inference: batch size and kernel selection can change floating-point execution order; some workloads require deterministic output, forcing trade-offs at the scheduling layer;
- Benchmarking methodology: benchmarks must standardize input length distribution, concurrency model, sampling parameters such as temperature, and cache state—otherwise cross-system comparisons are meaningless.
Conclusion
MoE inference deployment is fundamentally a systems design exercise built around two asymmetries: use expert parallelism to resolve the memory contradiction of “it fits, but can’t be computed fast enough,” and use Prefill/Decode disaggregation to resolve the conflict between compute-bound and bandwidth-bound workloads. Multi-level caching and attention compression then reduce repeated computation and bandwidth pressure. When choosing a configuration, start from weight size and per-GPU memory to determine the minimum parallelism domain, combine DP/EP/TP/PP according to traffic patterns, set the resource ratio between the two phases, and evaluate results with joint TTFT, TPOT, and normalized throughput metrics. Once you understand these general principles, you can quickly derive a sound deployment architecture regardless of how the underlying hardware changes.
