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

KV缓存管理策略在大语言模型推理中的比较分析

Comparative Characterization of KV Cache Management Strategies for LLM Inference

Oteo Mamo, Olga Kogiou, Hyunjin Yi, Weikuan Yu

AI总结:

本文通过实证研究比较了vLLM、InfiniGen和H2O三种KV缓存管理框架,分析了其在内存消耗和推理性能上的权衡,揭示了不同场景下最优的缓存策略配置。

摘要:

高效的大语言模型(LLM)推理越来越多地依赖键值(KV)缓存来存储每层之前计算的键值向量。这些缓存对于减少自回归令牌生成过程中的冗余计算至关重要,将计算复杂度从二次降低到线性。然而,KV缓存的增长带来了显著的系统级挑战,特别是在模型规模增大、上下文长度增长以及并发请求竞争有限内存资源的情况下。尽管已出现几种最近的KV缓存管理框架,但它们在内存消耗和推理性能上的比较权衡尚未完全理解,尤其是在不同请求大小和模型配置下。本文通过实证研究三种最先进的KV缓存管理框架:vLLM、InfiniGen和H2O。这些框架采用张量卸载、令牌驱逐启发式和推测调度等技术来平衡内存使用和性能。我们评估了它们在请求率、模型规模和稀疏水平等关键参数下的延迟、吞吐量和内存使用等多方面指标的性能。我们的结果指出了每个框架在不同条件下表现最佳的条件,揭示了在内存和性能约束下最合适的KV缓存策略选择和配置。

英文摘要:

Efficient inference with Large Language Models (LLMs) increasingly relies on Key-Value (KV) caches to store previously computed key and value vectors at each layer. These caches are essential to minimize redundant computation during autoregressive token generation, lowering computational complexity from quadratic to linear. However, the growth of KV caches has posed significant system-level challenges, particularly as model sizes increase, context lengths grow, and concurrent requests compete for limited memory resources. Even though several recent frameworks for KV cache management have emerged, their comparative trade-offs in memory consumption and inference performance have not been fully understood, especially under varying request sizes and model configurations. In this work, we conduct an empirical study of three state-of-the-art KV cache management frameworks: vLLM, InfiniGen, and H2O. These frameworks employ techniques such as tensor offloading, token eviction heuristics, and speculative scheduling to balance memory usage and performance. We evaluate their performance in terms of a range of metrics such as latency, throughput, and memory usage across a spectrum of key parameters including request rates, model sizes, and sparsity levels. Our results pinpoint the conditions for each framework to perform the best, revealing the most suitable selection and configuration of KV cache strategies under memory and performance constraints.

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

↑