PRESERVE: Prefetching Model Weights and KV-Cache in Distributed LLM Serving

Ahmet Caner Yüzügüler, Jiawei Zhuang, Lukas Cavigelli · DOI

Abstract

Distributed Large Language Model (LLM) inference is often bottlenecked by memory bandwidth and communication latency. We present PRESERVE, a graph-optimization framework that accelerates inference by overlapping network communication with the prefetching of model weights and KV-cache from off-chip memory to on-chip L2 cache. By exploiting the idle compute cycles during collective communication operations, PRESERVE achieves up to a 1.6× end-to-end speedup on state-of-the-art models like Llama 3 and Phi-3.

Introduction

Serving modern LLMs requires distributing models across multiple GPUs or NPUs due to their massive size. This distribution introduces two primary performance hurdles: the "Memory Wall," where the decoding phase is limited by the bandwidth of off-chip High Bandwidth Memory (HBM), and "Communication Idle Time," where compute cores remain underutilized during synchronization operations like allreduce. While operator fusion has been proposed to mitigate these issues, it often fails to address the significant memory footprint of the KV-cache and is difficult to implement across diverse operations.

The PRESERVE Framework

PRESERVE addresses these bottlenecks by treating memory access as a task that can be scheduled in parallel with network traffic. The framework employs three core strategies:

  1. Parallel Prefetching: While the chip waits for an allreduce operation to complete, PRESERVE utilizes a parallel execution stream to fetch weights and KV-cache for the subsequent layer from HBM into the on-chip L2 cache.
  2. Automated Graph Insertion: As a compiler-level optimization, PRESERVE analyzes the model's computation graph and automatically inserts prefetch instructions, removing the need for manual developer intervention.
  3. Intelligent Cache Management: To avoid cache pollution, the framework monitors L2 cache usage during compilation, ensuring that only the amount of data the hardware can safely hold is prefetched.
Comparison of inference strategies: Vanilla, Fused Kernels, and PRESERVE.

Key Insights: Weights and L2 Cache

A critical observation behind PRESERVE is that while layer activations depend on previous outputs, model weights and existing KV-cache entries are static during a single decoding step. This allows them to be moved to the cache well before computation begins. Furthermore, as models are partitioned across more devices (increasing tensor parallelism), the weight "shards" assigned to each chip increasingly fit within modern, large L2 caches (128MB–256MB).

Experimental Evaluation

The researchers evaluated PRESERVE using a variety of open-source LLMs, including Llama 3 (8B to 405B), Qwen 2 (7B to 110B), Phi-3, and Mistral/Mixtral variants. Experiments were conducted on Huawei Atlas 800T A2 servers equipped with Ascend 910B NPUs.

Key Results

  • End-to-End Speedup: PRESERVE achieved significant performance gains, reaching up to a 1.6× speedup on Llama3-8B and Phi3-small.
  • Scaling and Context Length: The benefits of PRESERVE scale with the number of chips, as more communication time becomes available to hide prefetching. Additionally, the framework is particularly effective for long-context windows where the KV-cache bottleneck is most pronounced.
  • Comparison to Fusion: PRESERVE consistently outperforms traditional "fused GEMM+Allreduce" kernels in low-latency online serving scenarios (small batch sizes) because it successfully overlaps KV-cache reads, which fusion methods typically ignore.
End-to-end speedup heatmaps for Llama3-70B, Qwen2-72B, and Phi3-medium across varying batch sizes and sequence lengths.

Conclusion and Future Work

PRESERVE demonstrates that prefetching is a powerful tool for bridging the gap between compute and memory bandwidth in distributed LLM serving. While its effectiveness decreases at very large batch sizes where systems become compute-bound, it offers substantial gains for the most common serving scenarios. These findings suggest a shift in hardware design priorities, favoring larger on-chip cache capacities to better support prefetching strategies.

Summary updated

BibTeX
@misc{yuzuguler2025preserve,
  author = {Ahmet Caner Yüzügüler and Jiawei Zhuang and Lukas Cavigelli},
  title = {{PRESERVE: Prefetching Model Weights and KV-Cache in Distributed LLM Serving}},
  year = {2025},
  eprint = {2501.08192},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.08192},
}
Figure