2023 · 1.1K citations · 16 references
ComputingComputer ScienceComputer SystemsMemoryOperating SystemsVirtualizationCachingCaching StrategiesMemory HierarchyMemory Hierarchy OptimizationMemory ManagementVirtual MemoryAttentionCache MemoryKey-value Cache ManagementKey-value StoresLarge Language ModelsRedundant ComputationVirtual Memory ManagementVirtual Memory Systems
High‑throughput LLM serving requires batching many requests, but existing systems waste KV cache memory through fragmentation and duplication, limiting batch size. To eliminate this waste, the authors propose PagedAttention, an attention algorithm inspired by virtual‑memory paging. They implement PagedAttention in the vLLM serving system, which achieves near‑zero KV cache waste and allows flexible sharing of cache within and across requests. Evaluations show that vLLM boosts throughput of popular LLMs by 2–4× at comparable latency, with larger gains for longer sequences, bigger models, and more complex decoding. The vLLM source code is available at https://github.com/vllm-project/vllm.
High throughput serving of large language models (LLMs) requires batching sufficiently many requests at a time. However, existing systems struggle because the key-value cache (KV cache) memory for each request is huge and grows and shrinks dynamically. When managed inefficiently, this memory can be significantly wasted by fragmentation and redundant duplication, limiting the batch size. To address this problem, we propose PagedAttention, an attention algorithm inspired by the classical virtual memory and paging techniques in operating systems. On top of it, we build vLLM, an LLM serving system that achieves (1) near-zero waste in KV cache memory and (2) flexible sharing of KV cache within and across requests to further reduce memory usage. Our evaluations show that vLLM improves the throughput of popular LLMs by 2--4× with the same level of latency compared to the state-of-the-art systems, such as FasterTransformer and Orca. The improvement is more pronounced with longer sequences, larger models, and more complex decoding algorithms. vLLM's source code is publicly available at https://github.com/vllm-project/vllm.
16
Deep Residual Learning for Image Recognition
Kaiming He, Xiangyu Zhang, Shaoqing Ren et al. · 2016 · 222.1K citations · Full text
Transformers: State-of-the-Art Natural Language Processing
Thomas Wolf, Lysandre Debut, Victor Sanh et al. · 2020 · 8K citations · Full text
2017 USENIX Annual Technical Conference (USENIX ATC'17)
Do Le Quoc, Martin S. Beck, Pramod Bhatotia et al. · 2017 · 3.1K citations
Findings of the 2016 Conference on Machine Translation
Ondřej Bojar, Rajen Chatterjee, Christian Federmann et al. · 2016 · 565 citations · Full text
FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
Tri Dao, Daniel Y. Fu, Stefano Ermon et al. · arXiv (Cornell University) · 2022 · 459 citations · Full text