KV cache management is essential for efficient LLM inference. To maximize utilization, existing inference engines evict finished requests' KV cache if new requests are waiting. This policy breaks for agentic workloads, which interleave LLM calls with tools, introducing pauses that prevent effective KV reuse across turns. Since some tool calls have much shorter durations than human response multi-turn chatbot, it would be promising to retain the KV cache in during these tools. However, there are many challenges. First, we need to consider both the potential cost of recomputation or reloading (if CPU offloading enabled) and the increasing queueing delays after eviction from GPU. Second, due to the internal variance of tool call durations, we need the method to remain robust under limited predictability of tool call durations. We present Continuum, a serving system to optimize job completion time for multi-turn agent workloads by introducing time-to-live mechanism for KV cache retaining. For LLM request that generates a tool call, Continuum selectively pins the KV cache in GPU memory with a time-to-live value determined by considering both the reload cost and ordering preserve benefit of retaining KV cache. Moreover, when the TTL expires, the KV cache can be automatically evicted to free up GPU memory, providing robust performance under edge cases. When combined with program-level first-come-first-serve, Continuum preserves multi-turn continuity, and reduces delay for complex agentic workflows. Our evaluation on real-world agentic workloads (SWE-Bench and BFCL) with Llama-3.1 8B/70B shows that Continuum significantly improves the average job completion times and its improvement scales with turn number increase. We release a preview version at: https://github.com/Hanchenli/vllm-continuum


翻译:KV缓存管理对于高效LLM推理至关重要。为最大化资源利用率,现有推理引擎会在新请求等待时驱逐已完成请求的KV缓存。该策略在处理智能体工作负载时失效,因为此类工作负载将LLM调用与工具调用交错执行,其引入的暂停会阻碍跨轮次的KV缓存有效复用。由于某些工具调用的持续时间远短于人类响应的多轮对话场景,在这些工具执行期间保留KV缓存具有显著潜力。然而,这面临诸多挑战:首先,需同时权衡重计算(或启用CPU卸载时的重加载)潜在成本与KV缓存从GPU驱逐后引发的队列延迟增长;其次,受工具调用持续时间的内部方差影响,方法需在工具调用时长可预测性有限的条件下保持鲁棒性。本文提出Continuum——一种通过引入KV缓存保留生存时间机制来优化多轮智能体工作负载任务完成时间的服务系统。针对生成工具调用的LLM请求,Continuum通过综合考虑重加载成本与KV缓存保留的顺序保持效益,动态确定生存时间值并选择性地将KV缓存固定于GPU内存。此外,当生存时间到期时,系统可自动驱逐KV缓存以释放GPU内存,确保在边缘情况下仍保持鲁棒性能。结合程序级先到先服务策略,Continuum能够保持多轮任务连续性,并降低复杂智能体工作流的延迟。基于真实智能体工作负载(SWE-Bench与BFCL)及Llama-3.1 8B/70B模型的实验表明,Continuum显著改善了平均任务完成时间,且其优化效果随轮次数增加而提升。预览版本发布于:https://github.com/Hanchenli/vllm-continuum

0
下载
关闭预览

相关内容

Python图像处理,366页pdf,Image Operators Image Processing in Python
NAACL 2019 | 一种考虑缓和KL消失的简单VAE训练方法
PaperWeekly
20+阅读 · 2019年4月24日
LibRec 每周算法:LDA主题模型
LibRec智能推荐
29+阅读 · 2017年12月4日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员