Cross-Datacenter KVCache Transfer: Architecture Behind a 54% Throughput Gain

    This article breaks down how KVCache transfer requirements constrain disaggregated LLM inference, why the KV throughput metric (Φkv) makes cross-datacenter deployment impractical for dense attention models, and how hybrid attention, selective prefill offloading (Prefill-as-a-Service), and bandwidth-aware scheduling work together to make it viable. It includes the Φkv estimation formula, offload decision logic, key engineering practices, and the reported 54% throughput improvement with 64% lower P90 TTFT, along with the boundaries of the approach.

    1. Inference Topology Locked by a Bandwidth Chain

    Large model inference has long been split into two phases. Prefill consumes all input tokens at once; it is compute-intensive and saturates compute capacity. Decode generates tokens autoregressively one at a time; it is memory-access intensive and saturates memory bandwidth. Because the two phases have different hardware demands, PD disaggregation has become the standard paradigm for large-scale inference.

    The prerequisite for disaggregation is that KVCache must be moved across nodes. Every layer and every attention head caches the Key/Value tensors of historical tokens, so the transfer volume grows with input length and layer count. Once that volume reaches tens of Gbps per second, Prefill and Decode are forced to share the same low-latency, high-bandwidth RDMA network domain, which makes deployment across data centers or availability zones nearly impossible.

    A less obvious cost is that resource ratios become fixed. Once heterogeneous hardware is placed in the same tightly coupled cluster, the card ratio between Prefill and Decode is hard-coded at deployment time. When traffic patterns change (more long-text requests, higher concurrency), the ratio cannot be adjusted dynamically and utilization collapses.

    2. Key Metric: Quantifying the Bottleneck as Φkv

    Before judging whether cross-datacenter deployment is feasible, you need a comparable quantity. The industry commonly uses “KV throughput” to describe the volume of KVCache data produced by the Prefill side per unit time, denoted Φkv and measured in Gbps.

    Its approximate expression is:

    1. Φkv ≈ (L × H_kv × d_head × 2 × bytes) / t_prefill
    2. where L is the input length, H_kv is the number of KV heads, d_head is the head dimension,
    3. 2 represents the two tensors K and V, bytes is the size of a single element,
    4. and t_prefill is the prefill latency of the request

    For models using dense attention, Φkv can reach roughly 60 Gbps at a 32K input length, while the available bandwidth of typical cross-datacenter Ethernet is far below that. The conclusion is straightforward: this is not “a bit slower” but an order-of-magnitude gap, which is engineering-infeasible.

    3. Hybrid Attention: Opening the Window by an Order of Magnitude

    The approach taken by a new generation of hybrid attention architectures is to interleave a small number of full attention layers with a large number of linear-complexity layers. Linear-complexity layers (such as various state space or linear attention variants) do not need to retain full K/V for all historical tokens; they only maintain a recurrent state of fixed size. Only the few full attention layers keep a complete cache.

    As a result, Φkv drops approximately linearly with the proportion of full attention layers. With a configuration such as a 1:7 ratio of full attention layers to linear layers, the overall KVCache volume shrinks by roughly an order of magnitude compared with a fully dense structure, turning cross-datacenter transfer from “impossible” into “worth designing seriously.”

    It is worth stressing that reducing the model-side volume is only a necessary condition, not a sufficient one. What actually makes the design work is the combination of architecture optimization, selective offloading on the system side, and bandwidth-aware scheduling.

    4. PrfaaS: Selectively Externalizing Long-Context Prefill

    One validated approach is Prefill-as-a-Service: selectively offload long-context prefill to an independent high-compute cluster, then send the resulting KVCache back over ordinary Ethernet to the local PD cluster to perform Decode.

    “Selective” is the core, and the decision logic can be written as:

    1. def should_offload(req, link):
    2. # req.input_len: input length; link.avail_bw: available link bandwidth
    3. est_kv = estimate_kv_bytes(req.input_len) # estimated from the model layer structure
    4. transfer_ms = est_kv / link.avail_bw * 1000
    5. local_queue_ms = predict_local_prefill_wait(req)
    6. remote_gain_ms = predict_remote_prefill_gain(req)
    7. return remote_gain_ms > transfer_ms + local_queue_ms

    In other words, offload only when the remote compute gain exceeds the sum of transfer latency and local queueing latency. Short requests stay local during low-load periods, while long requests spill over during peak periods, avoiding wasted bandwidth on low-value traffic.

    5. Bandwidth-Aware Scheduling and Engineering Essentials

    • Topology-aware placement: place Decode instances closest to where the KVCache lands, reducing cross-domain hops.
    • Link budget isolation: reserve a dedicated bandwidth quota for KVCache return traffic so it does not contend with business traffic.
    • Layered transfer and pipelining: transfer in per-layer batches so Decode can start as soon as the first layer is ready, hiding transfer latency.
    • Compression and quantization: apply low-bit quantization or sparsification to KVCache to further reduce Φkv.
    • Elastic ratios: scale Prefill and Decode clusters independently and adjust the ratio based on real-time traffic patterns.
    • Observability: build monitoring, alerting, and capacity baselines for Φkv, link utilization, and P90 TTFT.

    6. Benefits and Boundaries

    In internal testing with a 1T-parameter hybrid model, this design delivered about 54% higher throughput than an equivalent homogeneous PD deployment, with P90 TTFT reduced by about 64%. The gains break down into three parts: long requests no longer block the local queue, compute ratios can be adjusted elastically, and cross-domain bandwidth is no longer a hard constraint.

    The boundaries are equally clear: cross-domain latency jitter, link availability, KVCache consistency validation, and failover paths must all be designed. If the model still uses full dense attention, Φkv does not drop and a cross-datacenter design should not be the first choice. When using cloud resources, the engineering loop can be completed with general-purpose capabilities (container platforms for elastic orchestration, object storage for cold data landing, monitoring and alerting for link observability) rather than relying on a single proprietary interface.