FDEInterviews logo
OSDI 2024

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

Prefill is compute-bound and decode memory-bound, so sharing one GPU makes each slow the other. DistServe splits them onto separate GPUs and served up to 7.4× more requests within latency targets.

Breakdown by FDE Interviews · 12 min read · Updated

About the original · 2024
AUTHORS
Zhong, Liu, Chen, Hu, Zhu, Liu, Jin, Zhang
FROM
Peking University, StepFun, UC San Diego
PUBLISHED
Jan 2024 · OSDI 2024
CITED BY
1,102Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 24% of this breakdown.

01

The paper in one minute

Generating a response has two phases. Prefill processes the whole prompt at once and produces the first token; it is compute-heavy and determines time to first token (TTFT). Decode then produces one token per step; each step is light on compute but must read the model and KV cache, so it is memory-bound, and it determines time per output token (TPOT). Applications care about these differently: a chatbot wants a fast first token and a reading-speed stream; summarization cares more about how fast the rest of the text arrives.

Systems like vLLM run both phases on the same GPUs and batch them together to maximize total throughput. Yinmin Zhong, Hao Zhang and colleagues at Peking University, StepFun and UC San Diego show this hurts once latency targets matter. A long prefill added to a batch stalls every decoding request in it, raising TPOT; decoding work slows prefill, raising TTFT. Prioritizing one phase hurts the other. And both phases must use the same GPU count and parallelism, though they would prefer different ones.

The fix is to disaggregate: run prefill on some GPUs and decode on others, and send each request's KV cache from the prefill GPU to a decode GPU after the first token. Each phase can then be sized and parallelized for its own latency target, and several prefill instances can feed one decode instance so decode runs large, efficient batches. DistServe includes a search that, given the model, workload and both targets, picks the number of GPUs, parallelism and placement for each phase, using a simulator to estimate SLO attainment. It places paired prefill and decode stages on the same machine so KV transfers use fast NVLink.

The measure is goodput: the highest request rate per GPU at which 90% of requests meet both targets. In the paper's opening example, a 13B model on one A100 reached about 1.6 requests per second colocated, while two prefill GPUs and one decode GPU together served 10, or 3.3 per GPU. Across chatbot, code completion and summarization workloads, DistServe served up to 7.4× more requests, or held 12.6× tighter latency targets, than vLLM and DeepSpeed-MII.

THE IDEA, VISUALLY
PREFILL AND DECODE WANT DIFFERENT THINGS colocated: one GPU, both phases prefill prefill every prefill stalls all running decodes (higher time per token) disaggregated: separate GPUs prefill GPU(s) compute-bound, TTFT decode GPU(s) memory-bound, TPOT KV Each phase gets its own GPU count and parallelism, chosen by a search that simulates the workload against both SLOs. Placement keeps paired stages on one node, so KV moves over NVLink: under 0.1% of latency for OPT-175B. TTFT: time to first token (prefill) TPOT: time per output token (decode) GOODPUT: REQUESTS/S MEETING BOTH SLOs 13B on A100, input 512, output 64 (Figure 1) colocated GPU 1.6 req/s prefill-only GPU 5.6 req/s decode-only GPU 10.0 req/s 2 prefill + 1 decode, per GPU 3.3 req/s 2.1× more requests per GPU than colocated ACROSS WORKLOADS AND MODELS up to 7.4× more requests, or 12.6× tighter SLOs chatbot 2.0–4.6× vs vLLM; summarization 4.3× code completion 5.7×; all at 90% SLO attainment
The two phases of generation have different bottlenecks and different latency targets. Giving each its own GPUs removes the interference and lets each be sized for its own target.
Research notes: the problem, approach and results
7.4×

more requests served per GPU within both latency targets, compared to existing systems

1.6 → 3.3

requests per second per GPU, colocated vs disaggregated, 13B model on A100s

<0.1%

of total latency spent moving KV caches between GPUs for OPT-175B

THE PROBLEM

Serving systems batch prompt processing (prefill) and token generation (decode) together on the same GPUs. Long prefills stall everyone's decoding, and both phases are forced to share one parallelism setup, so meeting latency targets requires over-provisioning.

THE IDEA

Run prefill and decode on separate GPUs, transfer the KV cache between them, and search for the GPU counts, parallelism and placement that maximize requests per second per GPU within both latency targets.

THE RESULT

Up to 7.4× more requests or 12.6× tighter latency targets than vLLM and DeepSpeed-MII at 90% SLO attainment, with KV transfer under 0.1% of latency.

02

Why it matters to an FDE

When a customer self-hosts a model with real latency commitments, this paper changes how to plan capacity. Throughput alone is the wrong number to optimize.

Set two latency targets, not one. Time to first token and time per output token behave differently and trade off against each other under load. Ask the customer which matters for each use case: an assistant users watch type needs fast first tokens; a background summarizer can wait for the first token but should stream quickly.

Measure goodput, not throughput. Tokens per second across all users can look great while half the requests miss their latency target. Count requests per second per GPU that meet both targets for a set share of requests (the paper uses 90%).

Different workloads want different splits. Long prompts with short answers (summarization, RAG over large documents) are prefill-heavy; short prompts with long answers (writing, chat) are decode-heavy. The right ratio of prefill to decode capacity follows from the customer's actual length distribution.

Disaggregation is now mainstream. Several production serving stacks offer separate prefill and decode pools. When a customer outgrows a single pool, this is a standard next step, especially with strict latency commitments.

It needs fast interconnects. Moving KV caches is cheap only with high bandwidth, such as NVLink within a node or a fast cluster network. On commodity networking, plan placement carefully or the transfers eat the gains.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 49 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦3 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    Why the phases interfere, how to parallelize each, placement, and the misreadings to avoid

    Free account
  2. 04How it works

    The interference, the queueing analysis, the placement search and the runtime

    Premium
  3. 05The numbers that matter

    The opening example, the transfer budget, the ablations and what the comparisons assume

    Premium
  4. 06Try it yourself

    Simulate colocated and disaggregated serving and compute goodput per GPU under two latency targets

    Premium
  5. 07Where it breaks

    Where disaggregation does not pay, and what the system leaves out

    Premium
  6. 08Using it on a deployment

    Deciding whether to split prefill and decode for a customer, and how to size it

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →