← Back to blog

P/D Disaggregation: Splitting Prefill and Decode for LLM Serving

November 21, 2026
P/D Disaggregation: Splitting Prefill and Decode for LLM Serving

P/D disaggregation (also written PD or prefill-decode disaggregation) is a serving design that runs the two phases of LLM inference, prefill and decode, on separate GPU pools instead of the same machines. Each pool is then sized, parallelized and scaled for the one job it does. For an infrastructure team, the design question is not whether the idea is clever. It is whether your traffic, your model and your network justify two pools, and how many GPUs each one needs. That is a design and sourcing problem as much as a software one, and it is the kind of project we plan with clients at Dormedia, from configuration through delivery.

Dormedia
Plan LLM Infrastructure Around Your Workload
Dormedia helps organizations design, source, deploy and scale tailored HPC and AI infrastructure for their requirements.
Visit

TL;DR

  • Prefill reads the whole prompt in one pass and is compute-bound. Decode produces one token at a time and is memory-bandwidth-bound. P/D disaggregation gives each phase its own hardware.
  • The main gain is the end of interference: in a shared pool, new prefills stall running decodes, which hurts per-token latency.
  • The cost is moving the KV cache between pools, which needs fast networking, ideally RDMA, plus a router that coordinates both pools.
  • It pays off most with long prompts, larger models and sustained load. At low concurrency a single aggregated pool is often simpler and just as fast.
  • Pool ratios come from your own prompt and output lengths, so measure your traffic before you buy hardware.

Table of Contents

What prefill and decode are

Every LLM request goes through two stages.

Prefill processes the entire input prompt in a single forward pass. It produces the first output token and builds the KV cache, the stored attention keys and values for every prompt token. It happens once per request and it is compute-bound: large matrix multiplications that keep the GPU's arithmetic units busy. Its latency depends on prompt length and batch size, and it is what drives time to first token (TTFT).

Decode then generates the rest of the answer one token at a time, reading the KV cache and model weights at every step. It is memory-bandwidth-bound, and it dominates the total time a user waits for a long answer. Its metric is time per output token (TPOT), also called inter-token latency.

The NVIDIA Dynamo documentation describes the disaggregated flow in these terms: a prefill engine computes the prefill and the KV cache, transfers it to a decode engine, and the decode engine computes the rest. Because the two phases are limited by different things, one practitioner write-up puts it as two workloads rather than two settings of one. It also notes that a benchmark reporting only tokens per second hides the trade being made, so you should look at TTFT and TPOT separately.

Prefill, KV cache transfer, and decode flow

If you also see the term "disaggregation models" in search results, it usually refers to this same idea applied to serving: splitting a model's inference pipeline into specialized components. P/D is the most widely deployed form.

Why mixing them in one pool hurts

Most serving stacks use continuous batching, which interleaves many requests on the same GPUs. The catch is that when a new request arrives, its prefill needs the same compute resources as the decodes already running, so those decodes pause.

The AWS Neuron documentation quantifies it: in a batch-size-8 workload each request is interrupted an average of 7 times, while in a disaggregated setup each request is affected by a single asynchronous KV transfer. Users feel this as stuttering streams and unpredictable latency.

Perplexity's engineers described the same thing in production. In a mixed deployment of DeepSeek R1, prefill interruptions of hundreds of milliseconds kept the system from consistently exceeding 50 tokens per second per user. After separating prefill, a single prefiller node kept consistent batch sizes on three decoder nodes, and the system delivered over 90 tokens per second at about 1 query per second per decoder node.

The academic origin of the idea is the DistServe paper, which argues that colocating the phases causes strong interference and also couples the resource allocation and parallelism plans of both phases. Disaggregation fixes both problems at once.

Why mixing them in one pool hurts

How a disaggregated deployment works

The moving parts are simple to list and harder to run well.

  1. A prefill pool of GPUs that only process prompts and build KV caches.
  2. A decode pool of GPUs that only generate tokens.
  3. A router that sends each request to a prefill instance, then to a decode instance, and coordinates the hand-off. According to AMD's ROCm Infera documentation, in a 1P2D layout (one prefill worker feeding two decode workers) the router detects a valid prefill and decode pair and coordinates the KV transfer.
  4. A KV transfer path between the pools. The llm-d project documentation says this typically runs over RDMA (remote direct memory access, which moves data between machines' memory without involving the CPU). Without RDMA the NIXL transfer library falls back to TCP, which that documentation describes as suitable only for testing.

The transfer sounds like it should be expensive, but with the right network it is small. The Mooncake team's SGLang benchmark used 16 NVIDIA H20-3e GPUs with four 400GbE ConnectX-7 links per node over RoCE v2. A 12.62 GB KV cache for a 32,768-token prompt moved in 76.78 ms at 164.3 GB/s, 82.2% of line rate and only 2.4% of total TTFT.

The network is therefore part of the architecture. It is a purchasing decision made on day one, not something to retrofit after the GPUs arrive.

Speculative decoding is a separate technique that also attacks decode latency, and the two are often discussed together. This walkthrough of speculative decoding for LLM inference is useful context for how decode-side optimizations fit around a disaggregated design.

What you gain

Better decode latency under load. In the Mooncake benchmark on two A10 servers, a 1P1D disaggregated configuration reached roughly 30% lower inter-token latency than two regular instances, with comparable total throughput (mean ITL of 7.23 ms versus 10.30 ms in the reported table).

Independent tuning. The llm-d documentation notes that decode, being memory-bound, can use a larger tensor parallelism (TP) degree, while compute-bound prefill can use a smaller one with more replicas. You are no longer forced into one parallelism plan that is wrong for half the work. It also helps long-context requests avoid interfering with everyone else.

More predictable latency. Perplexity's engineers report that tying one prefiller to several decoders makes decode latencies far more deterministic, because decode batches stay steady.

Goodput. DistServe frames the target as goodput: requests per second that meet both TTFT and TPOT targets, not raw throughput. Splitting the phases lets you meet both targets with a deliberate allocation of GPUs.

What it costs, and how to plan for it

A disaggregated design adds components, and you plan for each of them:

  • Dedicated prefill GPUs. Per the NVIDIA Dynamo documentation, moving prefill to dedicated workers can improve decode latency, but those GPUs hold a pool whose KV cache is not used during decode.
  • Transfer time in TTFT. Perplexity measured about a 100 ms TTFT penalty per request after separating prefill, and notes KV transfer over the network can take tens to hundreds of milliseconds. Fast fabrics bring it down, as the Mooncake result above shows.
  • Load dependence. A University of Illinois study, Revisiting Disaggregated LLM Serving for Performance and Energy Implications, reports that the gains depend on request load and the KV transfer medium. It also finds that frequency scaling per stage does not produce energy savings, since disaggregated serving has higher energy use. Include power and cooling in your capacity model.
  • Feature compatibility. The AWS Neuron documentation notes that automatic prefix caching is not supported with its disaggregated inference, so check that your serving features work in the split design.

The practical reading is that the architecture rewards sustained, well-characterized load. NVIDIA's guidance is that at low concurrency an aggregated worker often avoids transfer and pool-fragmentation overhead, while under sustained contention separate pools improve latency isolation. It also warns that when decode KV capacity is the bottleneck, adding prefill replicas can reduce total serving capacity unless the latency benefit compensates. Capacity planning has to cover both pools together.

When P/D disaggregation is worth it

The llm-d documentation recommends exploring it for three situations:

  • Medium to large models, for example gpt-oss-120b.
  • Longer inputs, such as 10k input tokens and 1k output tokens rather than 200 and 200.
  • Sparse mixture-of-experts models that can use wide expert parallelism.

An academic analysis, Beyond the Buzz: A Pragmatic Take on Inference Disaggregation, reaches a similar conclusion: disaggregation is most effective for prefill-heavy traffic and larger models, and dynamic rate matching and elastic scaling are what keep performance on the best trade-off curve.

A quick screen:

Your situationLikely fit
Long prompts (RAG, document analysis, code context) and a large modelStrong candidate
Sustained high concurrency with strict per-token latency targetsStrong candidate
Short chat prompts, small model, low trafficAggregated pool is usually simpler
No RDMA-class fabric between nodesFix the network first
Agent workloads with very long generationsCandidate, with a decode-heavy ratio

Sizing the prefill and decode pools

The core question is how many GPUs go to each side. A pool-sizing rule of thumb published on Prompt20 divides average prompt length over prefill throughput by average output length over decode throughput. For a typical chat workload (about 1,000 prompt tokens and 200 output tokens) it works out to roughly one prefill GPU per four to eight decode GPUs. Long-context RAG shifts toward more prefill, and agent workloads with long generations shift toward more decode.

The llm-d documentation gives a concrete example of heterogeneous layouts: for gpt-oss-120b with 5k input and 250 output tokens, 8 prefill pods at TP=1 plus 2 decode pods at TP=4, 16 GPUs in total. Treat that as a starting point to tune, not a template. The same documentation advises tuning the xPyD ratio (x prefill workers to y decode workers) for your own workload.

To size honestly you need:

  1. The distribution of prompt and output lengths from production logs, not averages alone.
  2. Your TTFT and TPOT targets.
  3. Measured prefill and decode throughput of your model on your GPU type.
  4. Peak and sustained request rates.
  5. The KV cache size per request at your longest context, which sets the transfer volume and decode memory needs.

If you want the wider context for these numbers, our guide to designing, sizing and running AI inference infrastructure covers the capacity questions around the serving layer.

Hardware and network checklist

Before committing to a disaggregated build, settle these items:

  • Interconnect: RDMA-capable networking between prefill and decode nodes, with bandwidth sized to your KV transfer volume.
  • GPU memory and bandwidth for decode: decode nodes are limited by memory bandwidth and KV capacity.
  • Compute density for prefill: prefill nodes benefit from raw compute.
  • Orchestration: a router and scheduler that can scale the pools independently, such as the open-source stacks the documentation above describes.
  • Power and cooling: extra GPU capacity and the energy findings above affect facility planning.
  • Delivery timeline: GPU servers and high-speed networking have lead times, and global shipping, tax and tariff handling can decide when the cluster actually goes live.

How we help

We design, source, deploy and scale HPC and AI infrastructure. For a team weighing P/D disaggregation, that covers customized server and component configurations, data center solutions, global shipping, tax and tariff handling, project management and ongoing support. Our work draws on experience since 2011, a focus on HPC and AI since 2017, and a network of vendors and logistics specialists. You can browse available hardware or look at the full list of services on our site.

Dormedia

If you are scoping a prefill and decode build, send us your model, target latencies and traffic profile, and we will help turn them into a configuration and a delivery plan.

Perspective

Most of the debate about P/D disaggregation is about software. In our projects the harder part is usually the physical side: getting the right GPUs, the right fabric and the right power and cooling in place, in the right country, on schedule.

Disaggregation turns one pool into two, so mistakes multiply. A decode node with the wrong memory profile, or a network that cannot carry the KV cache at line rate, undoes the benefit the architecture was meant to deliver. That is why we start from the workload and work backward to the bill of materials, and why we treat sourcing, shipping and tariffs as part of the design rather than an afterthought.

Our view is that the best first step is a clear picture of your traffic and latency targets, followed by a configuration built for them, with one team accountable from sourcing to delivery and support.

Dormedia

FAQ

What does P/D disaggregation mean?

It means running the prefill phase (processing the prompt) and the decode phase (generating tokens) on different GPU pools. A prefill worker builds the KV cache and hands it to a decode worker. Each pool can then be scaled and tuned for its own bottleneck.

Does disaggregation always improve performance?

No. The gains depend on request load, prompt length, model size and the network carrying the KV cache. Under sustained load with long prompts it can improve latency isolation and goodput, while at low concurrency a single pool often performs well with less overhead.

What network do I need between prefill and decode nodes?

An RDMA-capable fabric is the typical choice. In the Mooncake benchmark, four 400GbE RoCE v2 links per node moved a 12.62 GB KV cache in 76.78 ms. TCP fallback is suitable only for testing.

How many prefill GPUs per decode GPU?

It depends on prompt and output lengths and measured throughput. One published rule of thumb gives about one prefill GPU per four to eight decode GPUs for typical chat traffic, with more prefill for long-context RAG and more decode for long generations. Validate the ratio with your own traffic.

Sources