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.


翻译:[translated abstract in Chinese] 多轮对话是大语言模型(LLM)应用中的基础场景,广泛应用于聊天机器人和AI代理。随着对话的推进,历史token持续累积。现有系统缓存其键值对(KV cache)以避免重复计算。然而,受限的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倍,同时对同驻模型的干扰极小。

0
下载
关闭预览

相关内容

高效大语言模型推理服务综述
专知会员服务
18+阅读 · 2025年4月30日
大型语言模型对齐技术综述:RLHF、RLAIF、PPO、DPO 等
专知会员服务
55+阅读 · 2024年7月24日
大型语言模型(LLMs)革新金融:应用与洞察概览
专知会员服务
40+阅读 · 2024年3月22日
基于LLM的多轮对话系统的最新进展综述
专知会员服务
58+阅读 · 2024年3月7日
《多模态大型语言模型》最新进展,详述26种现有MM-LLMs
专知会员服务
65+阅读 · 2024年1月25日
对话系统近期进展
专知
37+阅读 · 2019年3月23日
中文NLP福利!大规模中文自然语言处理语料
新智元
37+阅读 · 2019年2月13日
知识在检索式对话系统的应用
微信AI
32+阅读 · 2018年9月20日
多轮对话之对话管理:Dialog Management
PaperWeekly
18+阅读 · 2018年1月15日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
最新内容
《通过小型无人机系统将情报能力“作战化”》
消耗优势:美军的“精确规模化”概念
专知会员服务
8+阅读 · 6月15日
《离线语言支持系统:面向空战战术决策》
专知会员服务
10+阅读 · 6月15日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员