空闲是相对的:利用工具调用空闲窗口在MORI代理系统中进行卸载
Idleness is Relative: Exploiting Tool-Call Idle Windows for Offloading in Agentic Systems with MORI
AI总结:
提出MORI系统,通过将代理程序按空闲程度连续排序并动态划分内存层级,解决了LLM代理工作负载中KV缓存卸载效率低下的问题。
摘要:
现代LLM服务系统越来越多地承载代理工作负载,其会话会发出数十个模型调用,中间穿插工具调用,并累积可在步骤间重用的KV缓存。由于请求的总KV缓存大小容易超过GPU HBM容量,研究人员将其卸载到CPU DRAM。然而,工具调用的持续时间跨越多个数量级,并且在层级之间传输KV缓存的成本使得在每次调用时替换条目变得不切实际。我们观察到代理程序呈现两阶段结构:快速短工具调用的繁忙阶段和以长时间调用为主的空闲阶段。当前的驱逐策略(如LRU)未能捕捉这一特性。二元的繁忙/空闲标签也不够,因为繁忙程序与空闲程序的比例可能与硬件的GPU与CPU容量比例不匹配。当不匹配时,一个层级利用率不足,而另一个层级过度订阅,浪费内存或导致不必要的驱逐。我们提出了MORI,一个解决上述问题的代理服务系统。我们的关键洞察是,空闲是一个连续的相对频谱。MORI根据空闲程度对所有活动程序进行排序,将最繁忙的分配给GPU HBM,最空闲的分配给CPU DRAM,动态移动分区边界以匹配硬件容量,并在每个内存层级实施准入控制。在从Claude Code收集的真实编码代理工作负载上,跨四个GPU和模型对进行评估,MORI相比最佳卸载基线实现了20-71%的吞吐量提升和18-43%的TTFT降低。
英文摘要:
Agentic programs alternate between LLM inference and tool calls, each request extending the previous one's context. Program-aware schedulers pin a program's KV cache in GPU HBM across tool calls to avoid re-prefilling it at every step, but as contexts grow, pinned KV cache exceeds HBM, raising program eviction: deciding when a program releases GPU memory and when it returns. Offloading to CPU DRAM lets an evicted program wait out a tool call instead of recomputing its context, but existing schedulers leave DRAM to LRU, so offloaded programs thrash. Making these decisions is hard: tool-call durations vary by orders of magnitude and are unknown in advance. We observe that programs nevertheless stay busy (short tool calls) or idle (long ones) for extended periods, and use a program's idleness, its recent fraction of time in tool calls, as a continuous, relative metric. MORI ranks programs by idleness, keeps the least idle in HBM and the next in DRAM, and drops the rest, enforcing admission control at both tiers under any GPU-to-CPU capacity ratio; it also proactively demotes idle programs to make room for ready ones. On real coding-agent traces, MORI achieves on average 64% higher throughput and 72% lower p90 TTFT than the best offloading baseline under high load.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。