Inference Trade-offs Explained

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.

LinkKV wait + transfer share of E2ELink busyTPOT p99SLO met
nvlink40.0% 0.5% 8.8 ms 100.0%
ib-ndr0.3% 4.0% 8.8 ms 100.0%
cpo-optical0.1% 1.0% 8.8 ms 100.0%
eth-100g1.2% 16.1% 9.0 ms 100.0%
eth-25g8.1% 64.4% 11.6 ms 100.0%
A grouped-query KV cache over each link (Llama-3-8B shape, eight requests per second, 2,048-token prompts). The co-packaged optics switch link is illustrative.
LinkLoadBest presetHand-off p99 uncompressedHand-off p99 compressedHand-off gainSLO uncompressedSLO compressed
eth-25g10 req/s fp4-block 750.0 ms 84.3 ms 8.9x 100.0% 100.0%
eth-25g12 req/s fp4-block 2,959.0 ms 87.0 ms 34.0x 98.3% 100.0%
eth-25g14 req/s fp4-block 9,657.8 ms 88.5 ms 109.1x 41.0% 100.0%
Where serving is transport-bound (GQA KV over 25 GbE as the load rises): what compressing the hand-off on the prefill GPU buys.

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.

Q1In the animation, decode TPOT p99 over a 25 GbE link, in ms?
Reveal the answer

Answer: 25.1 ms (counted right within 10%)

Against 6.9 ms over NVLink: on the slow link the hand-offs queue, and TPOT includes the wait.

The hand-off is bytes over a wire →

Commit to a number, then reveal.

Q2When does the KV link start to matter?
Reveal the answer

Answer: When hand-off bytes times request rate approaches the link's 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.

When the link matters →

Pick one, then reveal.

Q3FP8 compression on the prefill GPU, same 25 GbE link: what does TPOT p99 become, in ms?
Reveal the answer

Answer: 14.9 ms (counted right within 10%)

Compression shortens every hand-off by its ratio, and where the bytes are mostly waiting it helps by far more: on a saturated link it is a prerequisite, not an optimisation.

The hand-off is bytes over a wire →

Commit to a number, then reveal.

Papers and sources