Log inStart free
LESSON 31.02 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Disaggregated prefill and decode

Prefill and decode move to separate GPUs, and the KV cache travels between them.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 31.02 · SERVING BAYPROMPT TOKENS PER GPU 2,180 / 1,030 / 0
01
Stage 1 of 6 · Route
The router sends each request to a prefill GPU. Least loaded picks the GPU with the least work.
Explain it simply

Each teal tick at the top is a request arriving. The curved line shows the GPU the router picks for it. Least loaded counts the tokens each GPU still has to do and picks the smallest pile. The bars on the right count the prompt tokens each GPU gets.

Ten arrival ticks, each with a line to its GPU lane. Prompt tokens per GPU: 2,180, 1,030, 0.

request, prefill step, KV transferdecode step, TTFT and gapstall, wait, missed SLOGPU role, SLOGPU lane
GPU 0prefillGPU 1prefillGPU 2decode0100200300400500600 msR1R2R3R4R5R6R7R8R9R10tokens per GPUGPU 02,180 promptGPU 11,030 promptGPU 20 promptR1–R10 on 2 prefill GPUs, 1 decode GPUGPU 0prefillGPU 1prefillGPU 2decode0100200300400500600 msR1R2R3R4R5R6R7R8R9R10tokens per GPUGPU 02,180 promptGPU 11,030 promptGPU 20 promptR1–R10 on 2 prefill GPUs, 1 decode GPU
Toy: the 29.C2 trace, 10 requests on 3 toy GPUs, 128 KiB of KV per token
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
g=arg⁡min⁡jwj\sy{g}{param}{g} = \arg\min_j \sy{w}{data}{w_j}
pGPU=(2180, 1030, 0) prompt tokensp_{\text{GPU}} = (2180,\ 1030,\ 0)\ \text{prompt tokens}

The router picks the GPU with the least work left, in tokens.

Common mix-ups

MYTHThe layout that finishes first serves users best.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With 2 prefill GPUs, does round robin split the prompt tokens about evenly?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.