PD Disaggregation and Heterogeneous Mixed Inference: Engineering Practices for Rebuilding LLM Inference Costs
This article explains why LLM inference costs are shifting from accelerator availability to utilization efficiency, then presents Prefill-Decode (PD) disaggregation with heterogeneous mixed inference as an engineering approach. It contrasts the compute-intensive Prefill stage with the memory-bandwidth-intensive Decode stage, describes separate resource pools and KV Cache transfer, and covers routing, batching, capacity planning, observability, applicability boundaries, common pitfalls, and a deployment checklist. Readers get a practical framework for evaluating PD disaggregation and measuring results with unit token cost.
1. The Constraint Has Shifted: From Card Availability to Utilization Efficiency
Over the past few years, general-purpose compute chips have moved from unavailable to widely available, and the supply side now offers noticeably more options. The real pressure, however, comes from demand: conversational applications, coding assistants, document understanding, and multimodal question answering have increased inference request volume by an order of magnitude. Meanwhile, single-card memory capacity and memory bandwidth are improving much more slowly than model sizes are expanding.
As a result, the industry focus has shifted. The question is no longer whether you can obtain accelerator cards, but whether you can use a structurally mixed card pool cost-effectively. When the unit cost of heterogeneous compute keeps falling while scheduling and parallelization strategies remain stuck on homogeneous card-stacking assumptions, a large amount of effective throughput is wasted. If heterogeneous solutions match or exceed homogeneous solutions on cost-performance, the entire deployment landscape will be rewritten.
2. One Inference Request Is Actually Two Opposite Jobs
From the outside, inference looks like a question and an answer. Internally, it is a sequence of two stages with completely opposite resource profiles.
Prefill: The model reads the entire input at once and produces the KV Cache. This step is highly parallel in computation, dominated by large-scale matrix multiplication, and is compute-intensive. It consumes peak compute, takes longer as sequences grow, and directly determines time to first token (TTFT).
Decode: The model generates the answer token by token. The computation per generated token is small, but all model weights and the accumulated KV Cache must be read from memory again for each token, making this stage memory-bandwidth-intensive. It consumes memory bandwidth and memory capacity, and directly determines time per output token (TPOT) and the smoothness of streaming output.
One stage lacks compute; the other lacks bandwidth. Their optimization directions are opposite. Putting both into the same batch of cards makes them interfere with each other:
- When a very long request enters Prefill, it can occupy the Decode time slice of other sessions on the same card, causing dozens of users’ outputs to stall for several seconds.
- Decode compute utilization remains low for long periods, and expensive high-compute cards spend most of their time waiting for data.
- Memory is filled by long-context KV Cache, batch size cannot increase, and throughput is locked by capacity rather than compute.
3. The Core Idea of PD Disaggregation: Decouple Resources, Mix Heterogeneous Hardware
PD disaggregation does something direct: it splits the two stages into different resource pools, and each pool selects hardware and scales according to its own bottleneck.
- Prefill pool: General-purpose accelerator cards pursue unit compute cost and can use larger batches to saturate matrix units.
- Decode pool: A limited number of cards with high memory bandwidth focus on memory access efficiency and low TPOT.
- KV Cache transfer: A high-speed interconnect moves KV Cache between the pools, recombining the two segments into one pipeline.
The benefits come from three overlapping sources. First, interference between stages is eliminated, so long requests no longer block short sessions. Second, the two pools scale independently, with each ratio set according to the separate SLOs for TTFT and TPOT. Third, heterogeneous mixed deployment lets general-purpose cards take on compute-oriented work that was previously assigned to high-end cards, without increasing the number of high-end cards.
Public engineering measurements show that under the same hardware investment and specific workloads, overall throughput can reach about three times that of a homogeneous solution. The exact multiplier varies significantly with input/output length distribution, concurrency, and card-type ratio, so it should not be treated as a universal constant.
4. Implementation Priorities
4.1 KV Cache Migration Is the Main Cost Item
After disaggregation, the largest new overhead is cross-pool KV Cache transfer. Engineering work should focus on: overlapping transfer with computation (prefetching the next chunk), pipelining by layer rather than moving whole blocks, topology affinity on the transfer link (same-rack priority), and compression or quantization to reduce transfer volume.
4.2 Routing and Scheduling
The gateway needs to route by load characteristics and align the batching windows of the two pools so the Decode pool does not idle while waiting for data. Illustrative logic:
def route(req, prefill_pool, decode_pool, cfg):# Long inputs prefer the compute pool; short requests can use the mixed pool to reduce migration overheadif req.input_tokens >= cfg.long_input_threshold:p = prefill_pool.acquire(req)kv = p.run_prefill(req, chunk=cfg.chunk_size)d = decode_pool.acquire(req, kv_hint=kv.size_bytes)kv.transfer_to(d, overlap=True, by_layer=True)return d.stream_decode(req, kv)return decode_pool.run_mixed(req) # Short requests complete locally to avoid transfer
4.3 Batching and Chunking
On the Prefill side, chunked prefill controls the duration of a single occupancy. On the Decode side, continuous batching dynamically swaps requests in and out at token granularity, converting memory capacity into higher concurrency.
4.4 Capacity Planning
Derive the pool ratio from two observable metrics instead of guessing from card count:
TTFT ≈ input length / (Prefill pool effective compute × utilization)TPOT ≈ (weight bytes + KV read bytes) / Decode pool effective bandwidthRequired Decode cards ≈ target concurrency × TPOT budget / sessions per card
4.5 Observability
Instrument each stage: queue time, Prefill latency, KV migration time, Decode step distribution, memory usage, and swap-out rate. Without stage-level metrics, it is impossible to tell whether the bottleneck is compute, bandwidth, or the migration link.
5. Applicability Boundaries and Common Pitfalls
PD disaggregation is not a universal switch. In scenarios with short requests, low concurrency, and similar input/output lengths, KV migration overhead may consume all the benefit; homogeneous mixed inference is then simpler and more reliable. There are three common pitfalls: treating the migration link as having unlimited bandwidth; purchasing Prefill cards only by peak compute while ignoring how their memory capacity limits batch size; and keeping the two pool ratios fixed so they cannot follow changes in traffic periods.
6. Deployment Checklist
- Measure the real input/output length distribution and confirm there are enough long-input requests.
- Verify the bandwidth and latency of the KV Cache migration link, and implement overlap optimization.
- Set the two pool ratios by SLO rather than by card count, and keep elastic scaling.
- Establish stage-level observability metrics and a rollback switch.
- Run homogeneous-versus-heterogeneous load tests on the same business traffic, using unit token cost as the final criterion.
The reduction of inference costs ultimately depends not on single-card peak specifications, but on how well scheduling strategy matches hardware characteristics. Splitting compute-intensive and memory-intensive workloads and placing each on the most suitable hardware is the most realistic path to cost reduction when high-end cards are constrained.
