arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2606.06302cs.LGcs.SE
收藏

Tangram: 解锁非均匀KV缓存以实现高效的多轮LLM服务

Tangram: Unlocking Non-Uniform KV Cache Compression for Efficient Multi-turn LLM Serving

Hanyang University(翰林大学);Rebellions Republic of Korea(Rebellions)

Hyungmin Kim, Minsoo Kim, Hongseok Kim, Jungwook Choi

AI总结:

针对多轮LLM服务中KV缓存线性增长导致的GPU内存和带宽压力,提出Tangram系统,通过确定性预算分配、头组页面和提前负载均衡三项技术实现非均匀KV缓存的高效管理,吞吐量提升达2.6倍。

摘要:

多轮大语言模型(LLM)服务对于一致的用户体验至关重要,但键值(KV)缓存的线性增长给GPU内存和带宽带来了巨大压力。非均匀KV压缩通过考虑每个KV缓存的重要性来有效保留更多信息。然而,这种KV缓存的异质性带来了各种系统挑战——包括内存碎片、调度复杂性和内核利用率降低——这些共同导致现有LLM服务系统的显著低效。为了克服这些挑战,我们提出了Tangram,一种新颖的服务系统,旨在使非均匀KV缓存变得实用。Tangram通过三种核心技术解决系统低效问题:(1)确定性预算分配根据每个头的内在模式为其分配静态内存占用,完全消除动态调度开销和预填充停滞;(2)头组页面将具有相似保留需求的注意力头聚类,并使用独立的向量化页表进行管理,从而最大化物理内存回收;(3)提前(AOT)负载均衡利用静态预算配置文件确保均匀的GPU利用率,无需运行时开销。实验结果表明,与现有基线相比,Tangram在完全保持模型准确性的同时,吞吐量提升高达2.6倍。我们的实现已在https://github.com/aiha-lab/TANGRAM公开。

英文摘要:

Multi-turn LLM serving accumulates dialogue history whose Key-Value (KV) cache grows with every turn and every user, quickly exceeding the model weights themselves and making memory -- not compute -- the binding constraint on throughput. Non-uniform KV compression, which allocates heterogeneous budgets across attention heads, preserves accuracy far better than uniform schemes, yet remains impractical: modern serving stacks assume identical KV lengths across heads, so heterogeneity traps freed memory as page fragmentation, spends up to 25% of prefill time reclaiming scattered pages, and skews GPU workloads that inflate decode latency by up to $1.7\times$ or burn 15--20% of each decode step on re-planning. We observe that this heterogeneity need not be discovered at runtime: head-wise retention follows a two-level structural regularity -- an input-invariant head ranking with narrowly bounded per-head ratios -- that can be calibrated offline from as few as 50 samples. Building on this insight, we present Tangram, a serving framework that statically resolves what prior systems handle dynamically: Budget Reservation fixes each head's post-compression footprint at scheduling time, eliminating page reclamation; Ragged Paging clusters similar-budget heads into independent page tables, turning fragmentation into reclaimable memory; and Ahead-of-Time Load Balancing precomputes balanced GPU partitions with zero runtime planning. Implemented on vLLM, Tangram serves as a drop-in substrate for existing non-uniform compression methods, matching their accuracy while improving end-to-end throughput by up to $2.6\times$ over the full-KV baseline. Our implementation is publicly available at https://github.com/aiha-lab/TANGRAM.

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

↑