paperbot · PL 论文追踪

全部论文 待读 收藏

P2 vAttention: Dynamic Memory Management for Serving LLMs without PagedAttention

vAttention:无需 PagedAttention 的 LLM 服务动态内存管理
ASPLOS Proceedings of the 30th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 12025匹配度 2/10 · 该论文属于 LLM 服务系统的 GPU 内存管理优化,虽涉及机器学习与程序语言/运行时标签,但核心是 PagedAttention 的替代方案与吞吐提升,不涉及静态分析、Agentic 程序、浮点程序分析或贝叶斯程序分析,与用户研究画像基本无关。引用 138 inbox
Ramya Prabhu, Ajay Nayak, Jayashree Mohan, Ramachandran Ramjee, Ashish Panwar
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:通过解耦虚拟与物理内存分配,在保持 KV cache 虚拟内存连续性的同时缓解碎片,提升 LLM 服务吞吐。

PagedAttention 是 LLM 服务系统中常用的动态显存分配方案,可按需分配 GPU 内存以缓解 KV cache 碎片,从而提升批大小与吞吐。然而,它在运行时分配物理内存时把 KV cache 的虚拟内存布局从连续变为非连续,带来显著的编程与性能开销。本文提出 vAttention,在缓解物理内存碎片的同时保留 KV cache 的虚拟内存连续性。其核心思路是利用 CUDA 虚拟内存管理 API 将虚拟内存与物理内存的分配解耦,并针对 CUDA 虚拟内存支持的局限引入多项 LLM 专用优化。评估表明,vAttention 是比 PagedAttention 更简单、可移植且性能更优的替代方案:它开箱即用地支持多种 attention kernel,相比使用 FlashAttention-2 与 FlashInfer 的 PagedAttention kernel,LLM 服务吞吐最高提升 1.23 倍。

问题
PagedAttention 虽能按需分配显存以缓解 KV cache 碎片,但会破坏 KV cache 的虚拟内存连续性,导致非平凡的编程复杂度和性能开销。
方法
利用 CUDA 虚拟内存管理 API 解耦虚拟内存与物理内存的分配,保留 KV cache 的虚拟内存连续性,并引入针对 LLM 的优化以弥补 CUDA 虚拟内存支持的不足。
评估
与基于 PagedAttention 的 FlashAttention-2 和 FlashInfer kernel 对比,vAttention 开箱即用地支持多种 attention kernel,服务吞吐最高提升 1.23 倍。
原文摘要(Abstract)

PagedAttention is a popular approach for dynamic memory allocation in LLM serving systems. It enables on-demand allocation of GPU memory to mitigate KV cache fragmentation - a phenomenon that crippled the batch size (and consequently throughput) in prior systems. However, in trying to allocate physical memory at runtime, PagedAttention ends up changing the virtual memory layout of the KV cache from contiguous to non-contiguous. Such a design leads to non-trivial programming and performance overheads. We present vAttention - an approach that mitigates fragmentation in physical memory while retaining the virtual memory contiguity of the KV cache. We achieve this by decoupling the allocation of virtual and physical memory using CUDA virtual memory management APIs. We also introduce various LLM-specific optimizations to address the limitations of CUDA virtual memory support. Overall, vAttention is a simpler, portable, and performant alternative to PagedAttention: it supports various attention kernels out-of-the-box and improves LLM serving throughput by up to 1.23× compared to the use of PagedAttention-based kernels of FlashAttention-2 and FlashInfer.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{abs-2405-04437,
  title = {vAttention: Dynamic Memory Management for Serving LLMs without PagedAttention},
  author = {Ramya Prabhu and Ajay Nayak and Jayashree Mohan and Ramachandran Ramjee and Ashish Panwar},
  booktitle = {ASPLOS},
  year = {2025},
  doi = {10.1145/3669940.3707256}
}