MuxServe: Flexible Spatial-Temporal Multiplexing for Multiple LLM Serving

Jiangfei Duan, Runyu Lu, Haojie Duanmu, Xiuhong Li, Xingcheng Zhang, Dahua Lin, Ion Stoica, Hao Zhang

TL;DR

MuxServe is a novel system designed to serve multiple Large Language Models (LLMs) simultaneously on a shared pool of GPUs. By intelligently colocating models based on their popularity and separating the compute-heavy "prefill" phase from the lighter "decoding" phase, MuxServe achieves up to 1.8× higher throughput and handles nearly 3× more requests while maintaining strict response-time targets.

What Problem Does This Paper Address?

Serving LLMs is incredibly expensive. A single 175B parameter model can require eight high-end A100 GPUs just to run. Most providers don't just serve one model; they serve dozens of versions and sizes to cater to different user needs.

The challenge lies in two areas:

  1. Varying Popularity: Some models are "superstars" with constant traffic, while others are "long-tail" models with sporadic requests. Traditional spatial partitioning (assigning specific GPUs to specific models) leaves GPUs idle when unpopular models aren't being used.
  2. Inference Characteristics: LLM inference has two distinct phases. The prefill phase (processing the input prompt) is compute-intensive and uses the GPU heavily. The incremental decoding phase (generating tokens one by one) is memory-bound and often leaves the GPU's compute cores (SMs) significantly underutilized.

Existing systems either waste resources through idle time (spatial partitioning) or fail to exploit the "slack" during the decoding phase (temporal multiplexing).

Comparison of multiplexing strategies

Methods

MuxServe introduces Flexible Spatial-Temporal Multiplexing. Instead of choosing between sharing space or sharing time, it does both.

  • Phase Separation: MuxServe treats prefill and decoding as separate jobs. This allows it to "sandwich" decoding tasks from one model into the compute gaps left by another model's prefill tasks.
  • Placement Algorithm: The system uses a greedy algorithm to decide which models should live together on which GPUs. It prioritizes placing high-demand models first and then fills the remaining "resource slack" with less popular models.
  • Adaptive Batch Scheduling (ADBS): This scheduler prioritizes prefill jobs to ensure low latency for new requests but uses any leftover GPU capacity to run decoding jobs concurrently.
  • Unified Resource Manager: To make this work, MuxServe manages GPU resources at a granular level. It uses NVIDIA's Multi-Process Service (MPS) to partition compute units and implements a Unified KV Cache. This cache allows models to share a single memory pool, dynamically reallocating memory blocks between models as their workloads shift.

Datasets

The authors evaluated MuxServe using:

  • ShareGPT: A dataset of real user prompts used to generate synthetic workloads with varying arrival rates.
  • ChatLMSYS Trace: Real-world traffic data from a popular LLM hosting platform to test the system under authentic, bursty conditions.
  • LLaMA Models: A variety of model sizes (7B to 70B parameters) were used to demonstrate the system's flexibility across different scales.

Key Insights and Ideas

  • Decoding is the "Slack" Opportunity: The "aha moment" is realizing that the dominant decoding phase is so compute-light that you can run multiple decoding batches—or even a decoding batch alongside a prefill batch—without a massive performance penalty.
  • Popularity-Aware Colocation: By pairing a "hot" model with several "cold" models, MuxServe can keep GPU utilization high. The cold models "borrow" the memory and compute that the hot model isn't using at that exact millisecond.
  • Memory Fragmentation is the Enemy: Serving multiple models on one GPU usually leads to memory fragmentation. MuxServe’s "head-wise" unified cache treats memory like a flexible pool, preventing one model from "squatting" on memory it doesn't currently need.

Key Results

MuxServe significantly outperforms traditional serving methods across various scenarios:

  • Throughput: It achieves up to 1.8× higher aggregated throughput compared to state-of-the-art spatial partitioning.
  • SLO Attainment: For a 99% Service Level Objective (SLO), MuxServe can process up to 2.9× more requests. This means it stays fast even as the load increases.
  • Efficiency: MuxServe consistently maintains higher SLO attainment across different request rates compared to temporal or spatial baselines.
Throughput and SLO attainment results

Limitations and Future Work

While MuxServe is a major step forward, the authors note a few areas for growth:

  • Interference: Even with fine-grained partitioning, colocating jobs causes some hardware-level interference (e.g., cache contention), which can slightly increase latency at very small scales.
  • Workload Prediction: The placement algorithm works best when it has a good estimate of future traffic. While the authors use historical data, sudden, unpredictable viral spikes in a specific model's popularity could require more dynamic re-placement.
  • Heterogeneous Hardware: The current study focuses on clusters of identical GPUs (A100s). Future work could explore how to multiplex models across a mix of different GPU generations.

Summary updated

BibTeX
@inproceedings{duan2024muxserve,
  author = {Jiangfei Duan and Runyu Lu and Haojie Duanmu and Xiuhong Li and Xingcheng ZHANG and Dahua Lin and Ion Stoica and Hao Zhang},
  title = {{MuxServe: Flexible Spatial-Temporal Multiplexing for Multiple LLM Serving}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=R0SoZvqXyQ},
}
Figure