DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving

Yinmin Zhong, Shengyu Liu, Junda Chen, Jianbo Hu, Yibo Zhu, Xuanzhe Liu, Xin Jin, Hao Zhang

Abstract

Large Language Model (LLM) serving is characterized by two distinct execution phases: the compute-intensive prefill phase and the memory-bandwidth-intensive decoding phase. Current serving systems colocate these phases on the same GPUs, leading to significant resource contention and suboptimal parallelism configurations. We introduce DistServe, a system that disaggregates prefill and decoding onto separate GPU instances. By isolating these phases, DistServe eliminates interference and allows for phase-specific parallelism optimization. Our evaluation demonstrates that DistServe improves the "goodput"—the rate of requests meeting strict latency deadlines—by 2.0x to 7.4x compared to state-of-the-art systems like vLLM and DeepSpeed-MII.

1. Introduction

As Large Language Models (LLMs) become central to real-time applications like interactive chatbots and coding assistants, the demand for efficient serving systems has intensified. These applications require strict adherence to Service Level Objectives (SLOs) defined by two metrics: Time to First Token (TTFT), which measures the latency of the initial response, and Time Per Output Token (TPOT), which measures the fluidity of subsequent generation.

Existing serving architectures typically colocate the two phases of LLM inference—prefill and decoding—on the same hardware. However, this approach creates fundamental bottlenecks that limit the scalability and responsiveness of LLM services. DistServe proposes a disaggregated architecture to overcome these limitations.

2. The Challenges of Colocated Serving

The prefill phase processes the entire input prompt to generate the first token, a task that is heavily compute-bound. In contrast, the decoding phase generates tokens one by one, a process that is memory-bandwidth-bound. Colocating these phases leads to two primary issues:

  1. Resource Interference: When a large prefill task enters a batch, it monopolizes GPU compute resources, causing significant delays for concurrent decoding tasks. This interference makes it difficult to maintain a consistent TPOT, leading to SLO violations.
  2. Resource Coupling: Prefill and decoding have different optimal parallelism strategies. Prefill tasks benefit from high intra-op parallelism to minimize execution time, while decoding tasks often achieve better efficiency with different configurations. Colocation forces both phases to share a single parallelism strategy, resulting in suboptimal performance for both.

3. DistServe: A Disaggregated Architecture

DistServe addresses these challenges by assigning prefill and decoding tasks to separate sets of GPUs, referred to as prefill instances and decoding instances.

3.1 Tailored Parallelism

By separating the phases, DistServe can optimize resource allocation for each. It might utilize extensive intra-op parallelism (splitting layers across GPUs) for prefill instances to meet aggressive TTFT targets, while employing inter-op parallelism (pipelining) for decoding instances to maximize overall throughput and maintain low TPOT.

3.2 KV Cache Coordination and Placement

A key challenge in disaggregation is the transfer of the Key-Value (KV) cache from the prefill instance to the decoding instance. DistServe implements smart placement algorithms designed for various cluster interconnects (e.g., NVLink or Infiniband) to minimize this overhead. Research indicates that with optimized placement, the KV cache transfer accounts for less than 0.1% of total latency, making disaggregation highly viable.

3.3 Goodput-Optimized Simulation

DistServe introduces a simulator that models FLOPs and memory access patterns to predict performance across different hardware configurations. This allows the system to automatically determine the optimal distribution of GPUs between prefill and decoding roles to maximize "goodput"—the number of requests per second that successfully meet their 90th or 99th percentile SLOs.

4. Evaluation

The researchers evaluated DistServe using models ranging from OPT-13B to OPT-175B across three realistic workloads:

  • ShareGPT: Simulating general chatbot interactions.
  • HumanEval: Simulating code completion tasks.
  • LongBench: Simulating long-context document summarization.

5. Key Results

DistServe demonstrates significant improvements over state-of-the-art systems like vLLM and DeepSpeed-MII:

  • Increased Capacity: DistServe serves 2.0x to 7.4x more requests per second while staying within latency constraints.
  • Stringent SLO Adherence: For a fixed request rate, DistServe can satisfy SLOs that are 1.8x to 12.6x more stringent than baseline colocated systems.
  • Robustness to Long Contexts: In summarization tasks (LongBench), DistServe's isolation of the prefill phase prevents the massive decoding slowdowns typically caused by long prompts in colocated environments.

6. Conclusion and Future Work

DistServe proves that disaggregating prefill and decoding phases is a superior approach for LLM serving, particularly under strict latency requirements. By eliminating interference and tailoring parallelism, it achieves massive gains in goodput. Future research will explore scaling this architecture for million-token context windows and developing advanced fault-tolerance mechanisms to prevent error propagation between disaggregated instances.

Summary updated

BibTeX
@inproceedings{zhong2024distserve,
  author = {Yinmin Zhong and Shengyu Liu and Junda Chen and Jianbo Hu and Yibo Zhu and Xuanzhe Liu and Xin Jin and Hao Zhang},
  title = {{DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving}},
  booktitle = {OSDI},
  year = {2024},
  url = {https://openreview.net/forum?id=sNifYctwnP},
}
Figure