Skip to content
Inference Academy

Lab: disaggregated prefill and decode on two GPUs

Run the same model colocated and disaggregated (one prefill GPU, one decode GPU, KV cache moved between them), drive it with a workload of mixed short and very long prompts, and measure what happens to inter-token latency, time to first token and goodput. Predict with the course's simulation first; explain every difference.

By

120 min · verified 2026-11Hands-on labPro
Share

Goal: see the prefill/decode interference problem on your own hardware, then measure what disaggregation fixes and what it costs, against a fair baseline.

You need: two NVIDIA GPUs in one machine (NVLink preferred; PCIe works and is instructive), vLLM or SGLang with disaggregation support, a 7 to 8B model, loadgen.py from the baseline-to-3x lab, and about two hours.

Honest limits. Disaggregation is the fastest-moving part of open-source serving: connector names, router commands and flags change between releases. Follow your engine's current disaggregation guide for the exact launch commands; this lab gives the structure and the measurements. NVIDIA Dynamo and llm-d are alternatives that wrap the same idea.

#Step 0: the workload

Mix short chat requests with occasional very long prompts, which is where interference shows:

text
80% of requests: prompt 500 tokens, output 200 tokens
20% of requests: prompt 16,000 tokens (a long document), output 200 tokens
SLOs: TTFT p95 <= 3 s; TPOT p99 <= 60 ms

Edit loadgen.py's prompt and output length lists, or add a weighted choice, to produce this mix.

Pro content

Keep reading with Inference Academy Pro

Unlock this full lab, plus every advanced lesson, hands-on lab, the larger playground models and completion certificates.

Still to come in this lab

  1. Step 1: predict
  2. Step 2: the fair baseline, two colocated replicas
  3. Step 3: disaggregated, one prefill GPU and one decode GPU
  4. Step 4: fill the table
  5. Step 5: explain
  6. Self-check
  7. Stretch goals

You will be able to answer

  • What should disaggregation improve most in this lab?
  • Time to first token got worse after disaggregating. Name a likely cause.
  • Why compare against two colocated replicas, not one?