arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.06256cs.AI
收藏

RedKnot: 基于头部感知的KV重用和SegPagedAttention的高效长上下文LLM服务

RedKnot: Efficient Long-Context LLM Serving with Head-Aware KV Reuse and SegPagedAttention

Xiaohongshu Inc., China(小红书公司,中国);Peking University(北京大学);Huawei Cloud(华为云)

Yang Liu, Zhaokai Luo, Huayi Jin, Zhiyong Wang, Ruozhou He, Boyu Wang, Guanjie Chen, Yifei Liu, Tao Xie, Junhao Hu

AI总结:

提出RedKnot系统,通过按KV头分解缓存并采用SegPagedAttention,实现位置无关的KV重用、前缀压缩、冷热分离和分布式放置,在不重训练模型的情况下提升资源效率。

摘要:

随着大语言模型(LLM)服务输入长度的持续增长,KV缓存已成为AI基础设施中的主要瓶颈。它限制了GPU内存容量、服务并发性、缓存重用和分布式可扩展性。几个重要问题,包括位置无关的KV缓存、前缀KV缓存压缩、冷/热KV缓存分离和分布式KV缓存管理,都依赖于KV缓存的表示和管理方式。然而,现有的服务系统在很大程度上依赖于单一的KV缓存抽象,其中KV缓存被视为同质的token级内存块序列,并在注意力头和服务场景中采用类似的管理策略。我们观察到,KV缓存的效用在不同KV头之间具有高度结构性:不同的头表现出不同的功能角色、注意力距离和运行时重要性。因此,并非每个头、token范围或服务场景都需要完整的KV缓存。我们提出了RedKnot,一个用于LLM服务的头部感知KV缓存管理系统。RedKnot通过沿KV头分解KV缓存来打破传统的单一KV缓存抽象,这些KV头的重要性和有效注意力范围在不同服务场景中显著变化。这种头部级分解将KV缓存从单一的张量抽象转变为结构化的内存对象,使RedKnot能够统一支持位置无关的KV重用、前缀KV压缩、冷/热KV分离和分布式KV放置,同时保持输出保真度并提高资源效率,无需模型重训练或微调。RedKnot通过将KV缓存从单一的被动运行时工件转变为动态的、模型感知的可扩展LLM服务的运行时基础,为AI基础设施建立了新的基础。

英文摘要:

As the input length of large language model (LLM) serving continues to grow, the KV cache has become a dominant bottleneck in AI infrastructure. It limits GPU memory capacity, serving concurrency, cache reuse, and distributed scalability. Multiple important problems, including position-independent KV cache, prefix KV cache compression, hot/cold KV cache separation, and distributed KV cache management, all depend on how the KV cache is represented and managed. However, existing serving systems largely rely on a monolithic KV cache abstraction, where the KV cache is treated as a homogeneous sequence of token-level memory blocks and managed with similar policies across attention heads and serving scenarios. We observe that KV cache utility is highly structured across KV heads: different heads exhibit different functional roles, attention distances, and runtime importance. Therefore, a full KV cache is not always necessary for every head, token range, or serving scenario. We present RedKnot, a head-aware KV cache management system for LLM serving. RedKnot breaks the conventional monolithic KV cache abstraction by decomposing the KV cache along KV heads, whose importance and effective attention ranges vary significantly across serving scenarios. This head-level decomposition turns the KV cache from a monolithic tensor abstraction into a structured memory object, enabling RedKnot to uniformly support position-independent KV reuse, prefix KV compression, hot/cold KV separation, and distributed KV placement while preserving output fidelity and improving resource efficiency, without requiring model retraining or fine-tuning. RedKnot establishes a new foundation for AI infrastructure by transforming the KV cache from a monolithic, passive runtime artifact into a dynamic, model-aware runtime substrate for scalable LLM serving.

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

↑