Faster KV-cache handoff without GPU peer-to-peer: what vLLM already has
Updated 2026-10-24. The headline range for PR #61056 is now the full range in the table (3.8-5.7 GB/s); the earlier 5.0-5.7 GB/s was its upper reading only. The setup also says why this post’s NixlConnector numbers differ slightly from the previous post’s.
In the previous post I measured vLLM v0.30.0’s NIXL connector handing a KV cache from a prefill GPU to a decode GPU on two RTX 4090s without peer-to-peer: 0.4 to 0.8 GB/s, under 7% of the 12.9 GB/s a plain pinned copy between the same two GPUs reaches. For a 28,672-token prompt that is two to three extra seconds before the first token.
Three existing routes were not covered there:
- a UCX setting that lets the transfer library pipeline a GPU-to-GPU read instead of emulating it over TCP;
- an open vLLM pull request, #61056, that replaces the host-buffer path’s per-layer copy with one batched copy;
- vLLM’s
OffloadingConnectorwith its P2P tier, which ships in v0.30.0 and stages the cache through pinned host memory with asynchronous copies.
The short answer: the pull request is the fastest, at 3.8-5.7 GB/s, six to seven times the host-buffer path it changes. The OffloadingConnector reaches about 3 GB/s. The UCX setting does not complete a long prompt: it runs out of GPU memory. None of them reaches half of the pinned copy.
The setup
The same machine, model and method as the previous post:
- vLLM v0.30.0 (the CUDA 12.9 build), NIXL 1.4.1 with its bundled UCX 1.22.0, NVIDIA driver 550.144.03 (CUDA 12.4).
- Qwen2.5-7B-Instruct in bf16, 57,344 bytes of KV cache per token.
- Prefill on GPU 4, decode on GPU 5: same CPU socket, same PCIe switch, no peer-to-peer.
- Prompts of 2,048, 8,192 and 28,672 tokens, 8 output tokens, 20 measured requests per length after warm-up.
- Handoff cost = time to first token of the prefill/decode pair minus the time to first token of the same prompt on one GPU (median of the 20 requests; the previous post used their mean, which is why its NixlConnector numbers differ slightly from the ones here). Handoff bandwidth = the KV bytes added between 8,192 and 28,672 tokens (1.17 GB) divided by the growth of that cost. I report it as a range: the upper end also subtracts the decode side’s own work, the lower end does not.
- Five rounds; in each round every configuration runs once, in a fresh random order, and a pinned copy between the two GPUs is measured at the start and the end.
The UCX setting and the pull request each change one thing in a NixlConnector configuration; the OffloadingConnector is a different connector:
| Route | What changes | Compared with |
|---|---|---|
| UCX pipeline | UCX_RMA_PPLN_ENABLE=y in both servers’ environment |
NixlConnector, pull (the default) |
| PR #61056 | the pull request’s diff (one file, kv_connector/utils.py) applied to v0.30.0 |
NixlConnector, kv_buffer_device: cpu |
| OffloadingConnector | OffloadingConnector with a CPU tier of 8 GiB per instance and a p2p secondary tier, as in v0.30.0’s own P2P test |
the pinned copy (a different request flow) |
Before timing, I checked that each changed route actually took its new path. With PR #61056, NIXL 1.4.1 page-locks the host buffer when it registers it, so the batched copy ran: its debug log showed the batched path for every copy at all three prompt lengths. With the OffloadingConnector, the decode server computed none of the prompt itself and loaded every token from the connector.
The numbers
| Route | extra time to first token at 28,672 tokens | handoff bandwidth |
|---|---|---|
| NixlConnector, pull (default) | 2.96-3.03 s | 0.57-0.60 GB/s |
| NixlConnector, host buffer | 2.02-2.11 s | 0.74-0.81 GB/s |
| OffloadingConnector, P2P tier | 0.69-0.72 s | 2.48-3.18 GB/s |
| host buffer with PR #61056 | 0.49-0.52 s | 3.79-5.66 GB/s |
| pinned copy, same bytes | 0.13 s | 12.9 GB/s |
Ranges are over the five rounds (and, for bandwidth, over the lower and upper reading). Every request moved exactly the expected number of KV bytes, and every configuration’s 8-token outputs matched single-GPU serving on 57 of 60 prompts (the same prompts served again from the single GPU’s prefix cache matched on 58).
The pull request: 6 to 7 times the host-buffer path
The host-buffer configuration moves the cache in three legs: GPU to the prefill server’s host buffer, host buffer to host buffer through NIXL, and the decode server’s host buffer to its GPU. The middle leg is fast in both builds: NIXL reports 0.05 to 0.11 seconds for it. In v0.30.0 the two copies between GPU and host buffer go layer by layer, indexing the host tensor on the CPU. From 8,192 to 28,672 tokens, that path’s handoff cost grows by 1.44 seconds; with PR #61056 it grows by 0.21 seconds. In every round the bandwidth is 6.2 to 7.2 times the unpatched path.
At 28,672 tokens the patched handoff still costs 0.50 seconds. About 0.13 s of that is the decode server’s own work, about 0.11 s the NIXL leg, and the rest, roughly a quarter of a second, the two copies and fixed costs; the pull request keeps the copies synchronous. I posted these numbers on the pull request.
The OffloadingConnector: about 3 GB/s, already shipped
The OffloadingConnector’s P2P tier needs no patch. It stages the cache in a pinned CPU tier on each instance, with asynchronous copies, and moves blocks between the two tiers through NIXL, here over shared memory. It handed off at 2.5 to 3.2 GB/s, four times the host-buffer configuration of the NIXL connector. Its request flow differs from the NIXL connector’s (its own proxy, an asynchronous copy down, 16-token offload blocks), so the comparison with the NIXL routes is end to end, not a one-setting change.
The UCX setting: out of GPU memory
UCX_RMA_PPLN_ENABLE=y turns on UCX’s rendezvous pipeline for remote reads, the path that could
replace the TCP emulation. With it, the decode server completed the 2,048- and 8,192-token
prompts and failed during the first 28,672-token transfer:
1 | cuMemAlloc_v2(&alloc_handle->ptr, alloc_handle->length) failed: out of memory |
UCX allocates the pipeline’s fragment pool in 512 MiB chunks of GPU memory, not host memory. By the long prompt, GPU 5 held about 23.8 of its 24.6 GB, nearly all of it held by vLLM (weights, KV cache and workspace under its default memory budget), and the next chunk did not fit. NIXL reported the failure and vLLM failed the request. Making this route work means giving vLLM less GPU memory or changing where UCX puts its fragments; I did not try either, so I report no bandwidth for it.
What this means
On two PCIe GPUs without peer-to-peer, the cheapest improvement to vLLM v0.30.0’s prefill-to-decode handoff is configuration: the OffloadingConnector’s P2P tier cuts the extra time to first token at 28,672 tokens from about 2 to 3 seconds to 0.7 seconds, with no code change. PR #61056, if merged, does better on the NIXL connector’s host buffer: 0.5 seconds. Neither reaches half of what a plain pinned copy between the same two GPUs moves (best: 0.44 of it), so a handoff that overlaps its legs still has room.
Two side notes from the previous post: the push mode’s 30-second lease waits are a v0.30.0 bug, fixed in v0.31.0 by vllm#58188; and the default pull configuration falling back to TCP emulation without any log line is now vllm#62080.
These numbers hold for vLLM v0.30.0, NIXL 1.4.1 and driver 550 on this pair of RTX 4090s, at prompts of 2,048 to 28,672 tokens.
Reproduce
The measurement method and the two NixlConnector configurations are in rockyshi-dev/kv-handoff-bench.