Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Efficient Memory Management for Large Language Model Serving with PagedAttention

About

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$\times$ 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

Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph E. Gonzalez, Hao Zhang, Ion Stoica• 2023

Related benchmarks

TaskDatasetResultRank
Text-to-SQLBIRD (dev)
Execution Accuracy (EA)61.5
217
Text-to-SQLSpider (dev)--
100
Long-context Language UnderstandingInfiniteBench
En.Sum20.36
63
LLM DecodingLlama 70B 3.1
Throughput462
48
Online InferenceShareGPT--
32
LLM DecodingLlama 70B (H100 GPU Cluster) 3.1
Throughput865.4
27
Large Language Model ThroughputShareGPT v3
Throughput (req/s)5.03
24
LLM InferenceToolBench
Goodput (req/s)2.91
18
LLM InferenceMerge
Goodput (req/s)0.22
18
Long-context Language UnderstandingLongBench-e (test)
LCC (Language Comprehension Score)67.53
16
Showing 10 of 28 rows

Other info

Follow for update