arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.18292cs.DC
收藏

Jenga: 面向异构大语言模型服务的高效内存管理

Jenga: Effective Memory Management for Serving LLM with Heterogeneity

Chen Zhang, Kuntai Du, Shu Liu, Woosuk Kwon, Xiangxi Mo, Yufeng Wang, Xiaoxuan Liu, Kaichao You, Zhuohan Li, Mingsheng Long, Jidong Zhai, Joseph Gonzalez, Ion Stoica

AI总结:

针对现代LLM异构性带来的内存分配新挑战,本文提出Jenga两级内存分配框架,在vLLM上实现后可显著提升GPU内存利用率与服务吞吐量。

摘要:

大语言模型(LLM)应用广泛但运行成本高昂,尤其是随着推理工作负载不断增长,成本问题愈发突出。为降低成本,通过高效管理GPU内存来最大化请求批大小至关重要。尽管近期已有PagedAttention(分页注意力)被提出以提升内存管理效率,但我们发现,现代LLM架构在嵌入维度、注意力机制和访问模式上日益增长的异构性,给内存分配带来了新的挑战。\n 本文提出Jenga,一种面向LLM中异构嵌入的新型内存分配框架。Jenga解决两大核心挑战:(1)在管理不同大小的嵌入时最小化内存碎片;(2)支持针对不同层特定令牌依赖模式定制的灵活缓存与驱逐策略。Jenga采用两级内存分配器,利用嵌入大小的最小公倍数(LCM)优化内存使用,并提供API以表达层特定的缓存逻辑,提升内存复用率。\n 我们在前沿LLM推理引擎vLLM上实现了Jenga,并使用多种LLM、数据集和GPU配置对其进行评估。实验结果表明,Jenga将GPU内存利用率提升最高达79.6%,服务吞吐量最高提升4.92倍(平均提升1.80倍)。

英文摘要:

Large language models (LLMs) are widely used but expensive to run, especially as inference workloads grow. To lower costs, maximizing the request batch size by managing GPU memory efficiently is crucial. While PagedAttention has recently been proposed to improve the efficiency of memory management, we find that the growing heterogeneity in the embeddings dimensions, attention, and access patterns of modern LLM architectures introduces new challenges for memory allocation. In this paper, we present Jenga, a novel memory allocation framework for heterogeneous embeddings in LLMs. Jenga tackles two key challenges: (1) minimizing memory fragmentation when managing embeddings of different sizes, and (2) enabling flexible caching and eviction policies tailored to the specific token-dependency patterns of various layers. Jenga employs a two-level memory allocator, leveraging the least common multiple (LCM) of embedding sizes to optimize memory usage and providing APIs to express layer-specific caching logic to enhance memory reuse. We implemente Jenga on vLLM, a state-of-the-art LLM inference engine, and evaluate it with diverse LLMs, datasets, and GPU configurations. Evaluations show that Jenga improves GPU memory utilization by up to 79.6%, and increases serving throughput by up to 4.92x (1.80x on average).

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑