Rebellions
Blogs
Dec 01, 2026

Splitting Inference for Production Scale, Part 1: Why Prefill and Decode Belong Apart

For a long time, choosing hardware for LLM inference came down to two questions: how large a model the accelerator can run and how many tokens per second it can generate. At production scale, however, those numbers do not tell the whole story.

Real services have to meet latency targets for time to first token (TTFT), time per output token (TPOT) and tail latency. They have to do it while handling many concurrent requests and keeping costly accelerators busy. That makes inference a system problem. The question is no longer how fast one chip runs a model, but how well many chips are configured and connected to run a whole service.

Rebellions has been building out its NPU serving stack on vLLM to meet this shift. In this three-part series, we take the next step: implementing and optimizing Prefill/Decode (P/D) disaggregation on Rebellions NPU with vLLM and llm-d. Part 1 explains why and when Prefill and Decode belong apart, Part 2 walks through how we built it, and Part 3 shows how it improves latency and capacity under production service-level objectives (SLOs).

One Model, Two Different Workloads

Every LLM request runs in two phases: Prefill and Decode.

Prefill processes the entire input prompt in one pass and builds the KV cache that later token generation relies on. Because it computes many tokens in parallel, it is compute-bound.

Decode then generates output tokens one at a time. Each step reads the model weights and the growing KV cache from the accelerator’s memory to produce a single token per request, so it is memory-bandwidth-bound.

Figure 1 shows traditional, monolithic inference serving where the two phases run on the same set of hardware.

Traditional inference: one shared serving pool runs both Prefill and Decode on the same hardware.
Figure 1: Traditional Inference Shared Serving Pool

This forces a single configuration to serve two workloads with different resource profiles that stress the hardware in opposite ways. Figure 2 highlights the different workload characteristics of prefill and decode.

Prefill is compute-heavy and measured by time to first token; Decode is memory-bandwidth-heavy and measured by time per output token.
Figure 2: Prefill and Decode Workload Characteristics

In a typical deployment, both phases share the same model instance and accelerators, which causes mutual interference between them. For example, suppose several requests are mid-decode when a new request arrives with a long prompt. Its Prefill competes for the same compute, and the requests already decoding slow down. Users see this as stalls in the token stream (higher TPOT).

Chunked prefill reduces this contention by splitting a long prompt into smaller pieces that run alongside ongoing Decode steps, so no single step stalls for long. But it doesn’t remove the contention entirely, and it trades some TTFT for smoother token generation. As traffic gets more varied, with long prompts mixed with short ones and bursty load, no single configuration can be tuned well for both phases at once.

Disaggregating prefill and decode into separately sized and tuned instances is a way to address this problem. The idea comes from systems research. DistServe (OSDI 2024) showed that assigning Prefill and Decode to different GPUs removes the interference between them and lets each phase be tuned for its own latency target. Splitwise (ISCA 2024) showed that running each phase on hardware suited to it can raise throughput and lower cost. Open-source serving frameworks such as vLLM and llm-d have since built P/D disaggregation in, which is what makes it practical to deploy on Rebellions NPU. Figure 3 displays a disaggregated inference deployment.

A router sends requests to separate Prefill and Decode pools, with the KV cache transferred between them.
Figure 3: P/D Disaggregated Inference with Separate Prefill and Decode Pools

Separating Prefill and Decode

With P/D disaggregation, each request passes through both pools as shown in Figure 4. A router assigns a request to a Prefill worker and a Decode worker. The Prefill worker processes the prompt and builds the KV cache, then hands that cache off to the Decode worker, which generates the output tokens. The KV cache handoff is the one new step disaggregation adds, and as we will see in Part 2, it’s the hardest part to get right.

Request flow: a router sends the request to a Decode worker or a Prefill worker, then KV transfer, then token generation.
Figure 4: Request Flow Diagram in P/D Disaggregated Inference

Separating the phases lets each be tuned for the metric it drives. Prefill can use parallelism that cuts TTFT, while Decode uses a different setup tuned for TPOT and concurrent throughput. Each pool can also be sized independently, so capacity goes where the workload actually needs it.

Monolithic serving runs four combined P and D instances; P/D disaggregated serving runs two Prefill and four Decode instances.
Figure 5: Monolithic vs P/D Pool Diagram

If Decode traffic grows, you add Decode capacity and leave Prefill alone. If long-context requests increase and Prefill becomes the bottleneck, only the Prefill pool scales.

P/D disaggregation isn’t just running two computations on different devices. It turns Prefill and Decode into independent serving resources, each sized and tuned for the work it actually does.

The Hidden Cost of Separation

Splitting Prefill from Decode is only the first step. When both phases run in one process, Decode reads the KV cache straight from the memory where Prefill built it. Once they run on separate workers, that KV cache becomes a distributed state that has to move across the network before Decode can begin as illustrated in Figure 6.

The KV cache built by the Prefill worker is transferred over the network to the Decode worker before Decode starts.
Figure 6: KV Cache Transfer in P/D Disaggregated Inference

Moving KV Cache state between separate instances raises questions and adds complexity a single-process deployment never has to answer:

  • Routing: Which Prefill worker and which Decode worker should handle each request?
  • Memory allocation: When should the Decode worker reserve memory for the incoming KV cache?
  • Block mapping: How do the KV blocks built in Prefill map onto the blocks reserved in Decode?
  • Scheduling: How do you make sure a request isn’t scheduled for Decode before its KV cache has arrived?
  • Ownership and failure: Who cleans up the KV cache if a request is cancelled or a worker fails?

Then there’s the transfer itself. The KV cache handoff is a new latency-sensitive dependency that a single-pool deployment never has. Decode can’t start until the KV cache arrives, so any transfer time that is not hidden adds directly to latency. That makes a fast interconnect essential. If the transfer path is congested or slow, it can erase the gains P/D disaggregation was meant to deliver. If it drops a cache, it introduces an entirely new failure mode.

How much data is that?

The KV cache grows with model size and context length. For each token, the model stores a key (K) and a value (V) for every layer and KV head:

1. How big is the KV cache for one request?

KV cache per request = 2 × L × H × D × B × S

where 2 is one key and one value, L is the number of layers, H the number of KV heads, D the head dimension, B the bytes per value, and S the number of tokens in the request.

For example, MiniMax M2.7 has 62 layers, 8 KV heads and a head dimension of 128, and stores values in BF16 (2 bytes). That works out to about 254 KB per token. For an agentic coding request with S = 50,000 input tokens:

2 × 62 × 8 × 128 × 2 bytes × 50,000 ≈ 12.7 GB

12.7 GB has to move to the Decode worker before Decode can produce its first token.

2. How long does that take to move?

Link SpeedTime to Move 12.7 GB
100 Gb/s~1.0s
400 Gb/s~0.25s
800 Gb/s~0.13s

Every millisecond of that transfer counts toward time to first token (TTFT), because decode cannot start until the KV cache arrives. On a slower link, the transfer alone can take up a large share of a TTFT target, before prefill compute and queuing are even counted. That is why the interconnect matters as much as the accelerators. It is also why, in Part 2, we look at how to overlap the transfer with other work so less of it adds to the latency users feel.

And 12.7 GB is for just one request. At 2 long-context requests per second, the transfer path has to carry about 25 GB/s (~200 Gb/s) of KV cache traffic, on top of the other network traffic in the cluster. If the network can not keep up, transfers queue behind each other and the latency P/D was meant to save comes back.

The numbers are not always this large. In coding assistants, much of each prompt is shared context such as system instructions and repository files. If the Decode worker already holds that shared part, only the unique remainder has to move: with an 80% shared prefix, the 12.7 GB transfer drops to about 2.5 GB. Treating the KV cache as a resource that can be reused across requests is a direction we come back to at the end of this series.

Moving the cache quickly, sizing the network for it and routing requests so shared context can be reused all have to work together. That makes running P/D disaggregation in production a distributed systems problem, not just a model execution problem: request orchestration, scheduling, KV cache management and data transfer all have to work together for disaggregation to deliver on its promise.

No Forks: Building on Open Source

The most direct way to solve these problems would be to build a serving framework designed around our accelerator. We chose a different path: integrating Rebellions NPU into a P/D architecture built on vLLM and llm-d, two projects already widely used across the LLM serving ecosystem. With vLLM RBLN, vLLM-based applications run on Rebellions NPU with no code changes. P/D disaggregation takes that compatibility from a single vLLM instance to a full distributed serving architecture.

An alternative accelerator should not require an alternative AI ecosystem.

If adopting a new accelerator means rebuilding the application, serving API and orchestration layer, the migration cost can outweigh whatever benefits the hardware delivers. Our goal is not just to swap GPUs for NPUs. It is to make Rebellions NPU a natural fit within the open-source AI infrastructure teams already use.

What P/D costs to run, and when it pays off

Disaggregation can improve latency and scaling, but it gives up operational simplicity. Before adopting it, it helps to understand what you take on beyond the KV transfer path described above.

Two systems to run instead of one. Each pool needs its own capacity planning, scaling triggers and monitoring, and the Prefill:Decode ratio has to match the actual traffic mix. Getting that ratio right is one of the hardest parts of the deployment. If it is wrong, one pool sits idle while the other saturates, which is the same inefficiency disaggregation is meant to remove. The right ratio also shifts as traffic changes, so tuning it is ongoing work rather than a one-time setup. We look at how the ratio affects throughput in Part 3.

A larger debugging surface. A performance problem can now sit in the Prefill pool, the Decode pool or the handoff between them. Finding it takes visibility into both pools and how they interact.

Routing that has to be tuned. Gains from prefix caching depend on routing. If requests that share context aren’t sent to the worker that already holds it, a naive round-robin scheduler can erase much of the expected benefit. The routing layer becomes one more thing to tune.

More infrastructure to stand up and maintain. Disaggregation needs specialized routing, cross-pool observability and new operational playbooks. It only pays off with enough request volume and concurrency for independent scaling to matter.

The complexity pays off when the workload has these traits:

  • Input-heavy requests. Coding assistants, RAG and document analysis read tens of thousands of tokens of context but generate short responses. Prefill dominates and interferes with latency-sensitive Decode, so separating them helps. When inputs and outputs are both short, as in typical chat, most of the benefit disappears.
  • High concurrency with a real latency target. When many users need a responsive token stream at once, Decode has to scale on its own. Disaggregation lets you add Decode capacity without adding Prefill too, instead of over-provisioning the whole deployment. At low traffic, a single pool usually has enough headroom.
  • The ability to operate it. Given the costs above, it matters that teams can run P/D with tooling they already know. That’s why we built on vLLM and llm-d rather than a proprietary stack.

For everything else, a monolithic shared pool is simpler and performs well.

Next in this series: The KV cache handoff raises questions about routing, memory allocation, block mapping, scheduling, ownership and the transfer itself, and each one needs an answer before P/D works in production. In Part 2, we walk through how we answered them on Rebellions NPU.