arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.09526cs.DCcs.LG
收藏

LoongServe:基于弹性序列并行的长上下文大语言模型高效服务系统

LoongServe: Efficiently Serving Long-Context Large Language Models with Elastic Sequence Parallelism

Shanghai AI Lab(上海人工智能实验室)

Bingyang Wu, Shengyu Liu, Yinmin Zhong, Peng Sun, Xuanzhe Liu, Xin Jin

AI总结:

针对长上下文LLM服务中资源利用率低的问题,提出弹性序列并行范式并构建LoongServe系统,从计算、通信、内存三方面优化,在真实数据集上实现最高5.81倍的吞吐量提升。

摘要:

大语言模型(LLM)的上下文窗口正在快速扩大,导致不同请求之间以及同一请求的不同阶段之间资源使用差异巨大。受限于静态并行策略,现有LLM服务系统无法高效利用底层资源来服务不同阶段的可变长度请求。为解决这一问题,我们提出了一种新的并行范式——弹性序列并行(elastic sequence parallelism, ESP),可弹性适配不同请求和阶段之间的差异。基于ESP,我们设计并构建了LLM服务系统LoongServe,它具备三大特性:(1)通过实时弹性调整并行度提升计算效率;(2)通过降低键值缓存迁移开销、将部分解码通信与计算重叠来提升通信效率;(3)通过减少实例间键值缓存碎片提升GPU内存效率。我们在多种真实世界数据集上的评估表明,与分块预填充(chunked prefill)相比,LoongServe将最大吞吐量提升了最高3.85倍,与预填充-解码分离架构(prefill-decoding disaggregation)相比提升了最高5.81倍。

英文摘要:

The context window of large language models (LLMs) is rapidly increasing, leading to a huge variance in resource usage between different requests as well as between different phases of the same request. Restricted by static parallelism strategies, existing LLM serving systems cannot efficiently utilize the underlying resources to serve variable-length requests in different phases. To address this problem, we propose a new parallelism paradigm, elastic sequence parallelism (ESP), to elastically adapt to the variance between different requests and phases. Based on ESP, we design and build LoongServe, an LLM serving system that (1) improves computation efficiency by elastically adjusting the degree of parallelism in real-time, (2) improves communication efficiency by reducing key-value cache migration overhead and overlapping partial decoding communication with computation, and (3) improves GPU memory efficiency by reducing key-value cache fragmentation across instances. Our evaluation under diverse real-world datasets shows that LoongServe improves the maximum throughput by up to 3.85$\times$ compared to the chunked prefill and 5.81$\times$ compared to the prefill-decoding disaggregation.

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

↑