Abstract
MegaScale-Infer is a high-efficiency serving system designed for large-scale Mixture-of-Experts (MoE) models. By physically separating attention and expert modules onto different GPU nodes—a technique termed "disaggregated expert parallelism"—the system overcomes the fundamental memory-bandwidth bottlenecks that plague MoE inference. Through a novel ping-pong pipeline and a custom M2N communication library, MegaScale-Infer achieves up to 1.9x higher throughput than state-of-the-art solutions like vLLM and TensorRT-LLM, significantly reducing operational costs in production environments.
The Bottleneck of MoE Inference
Mixture-of-Experts (MoE) models have become the standard for scaling Large Language Models (LLMs), offering massive parameter counts with sub-linear increases in computation. However, serving these models efficiently during the decoding phase is challenging. Inference is typically bound by memory bandwidth, a problem exacerbated in MoE models by "sparsity."
In a standard MoE setup, a request batch is split among many experts, meaning each individual expert processes only a tiny fraction of the tokens. This leads to very small effective batch sizes for the Feed-Forward Network (FFN) experts, resulting in poor GPU utilization. Standard serving systems co-locate attention and FFN modules on the same GPU, forcing a "one-size-fits-all" parallelism strategy that fails to optimize either component.
Disaggregated Expert Parallelism
To address this "compute-memory mismatch," MegaScale-Infer introduces Disaggregated Expert Parallelism. The system breaks the monolithic model deployment into two distinct pools:
- Attention Nodes: These nodes house the attention modules and the KV cache. They are scaled via data replication to handle the high memory demands of the KV cache.
- Expert Nodes: These nodes house the FFN (expert) modules. They are scaled via expert parallelism, allowing the system to aggregate enough tokens from multiple attention replicas to make the experts compute-intensive.
To prevent GPUs from sitting idle during the transfer of data between these pools, MegaScale-Infer employs Ping-Pong Pipeline Parallelism. By partitioning request batches into micro-batches that "ping-pong" between attention and expert nodes, the system can overlap computation with communication, maximizing overall hardware efficiency.
High-Performance Communication and Deployment
A critical component of this disaggregated architecture is the communication backplane. Standard libraries like NCCL are optimized for collective operations but struggle with the many-to-many (M-to-N) patterns required here. MegaScale-Infer utilizes a custom M2N Library built on RDMA, which eliminates GPU-to-CPU data copies and reduces tail latency by 68.2% compared to NCCL.
Furthermore, the system uses a performance-model-based algorithm to automatically determine the optimal deployment plan, including the number of nodes and tensor parallelism degrees for any given hardware configuration. This flexibility allows for heterogeneous hardware deployment, where memory-optimized GPUs (like NVIDIA H20) can be used for attention nodes while compute-optimized GPUs (like L40S) handle the expert nodes.
Key Results and Production Impact
Evaluations across models like Mixtral 8x22B and DBRX show that MegaScale-Infer achieves 1.28x to 2.56x higher decoding throughput than vLLM and TensorRT-LLM. For massive 317B parameter models, the improvement reaches 7.11x.
In heterogeneous deployments, the system provides up to 3.24x higher throughput per unit cost. Currently deployed in ByteDance’s production environment, MegaScale-Infer has reportedly reduced serving costs by 1.5x to 2.0x, proving that disaggregation is a viable and highly efficient path forward for large-scale MoE serving.
Summary updated