Cross-Datacenter KVCache Transfer: The Path to a 54% Throughput Gain
This article explains how KVCache transfer across datacenters becomes feasible for disaggregated prefill and decode (PD) serving. It introduces KV throughput (Φkv) as a feasibility metric, shows how hybrid attention architectures reduce Φkv by roughly an order of magnitude, and outlines a prefill-as-a-service design based on selective offloading, bandwidth-aware scheduling, and transfer-compute overlap. It also covers measured results, boundary conditions, and a practical deployment checklist.
1. Where the Problem Starts: PD Disaggregation Puts Bandwidth in the Spotlight
Large-scale LLM inference has settled on a common understanding: the prefill stage is compute-intensive and consumes compute capacity, while the decode stage is memory-intensive and consumes memory bandwidth and capacity. Splitting the two stages across separate resource pools (PD disaggregation) can significantly improve resource utilization and elasticity. But the split comes with an unavoidable cost: the KVCache produced by prefill must be moved across nodes, and in long-context scenarios the transfer volume can quickly grow beyond what the network can handle.
The traditional approach therefore constrains PD to a single RDMA network domain: link bandwidth is high enough and latency low enough that KVCache transfer is nearly invisible. The cost is that the cluster is locked into a tightly coupled structure. The hardware ratio between prefill and decode is fixed at deployment time and cannot be adjusted dynamically with traffic patterns (long input/short output vs. short input/long output). At the same time, very large models can only be deployed as a single pool, making resource fragmentation and queueing latency hard to eliminate.
2. Quantifying the Bottleneck: Using KV Throughput Φkv for Feasibility Decisions
Discussing whether cross-datacenter deployment is feasible requires a comparable physical quantity first. The commonly used industry definition is KV throughput Φkv: the amount of KVCache data produced by the prefill stage per unit time, measured in Gbps. It is driven by four factors:
Φkv ≈ (layers × KV heads × head dim × 2 (K and V) × bytes per precision × tokens generated per second)
For dense attention models, Φkv is roughly linear in sequence length, with a large coefficient. Public benchmark data provides an order-of-magnitude reference: for a dense attention model on an 8-GPU mainstream accelerator instance, the KVCache production rate at 32K input is about 60 Gbps per instance, while the usable bandwidth of a typical cross-datacenter Ethernet instance is usually far lower. The conclusion is direct: as long as Φkv exceeds the available link bandwidth, PD must stay within the same network domain.
In engineering practice, it is advisable to make this decision a hard gate before launch:
- Calculate the peak Φkv at the target input length and compare it with the available cross-site bandwidth (after subtracting background traffic), keeping at least 30% headroom;
- Focus on P90/P99 rather than the mean, since tail requests determine whether queueing and degradation are needed;
- Convert bandwidth cost into transfer overhead per million tokens and compare the economics against compute savings.
3. Hybrid Attention Architectures: Reducing Φkv by an Order of Magnitude
What truly opens the window for cross-datacenter deployment is a change on the model architecture side. Current mainstream designs interleave a small number of full attention layers with a large number of linear-complexity layers, so KVCache only needs to be retained for the few global layers, while the rest are replaced by states or local windows. Layer ratio patterns in public materials include gated delta linear attention with latent attention at roughly 3:1, sliding window attention with grouped query attention at roughly 5:1, and linear attention with latent attention at roughly 7:1.
The effect is clear in the data: at the same 32K input, a hybrid attention model has a Φkv of about 4.66 Gbps, while a dense attention model is about 59.93 Gbps, a difference of roughly 13x. This means the transfer volume that originally required dedicated high-speed interconnect falls within what ordinary Ethernet can carry.
It is worth emphasizing that architecture optimization is a necessary condition, not a sufficient one. The KVCache is smaller, but system overheads such as cross-site round-trip latency, TCP retransmission, and congestion control startup still exist and must be addressed through scheduling and transport-layer design.
4. Prefill as a Service: Turning Offloading into a Schedulable Resource
Building on this, the prefill-as-a-service approach selectively offloads long-context prefill to an independent high-compute cluster, and the resulting KVCache is returned over ordinary Ethernet to the local PD cluster for decoding. Three design points determine success:
- Selective offloading. Not every request is worth sending across sites. Requests can be scored by input length, expected remaining output length, and local queue depth, offloading only the tail requests with the highest gain.
- Bandwidth-aware scheduling. The scheduler needs real-time awareness of available link bandwidth and the load of each prefill pool, avoiding placing multiple large-Φkv requests in the same window and causing congestion collapse.
- Transfer and compute overlap. KVCache is streamed back in chunks, with earlier layer blocks entering decode first to hide transfer latency.
Illustrative scheduling logic:
def should_offload(req, link, local_queue):# Estimate the request's KV data volume (MB) and transfer timekv_mb = estimate_kv_bytes(req.input_len) / (1024 ** 2)tx_ms = kv_mb * 8 / max(link.available_gbps, 1) * 1000gain = local_queue.wait_ms - tx_msreturn req.input_len >= OFFLOAD_MIN_LEN and gain > 0 and link.available_gbps > kv_mb * 8 / 1000
5. Measured Gains and Boundary Conditions
In an internal test with a trillion-parameter-scale mixture-of-experts model, this combined approach delivered roughly 54% higher overall throughput than homogeneous PD deployment, with P90 time-to-first-token reduced by about 64%. The gains break down as follows: the prefill pool scales independently, so long requests no longer block the local decode queue; the decode pool is configured according to memory bandwidth needs, improving utilization; and the elastic ratio can be adjusted in minutes as traffic patterns change.
The boundary conditions must also be stated clearly: cross-site latency must stay stable at single-digit milliseconds with controlled jitter; the link needs congestion isolation to avoid interference with business traffic; the model must be a low-Φkv hybrid attention architecture, since forcing a dense model across sites will be offset by bandwidth costs; and KVCache permission isolation and lifecycle reclamation must be handled to prevent cross-site caches from becoming a data residue risk.
6. Deployment Checklist
- Measure Φkv first, then discuss architecture: incorporate bandwidth estimation into the capacity planning process;
- Pilot on hybrid attention models first, and keep dense models in same-domain PD;
- Build a bandwidth-aware global scheduler, with monitoring, alerting, and logging services for tail analysis;
- Use chunked streaming transfer and compute overlap to reduce effective time-to-first-token;
- Use a container platform to host heterogeneous resource pools and enable dynamic scaling of the prefill-to-decode ratio;
- Define a degradation strategy: automatically fall back to local prefill when bandwidth is tight to protect SLAs.
The conclusion is not mysterious: the path of cross-datacenter KVCache transfer works not because of a single trick, but because of a systems engineering combination of “low-Φkv model architecture + selective offloading + bandwidth-aware scheduling.”
