LearnQuestion bank

Your team serves a large MoE reasoning model with long prompts and long outputs, and p95 inter-token latency spikes whenever big prompts arrive. Someone proposes disaggregating prefill and decode. When does that pay off, what does it cost, and how would you size it?

Applied LLMSystem designHard

Answer it yourself first, out loud or on paper, then compare.

Answer

Model answer, written in a candidate's voice

In short

  • Diagnosis: prefill is compute-bound and decode is bandwidth-bound; colocated long prefills stall decode batches, so ITL spikes; chunked prefill is the first, cheaper mitigation
  • Disaggregation runs prefill and decode on separate GPU pools with their own parallelism (e.g. wide expert parallelism for decode), then transfers each request’s KV cache over NVLink or RDMA (NIXL or similar)
  • Cost of the transfer: KV bytes per request = per-token KV x prompt length; compares this with link bandwidth and prefill time, and notes it pays off most for long prompts and strict ITL SLOs
  • Sizing: sets the prefill:decode GPU ratio from the measured input/output length distribution and SLOs, revisits it as traffic shifts (planner-style autoscaling), and uses KV-aware routing to keep prefix-cache hits
  • Operational risks: more moving parts, failure handling for in-flight transfers, and a worse fit for short prompts or small deployments

In full

The core point is that this is a latency-isolation problem, not a throughput problem: prefill is compute-bound while decode is bandwidth-bound, so when long prompts arrive in a colocated serving stack they hog the batch and decode ITL spikes. I would first try chunked prefill and admission control because they are cheaper and often fix most of the p95 problem. Disaggregation pays off when prompts are long, outputs are latency-sensitive, and the ITL SLO is strict enough that isolating decode from prefill is worth the extra machinery: prefill and decode run on separate pools with their own parallelism, such as wide expert parallelism for decode, and each request’s KV cache is moved over NVLink or RDMA with something like NIXL. The transfer cost is the key check: KV bytes per request equal per-token KV times prompt length, so I would compare that against link bandwidth and against the prefill time it saves, and expect the win to grow with prompt length and with how tight the ITL SLO is. Sizing should come from the measured input/output length distribution and the SLO, not from intuition: set the prefill:decode GPU ratio from that mix, revisit it as traffic shifts with planner-style autoscaling, and use KV-aware routing so requests that share prefixes still hit the cache. The honest caveats are operational: more moving parts, in-flight transfer failure handling, and a poor fit for short prompts or small deployments where chunked prefill and a single pool are simpler and good enough.

Checked against sources by an independent AI reviewer.

What a strong answer covers

  • Diagnosis: prefill is compute-bound and decode is bandwidth-bound; colocated, long prefills stall decode batches, so ITL spikes; chunked prefill is the first, cheaper mitigation
  • Disaggregation runs prefill and decode on separate GPU pools with their own parallelism (e.g. wide expert parallelism for decode), then transfers each request’s KV cache over NVLink or RDMA (NIXL or similar)
  • Cost of the transfer: KV bytes per request = per-token KV × prompt length; compares this with link bandwidth and prefill time, and notes it pays off most for long prompts and strict ITL SLOs
  • Sizing: sets the prefill:decode GPU ratio from the measured input/output length distribution and SLOs, revisits it as traffic shifts (planner-style autoscaling), and uses KV-aware routing to keep prefix-cache hits
  • Operational risks: more moving parts, failure handling for in-flight transfers, and a worse fit for short prompts or small deployments

Common mistakes

  • Claiming disaggregation reduces total compute rather than isolating interference
  • Ignoring the network cost of moving the KV cache

Follow-ups

  • LMSYS reported about 52k input and 22k output tokens per second per node for DeepSeek on 96 H100s with PD disaggregation and large-scale expert parallelism. What would you need to know before trusting a number like that for your workload?