arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2606.16135cs.DC
收藏

SwiftCache: 面向多轮对话的高效LLM服务与异构KV缓存共享

SwiftCache: Efficient LLM Serving for Multi-turn Conversations with Heterogeneous KV Cache Sharing

Southern University of Science and Technology(南方科技大学);Institute of Computing Technology, CAS(中国科学院计算技术研究所);Alibaba Group(阿里巴巴集团);University of Macau(澳门大学)

Jianmin Hu, Minxian Xu, Sa Wang, Chong Ma, Min Shen, Kejiang Ye, Lin Qu, Chengzhong Xu

AI总结:

针对多轮对话中KV缓存占用显存导致推理延迟高、上下文受限的问题,提出SwiftCache系统,通过异构模型间共享空闲GPU内存和NVLink带宽,仅保留当前层KV缓存,降低延迟并扩展上下文长度。

摘要:

多轮对话是LLM应用中的基本场景,广泛应用于聊天机器人和AI代理。随着对话的进行,历史标记不断累积。现有系统缓存其键值(KV)对以避免冗余计算。然而,有限的GPU内存(HBM)容量通常迫使这些KV缓存被卸载到CPU内存或SSD,使得随着上下文增长,KV缓存重载在延迟方面变得越来越昂贵。同时,受限的HBM容量也限制了最大推理长度,从而限制了对话中可支持的轮数。为了解决这两个挑战,我们提出了SwiftCache,一种协作推理系统,使异构模型能够共享服务器内未充分利用的GPU内存和NVLink带宽。具体来说,KV缓存需求低的模型捐赠空闲GPU内存来存储高需求模型的前缀缓存,从而通过NVLink实现跨模型KV缓存共享,避免缓慢的PCIe传输。SwiftCache通过仅在本地GPU内存中保留当前活动层的KV缓存,进一步减少内存压力,从而实现更长上下文的推理。我们在真实工作负载上的实验表明,与vLLM和SGLang相比,SwiftCache将P99首次令牌生成时间(TTFT)降低了高达69%,并将最大上下文长度扩展了高达3.98倍,同时对共置模型的干扰最小。

英文摘要:

Multi-turn conversation is a fundamental scenario in LLM applications, widely used in chatbots and AI agents. As the conversation evolves, historical tokens accumulate continuously. Existing systems cache their key-value (KV) pairs to avoid redundant computation. However, limited GPU memory (HBM) capacity often forces these KV caches to be offloaded to CPU memory or SSD, making KV cache reloads increasingly costly in terms of latency as the context grows. Meanwhile, the constrained HBM capacity also limits the maximum inference length, thereby restricting the number of turns that can be supported in a conversation. To address these two challenges, we propose SwiftCache, a collaborative inference system that enables heterogeneous models to share underutilized GPU memory and NVLink bandwidth within a server. Specifically, models with low KV cache demand donate idle GPU memory to store the prefix cache of high-demand models, allowing cross-model KV cache sharing over NVLink and avoiding slow PCIe transfers. SwiftCache further reduces memory pressure by keeping only the KV cache of the currently active layer in local GPU memory, thereby enabling longer-context inference. Our experiments on real-world workloads show that SwiftCache reduces P99 time-to-first-token (TTFT) by up to 69% and extends maximum context length by up to 3.98x compared to vLLM and SGLang, with minimal interference to co-located models.

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

↑