KV Cache Broadcasting for LLM Inference: Communication Optimization on Domestic AI Accelerators

    This article explains how KV cache broadcasting reduces communication overhead in large language model inference, especially on domestic AI accelerator clusters where interconnect bandwidth varies across device and node levels. It covers the role of broadcasting alongside layered splitting (Layersplit), mixed-precision cache constraints, placement in disaggregated serving architectures, performance evaluation methods, and common pitfalls, along with practical engineering recommendations.

    1. Background: The Bottleneck Is Shifting from Compute to Data Movement

    LLM inference is typically divided into two phases: prefill, which processes the entire input at once and is compute-intensive, and decode, which generates tokens one by one and is memory-access-intensive. The two phases have completely different KV cache read/write patterns, yet they often run on the same set of devices and compete for resources. As clusters scale up and parallelism strategies stack, what actually slows down end-to-end latency is often not matrix multiplication, but the communication overhead from repeatedly moving and rearranging the KV cache between devices and across nodes.

    On domestic AI accelerator clusters, this problem is amplified: interconnect bandwidth differs significantly across hierarchy levels, cross-node links are relatively more expensive, and available collective communication implementations are more limited. As a result, the focus of inference stack optimization is shifting from “adding more compute” to “reducing unnecessary data movement and increasing the effective payload of each transfer.”

    2. What KV Cache Broadcasting Does

    KV cache broadcasting can be understood as a communication scheduling strategy for cache shards: when parallel partitioning leaves each device holding only part of the attention cache, the required data is spread to the execution units that need it through a single send and multiple receives, instead of having every consumer pull its own copy.

    Its value comes mainly from three points:

    • Collapsing repeated point-to-point transfers into a single multicast-style spread, reducing link occupancy;
    • Aligning communication timing with compute phases to reduce waiting bubbles during decode;
    • Working with layered partitioning so that “splitting apart” and “getting it back” form a closed loop.

    It is worth stressing that broadcasting is not unconditionally faster. It suits scenarios with “one piece of data, multiple consumers”; if the data is used by only one execution unit, broadcasting introduces extra synchronization cost instead. The criterion is simple: look at reuse.

    3. Coordinating with Layered Partitioning

    Layered splitting (Layersplit) decides “where to put things,” while broadcasting decides “how to fetch them.” The two must be designed as a pair; otherwise two typical failures appear: after splitting, no one is responsible for fetching the data back, so attention computation reads empty shards; or the fetch granularity is too fine, communication counts explode, and the optimization is canceled out.

    The following pseudocode illustrates the idea of “deciding broadcast scope by layer ownership”:

    1. # Pseudocode: scheduling logic only, not a concrete API
    2. def decode_step(layer_id, tokens):
    3. owner = layer_owner_map[layer_id] # device group that owns this layer's cache
    4. if is_first_consumer(owner, tokens):
    5. kv = local_cache_slice(layer_id) # the owner reads its local shard
    6. broadcast(group=owner, payload=kv) # one spread to consumers in the group
    7. else:
    8. kv = recv_from_group(owner) # other units receive directly
    9. return attention(tokens, kv)

    In practice, it is recommended to define broadcast groups with intra-node interconnect first and cross-node links second, and to reuse a fixed address for the broadcast buffer to avoid repeatedly allocating GPU memory at every step.

    4. New Constraints from Mixed-Precision Caches

    When the cache holds multiple numerical precisions at the same time (for example, a mixed-cache scheme combining high precision with low-bit quantization), the broadcast payload is no longer a single type. Three things must be made explicit: the byte layout and alignment of each precision shard, whether the broadcast granularity matches it, and whether dequantization happens on the sender or the receiver.

    Putting dequantization on the receiver minimizes broadcast volume but consumes compute on the receiving side; putting it on the sender does the opposite. A common compromise in practice is to choose precision by layer sensitivity, choose the dequantization location by link cost, and pass unified descriptors (layer ID, shard range, precision tag) along with the payload so the receiver can reassemble it correctly.

    5. Where It Fits in Disaggregated Architectures

    Production inference services often adopt a disaggregated deployment that separates encoding, prefill, and decode. The position of cache broadcasting is critical here: it mainly happens at the handoff where prefill produces the cache and the decode side consumes it, and on the reuse path across multiple layers during decode.

    When implementing it, focus on the following checklist:

    1. Handoff protocol: whether cache metadata and data are transferred separately, with metadata sent first so connections can be established early;
    2. Lifecycle: whether cache allocation, reuse, and eviction are consistent with broadcast timing, to avoid reading released shards;
    3. Observability: collecting communication volume, wait time, and retransmissions through monitoring, alerting, and logging services to form a comparable baseline;
    4. Elastic scaling: after instances scale up or down on the container platform, broadcast groups must be rebuilt automatically rather than relying on static configuration.

    6. How to Evaluate Performance

    Evaluating this kind of optimization cannot rely on single-point latency alone; it requires layered metrics: end-to-end time to first token, per-token decode latency, the share of bandwidth taken by communication, and hardware cost per token. The method is a controlled experiment under the same workload: fix the input length distribution and concurrency, and switch only the communication strategy, so the gains can be attributed clearly. If end-to-end improvement is obvious but decode latency has not moved, the gain usually comes from scheduling and queuing improvements rather than the cache movement itself.

    7. Common Pitfalls

    • Blindly expanding broadcast scope: broadcasting data with a single consumer yields a negative net gain;
    • Ignoring alignment: under mixed precision, misalignment causes the receiver to parse incorrectly;
    • Optimizing communication without optimizing layout: with an unreasonable partitioning strategy, broadcasting merely moves the bottleneck elsewhere;
    • Lacking a fallback switch: production should keep a configuration option to switch back to point-to-point transfer with one action.

    8. Conclusion

    The essence of KV cache broadcasting is reallocating the cost structure of “compute versus data movement” under the interconnect characteristics of domestic AI accelerators. Together with layered splitting, mixed-precision caches, and disaggregated deployment, it forms a complete solution: partitioning decides data distribution, broadcasting decides data reachability, and scheduling decides whether the two are aligned. For developers, the value of mastering this approach is that throughput and cost efficiency of inference services can be steadily improved through coordinated design of communication and layout, without replacing hardware.