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

ForkKV: 通过写时复制的 disaggregated KV 缓存实现多LoRA代理服务的扩展

ForkKV: Scaling Multi-LoRA Agent Serving via Copy-on-Write Disaggregated KV Cache

Shanghai Jiao Tong University(上海交通大学)

Shao Wang, Rui Ren, Lin Gui

AI总结:

ForkKV通过写时复制机制解耦KV缓存,解决多LoRA代理服务中的内存瓶颈问题,提升吞吐量3倍且不影响生成质量。

摘要:

大型语言模型(LLM)的服务范式正在向复杂的多代理工作流转变,其中专门的代理在大规模共享上下文中协作。虽然LoRA能够高效地在单一基础模型上共驻这些专门代理,但在服务过程中引入了关键-值(KV)缓存的内存足迹瓶颈。具体而言,独特的LoRA激活导致KV缓存在不同代理之间发散,使传统前缀缓存无法有效处理共享上下文。这迫使进行冗余的KV缓存维护,快速耗尽GPU容量并降低吞吐量。为了解决这一挑战,我们引入ForkKV,一个针对多LoRA代理工作流的服务系统,其核心是一种新的内存管理范式:基于操作系统中的fork与写时复制(CoW)。通过利用LoRA的结构特性,ForkKV将KV缓存物理解耦为一个大规模共享组件(类似于父进程的内存页面)和轻量级代理特定组件(子进程的页面)。为了支持这一机制,我们提出了DualRadixTree架构,允许新分叉的代理继承大规模共享缓存,并为其轻量级唯一缓存应用CoW语义。此外,为了保证高效执行,我们设计了ResidualAttention,一种专用内核,能够在芯片级SRAM中直接重建解耦的KV缓存。在不同语言模型和实际数据集上的全面评估表明,ForkKV在吞吐量上达到现有最先进的多LoRA服务系统3.0倍,且对生成质量影响极小。

英文摘要:

The serving paradigm of large language models (LLMs) is rapidly shifting towards complex multi-agent workflows where specialized agents collaborate over massive shared contexts. While Low-Rank Adaptation (LoRA) enables the efficient co-hosting of these specialized agents on a single base model, it introduces a critical memory footprint bottleneck during serving. Specifically, unique LoRA activations cause Key-Value (KV) cache divergence across agents, rendering traditional prefix caching ineffective for shared contexts. This forces redundant KV cache maintenance, rapidly saturating GPU capacity and degrading throughput. To address this challenge, we introduce ForkKV, a serving system for multi-LoRA agent workflows centered around a novel memory management paradigm in OS: fork with copy-on-write (CoW). By exploiting the structural properties of LoRA, ForkKV physically decouples the KV cache into a massive shared component (analogous to the parent process's memory pages) and lightweight agent-specific components (the child process's pages). To support this mechanism, we propose a DualRadixTree architecture that allows newly forked agents to inherit the massive shared cache and apply CoW semantics for their lightweight unique cache. Furthermore, to guarantee efficient execution, we design ResidualAttention, a specialized kernel that reconstructs the disaggregated KV cache directly within on-chip SRAM. Comprehensive evaluations across diverse language models and practical datasets of different tasks demonstrate that ForkKV achieves up to 3.0x the throughput of state-of-the-art multi-LoRA serving systems with a negligible impact on generation quality.

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

↑