Chapter 06
KV hand-off links and compression
What the link between the pools costs, and compressing the KV cache on the prefill GPU before it crosses. Below, the mechanism as the simulator ran it, step by step; then what it measured, why it behaves that way, and the papers.
Check yourself ↓ three questions and what to remember, at the end
Loading the pool animation…
What the simulator recorded
The sweep keeps the link fixed; these are the simulator's recorded runs (results.md sections 14 and 15), in the matrix's colours against NVLink.
| Link | KV wait + transfer share of E2E | Link busy | TPOT p99 | SLO met |
|---|---|---|---|---|
| nvlink4 | 0.0% | 0.5% | 8.8 ms | 100.0% |
| ib-ndr | 0.3% | 4.0% | 8.8 ms | 100.0% |
| cpo-optical | 0.1% | 1.0% | 8.8 ms | 100.0% |
| eth-100g | 1.2% | 16.1% | 9.0 ms | 100.0% |
| eth-25g | 8.1% | 64.4% | 11.6 ms | 100.0% |
| Link | Load | Best preset | Hand-off p99 uncompressed | Hand-off p99 compressed | Hand-off gain | SLO uncompressed | SLO compressed |
|---|---|---|---|---|---|---|---|
| eth-25g | 10 req/s | fp4-block | 750.0 ms | 84.3 ms | 8.9x | 100.0% | 100.0% |
| eth-25g | 12 req/s | fp4-block | 2,959.0 ms | 87.0 ms | 34.0x | 98.3% | 100.0% |
| eth-25g | 14 req/s | fp4-block | 9,657.8 ms | 88.5 ms | 109.1x | 41.0% | 100.0% |
The hand-off is bytes over a wire
A disaggregated request's first token comes from the prefill pool; every token after it needs the prompt's whole KV cache on the decode pool. That cache is large (two values per layer per token), and it crosses the link once per request, so the link is a third resource with its own queue. In the animation decode TPOT p99 is 6.9 ms over NVLink, 7.9 ms over InfiniBand and 25.1 ms over 25 GbE, where the hand-offs queue (DistServe's TPOT includes that wait, DistServe).
Compressing the cache on the prefill GPU before it is sent shortens every hand-off by its ratio: FP8 brings 25 GbE back to 14.9 ms, and FP4 blocks to 11.2 ms. The simulator does not model what compression does to accuracy (eight- and four-bit KV are within what KIVI and KVQuant report as tolerable).
When the link matters
The link matters when hand-off bytes times request rate approaches its bandwidth: then transfers queue, and the queue grows without bound as the load rises. Over NVLink or InfiniBand at these rates the hand-off is a rounding error of end-to-end time; over 25 GbE it is the bottleneck, and compression is a prerequisite rather than an optimisation. Compressing on the GPU costs one elementwise pass after each prefill, which shows as a slightly later first token (TTFT p99 365.5 ms with FP8 against 364.5 ms uncompressed in the animation). Where the bytes are mostly waiting rather than moving, compression helps by far more than its ratio: at the highest load recorded the best preset (fp4-block) makes the hand-off p99 109.1x shorter.
Check yourself
Commit to an answer before you reveal it: a wrong guess you can explain teaches more than a right one you skimmed. Every number in the answers comes from the same tested model as the chapter’s.
Reveal the answer
Answer: 25.1 ms (counted right within 10%)
Commit to a number, then reveal.
Reveal the answer
Answer: When hand-off bytes times request rate approaches the link's bandwidth
Pick one, then reveal.
Reveal the answer
Answer: 14.9 ms (counted right within 10%)
Commit to a number, then reveal.
Papers and sources
- Zhong, Liu, Chen et al., DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving (arXiv:2401.09670): goodput under TTFT and TPOT SLOs, the metric this site measures capacity by
- Liu, Yuan, Jin et al., KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cache (arXiv:2402.02750).
- Hooper, Kim, Mohammadzadeh et al., KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantization (arXiv:2401.18079).