通过联合压缩与淘汰机制,提升大模型推理速度与内存效率。
EVICPRESS: Joint KV-Cache Compression and Eviction for Efficient LLM Serving
- 统筹管理缓存压缩与淘汰策略,全局优化延迟与质量。
- 在同等生成质量下,首令牌时间最快提升2.19倍。
- 适合高并发大模型服务场景,尤其关注推理效率的用户。
重用键值缓存(KV cache)是提升大语言模型(LLM)推理效率的关键。随着用户增多,KV缓存占用可能超出GPU内存容量,现有方法通常选择将缓存淘汰至低速存储或进行压缩以减少占用。然而,这些方法未充分考虑压缩与淘汰策略在所有上下文间的协同优化,难以最小化平均生成延迟且不损害质量。本文提出EVICPRESS,一种跨多级存储的统一缓存管理机制,结合有损压缩与自适应淘汰。针对每个上下文的缓存,系统综合评估其压缩与淘汰对整体生成质量与延迟的影响,引入统一效用函数量化该影响。通过定期采样更新各配置下的效用分,并采用快速启发式算法在各级存储间调度缓存,最大化每层的总效用分。实验在12个数据集和5个模型上验证,相比仅淘汰或仅压缩的基线,EVICPRESS显著提高高速设备上的缓存命中率,降低延迟,同时对敏感上下文采取保守压缩,保持高质量输出。结果表明,在等效生成质量下,首令牌时间(TTFT)最快提升2.19倍。
原文摘要 · Abstract (English)
Reusing KV cache is essential for high efficiency of Large Language Model (LLM) inference systems. With more LLM users, the KV cache footprint can easily exceed GPU memory capacity, so prior work has proposed to either evict KV cache to lower-tier storage devices, or compress KV cache so that more KV cache can be fit in the fast memory. However, prior work misses an important opportunity: jointly optimizing the eviction and compression decisions across all KV caches to minimize average generation latency without hurting quality. We propose EVICPRESS, a KV-cache management system that applies lossy compression and adaptive eviction to KV cache across multiple storage tiers. Specifically, for each KV cache of a context, EVICPRESS considers the effect of compression and eviction of the KV cache on the average generation quality and delay across all contexts as a whole. To achieve this, EVICPRESS proposes a unified utility function that quantifies the effect of quality and delay of the lossy compression or eviction. To this end, EVICPRESS's profiling module periodically updates the utility function scores on all possible eviction-compression configurations for all contexts and places KV caches using a fast heuristic to rearrange KV caches on all storage tiers, with the goal of maximizing the utility function scores on each storage tier. Compared to the baselines that evict KV cache or compress KV cache, EVICPRESS achieves higher KV-cache hit rates on fast devices, i.e., lower delay, while preserving high generation quality by applying conservative compression to contexts that are sensitive to compression errors. Evaluation on 12 datasets and 5 models demonstrates that EVICPRESS achieves up to 2.19x faster time-to-first-token (TTFT) at equivalent generation quality.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。