Efficient Memory Management for Large Language Model Serving with PagedAttention

计算机科学 寻呼 隐藏物 按需分页 并行计算 内存管理 虚拟内存 缓存着色 缓存污染 页面缓存 延迟(音频) CPU缓存 缓存算法 操作系统 计算机网络 覆盖 电信
作者
Woosuk Kwon,Z. Li,Siyuan Zhuang,Ying Sheng,L Zheng,Cody Hao Yu,Joseph E. Gonzalez,Hao Zhang,Ion Stoica
标识
DOI:10.1145/3600006.3613165
摘要

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.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
刚刚
咿呀喂发布了新的文献求助10
1秒前
鲁世键发布了新的文献求助10
1秒前
1秒前
nsdcdcbdv发布了新的文献求助10
3秒前
隐形曼青应助jack采纳,获得10
3秒前
充电宝应助矮小的猕猴桃采纳,获得10
4秒前
4秒前
4秒前
4秒前
5秒前
勤恳的惊人完成签到,获得积分10
6秒前
FashionBoy应助俭朴夏青采纳,获得10
6秒前
123456发布了新的文献求助10
7秒前
天真飞凤发布了新的文献求助10
8秒前
9秒前
9秒前
精灵梦完成签到,获得积分10
9秒前
上官若男应助Deiu采纳,获得10
10秒前
gan发布了新的文献求助10
11秒前
liujian发布了新的文献求助10
11秒前
12秒前
严小之完成签到,获得积分10
12秒前
12秒前
12秒前
中中发布了新的文献求助10
13秒前
笑傲天行九歌完成签到,获得积分10
13秒前
搬砖人发布了新的文献求助10
13秒前
14秒前
14秒前
14秒前
123456完成签到,获得积分10
15秒前
16秒前
17秒前
酷波er应助鱼儿会飞采纳,获得10
18秒前
科研小裴完成签到,获得积分10
19秒前
yc096vps发布了新的文献求助10
19秒前
董仁杰发布了新的文献求助10
19秒前
今后应助皮卡丘采纳,获得20
20秒前
是吉发布了新的文献求助10
20秒前
高分求助中
Principles of Economics, 11th Edition 10000
Prescott's Microbiology: 2026 Release ISE 10000
University Physics with Modern Physics, 16th edition 10000
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Environmental Leverage in Times of Climate Crisis: Product Standards, Carbon Border Measures and Preferential Trade Agreements 1000
Interactions of Vowel Quality and Prosody in East Slavic 1000
Erwählung und Berufung bei Paulus: Bedeutung, Entwicklung und Funktion einer Vorstellung in ihrem frühjüdischen und griechisch-römischen Kontext 850
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 内科学 物理 复合材料 催化作用 细胞生物学 无机化学 光电子学 物理化学 电极 基因
热门帖子
关注 科研通微信公众号,转发送积分 7173110
求助须知:如何正确求助?哪些是违规求助? 8813784
关于积分的说明 18620791
捐赠科研通 6789546
什么是DOI,文献DOI怎么找? 3168254
关于科研通互助平台的介绍 2310532
邀请新用户注册赠送积分活动 2142894