Viable Paths for Cross-Datacenter KVCache Transmission

    This article explores the feasibility of cross-datacenter (cross-DC) KVCache transmission in large language model (LLM) inference. It explains how traditional dense attention models restrict Prefill-Decode (PD) disaggregation due to massive KVCache bandwidth requirements. By leveraging hybrid attention architectures to reduce KVCache size, coupled with selective offloading, bandwidth-aware scheduling, and chunked pipeline transfers, cross-DC PD deployment becomes viable. Tests on an internal 1T-parameter hybrid model demonstrated a 54% throughput increase and a 64% reduction in P90 Time To First Token (TTFT). The article also outlines engineering implementation guidelines and boundary conditions for adopting this architecture.

    Viable Paths for Cross-Datacenter KVCache Transmission

    The Prefill and Decode phases of LLM inference have long been bound by an invisible constraint: KVCache transmission bandwidth. The Prefill phase is compute-intensive, while the Decode phase is memory-bandwidth-intensive. Disaggregating these two phases (PD disaggregation) should theoretically improve resource utilization, but once deployed across separate nodes, the KVCache generated during Prefill must be transferred over the network. Traditional dense attention models generate enormous KVCache volumes under long contexts, with throughput easily reaching tens of Gbps, forcing Prefill and Decode to share the same high-speed RDMA network domain. This makes deploying heterogeneous hardware, elastic scaling, and dynamically adjusting the Prefill-to-Decode ratio highly challenging.

    Public technical reports suggest a new approach: hybrid attention architectures are shrinking KVCache sizes, transforming cross-datacenter (cross-DC) transmission from “impossible” to “worthy of serious design.” The core of this approach is not simply moving Prefill to a remote site, but rather a combination of model architecture optimization, system-side selective offloading, and bandwidth-aware scheduling. In an internal test using a 1T-parameter hybrid model, this solution increased throughput by 54% and reduced P90 TTFT by 64% compared to a homogeneous PD deployment. While these metrics indicate a valuable direction, they are not universally applicable. To determine whether this path is viable, we must unpack the nature of the problem, the architectural window, and engineering constraints.

    1. The Core Issue: Why PD Disaggregation is Locked by KVCache

    PD disaggregation has become a standard paradigm for large-scale LLM inference. The Prefill phase performs parallel computation on long contexts, consuming significant compute power; the Decode phase generates tokens sequentially, constrained primarily by memory bandwidth and batch processing efficiency. Deploying these two phases on different nodes allows each to scale according to its optimal hardware ratio. However, KVCache acts as the “data bridge” between them: Prefill must hand over the Key/Value cache generated by each attention layer to Decode, or generation cannot continue.

    Research papers often use a metric to describe this pressure: KV throughput (Φkv), which is the amount of KVCache data generated by Prefill per unit of time. For traditional dense attention models, Φkv grows almost linearly with context length. In public examples, a dense attention model processing a 32K token input produces KVCache at a rate of approximately 60 Gbps per instance, which already exceeds the capacity of typical cross-DC Ethernet. Forcing cross-DC transmission under these conditions makes the network a bottleneck, simultaneously degrading both TTFT and throughput. More problematically, once heterogeneous hardware is locked into the same tightly coupled cluster, the hardware ratio for Prefill and Decode is fixed and cannot dynamically adjust to traffic fluctuations. Thus, while “PD disaggregation” works within a single datacenter, it struggles to function across datacenters.

    Therefore, the first threshold for cross-DC transmission is not protocol, but economics and latency: the transmission volume is too large, making bandwidth costs high; transmission takes too long, making first-token latency unacceptable; and network jitter amplifies tail latency. Only when KVCache volume drops significantly can cross-DC designs enter the realm of possibility.

    2. The Window Opened by Hybrid Attention

    Hybrid attention models alternate a small number of full-attention layers with a large number of linear-complexity or sliding-window attention layers. Full-attention layers retain strong long-range modeling capabilities, while linear and sliding-window layers significantly reduce computation and cache growth under long contexts. In public architectures, the ratio of linear/sliding-window layers to full-attention layers ranges from about 3:1 to 7:1. Different layer ratios yield different KVCache reduction rates, but the direction is consistent: KV growth under long contexts is drastically compressed.

    At the 32K token level, the KV throughput of a hybrid architecture can drop by an order of magnitude. The significance of this change is that cross-DC standard Ethernet shifts from “completely unfeasible” to “designable within budget.” Previously, KV output at the 60 Gbps level required dedicated high-speed networks and tightly coupled deployments; after reduction, transmission time, bandwidth consumption, and cost all fall within schedulable ranges. Hybrid attention also brings a systemic benefit: Prefill clusters and Decode clusters can be deployed heterogeneously. Prefill can use high-compute clusters to handle long contexts, while Decode uses clusters optimized for memory bandwidth for generation, with both scaling independently.

    However, it must be emphasized that model-side reduction is a necessary condition, not a sufficient one. If all Prefill operations are indiscriminately offloaded to remote sites, short requests will bear unnecessary cross-DC RTT penalties; if transmissions are forced during network congestion, tail latency will rebound. What is truly viable is “selective offloading + bandwidth-aware scheduling.”

    3. System Design: From “Can it be transmitted?” to “Is it worth transmitting?”

    A practical cross-DC PD architecture typically includes a local PD cluster, a remote Prefill cluster, a routing and scheduling layer, a KVCache transmission layer, and a monitoring/fallback mechanism. The core workflow is: a request enters the routing layer, which estimates context length, model layer configuration, and KV volume; if offloading conditions are met, Prefill is sent to the remote high-compute cluster; after the remote cluster generates the KVCache, it is transmitted back in chunks; the local Decode pipeline receives it and continues generation.

    The criteria for selective offloading cannot rely solely on context length. At least four factors should be integrated:

    1. Estimate the ratio of Φkv to available network bandwidth; if transmission time exceeds the TTFT budget, execute locally.
    2. Check remote Prefill queue latency to avoid sending requests to more congested clusters.
    3. Evaluate request SLA; interactive short requests should prioritize local execution, while offline long documents can be processed remotely.
    4. Assess network P90 margin and packet loss rate; do not make decisions based solely on average bandwidth.

    The pseudocode below illustrates this:

    1. def route_prefill(req, local_cluster, remote_cluster, network):
    2. kv_bytes = estimate_kv_bytes(req.context_len, req.model_layers)
    3. kv_rate = kv_bytes / estimate_prefill_time(req, remote_cluster)
    4. if req.context_len < local_threshold:
    5. return LOCAL
    6. if kv_rate > network.available_bw_p90 * safety_factor:
    7. return LOCAL
    8. if remote_cluster.queue_delay + kv_bytes / network.available_bw_p90 > req.ttft_budget:
    9. return LOCAL
    10. return REMOTE_WITH_CHUNKED_KV

    Bandwidth-aware scheduling must treat KVCache transmission as a first-class citizen. The traditional approach of transmitting everything at once after Prefill completes results in long waits for the first token. A more rational approach is chunked transmission and pipeline overlap: split the KVCache by layer or chunk, transmitting and notifying the local Decode pipeline to prepare simultaneously, reducing idle time after the first chunk arrives. The transmission layer should also support backpressure, priority queues, and adaptive chunk sizing: increase chunk size when network margin is abundant to reduce overhead, and decrease chunk size during congestion to lower tail latency. When precision allows, quantization or compression can be used, but the impact on generation quality must be evaluated; lossless should not be assumed by default.

    Cache lifecycle is equally critical. KVCache transmitted cross-DC should have TTL, eviction policies, and idempotent cache keys to avoid redundant transmissions. If remote Prefill fails, the system should fall back to local recomputation or switch back to homogeneous PD to guarantee SLAs. Cross-DC security requires encrypted transmission, tenant isolation, and auditing. On the cost side, compare “remote compute savings + local Decode utilization improvement” against “cross-DC bandwidth costs + extra RTT,” using Φkv as the capacity planning unit rather than just QPS.

    4. Interpreting Real-World Results

    Internal tests of a 1T-parameter hybrid model showed that the selective offloading solution increased throughput by 54% and reduced P90 TTFT by 64% compared to homogeneous PD deployment. These gains can be understood as follows: long-context Prefill is moved to an independent high-compute cluster, preventing the local PD cluster from being blocked by long Prefills, thereby improving Decode throughput; hybrid attention reduces KV volume, making cross-DC transmission time controllable and reducing first-token wait times; bandwidth-aware scheduling avoids sending requests into congested links, improving tail latency.

    However, these are not universal constants. The benefits depend on the model’s layer ratio, context length distribution, cross-DC RTT, network bandwidth margin, request arrival patterns, and SLAs. When short-context requests dominate, cross-DC RTT may negate the gains; if network P90 margin is insufficient, tail latency will rebound; and different hybrid attention layer ratios yield different KV reduction rates. Therefore, during implementation, start with small-traffic canary testing, monitor P50/P90/P99 TTFT, throughput, network packet loss, and fallback rates, and gradually expand the offload ratio.

    5. Engineering Implementation Checklist

    1. Measure before designing: Analyze the request context length distribution, estimate Φkv under various model configurations, measure cross-DC available bandwidth P90 and RTT, and build a capacity model.
    2. Set offload thresholds and fallback strategies: Route short requests locally and long requests remotely, with automatic fallback during network congestion.
    3. Implement chunked pipeline transmission and backpressure: Avoid large one-time transfers that cause tail latency spikes.
    4. Establish observability: Monitor KV transmission time, first chunk arrival time, remote queue latency, fallback rate, and P90 TTFT.
    5. Ensure security and multi-tenant isolation: Encrypt cross-DC links and isolate cache keys.
    6. Canary release: Gradually increase traffic by tenant or request type.

    In conclusion, the path of cross-DC KVCache transmission has been proven viable under specific conditions, but the premise is the combined effect of KV reduction from hybrid attention, selective offloading on the system side, bandwidth-aware scheduling, and chunked pipeline transmission. It is not as simple as “moving Prefill to a remote site.” It is an inference architecture design that uses Φkv as the capacity unit, TTFT budget as the constraint, and network observability as the guarantee. For scenarios with a high proportion of long contexts, tight Prefill compute resources, and a need for elastic scaling of Decode clusters, this path is worth serious validation; for scenarios dominated by short requests that are sensitive to cross-DC RTT, the boundaries of its benefits should be carefully evaluated.