TideKV:基于分层分块预填充的延迟KV驱逐技术,用于内存高效的长上下文大语言模型推理
TideKV: Delayed KV Eviction via Layer-Wise Chunked Prefill for Memory-Efficient Long-Context LLM Inference
AI总结:
TideKV提出分层优先延迟驱逐的GPU端缓存架构,通过在层结束时执行KV驱逐,在保留缓存实用性的同时,大幅降低长上下文LLM推理的构建阶段内存占用,扩展了可行的上下文长度。
摘要:
长上下文大语言模型(LLM)推理对现代智能应用至关重要,但在提示词预填充阶段仍受限于峰值内存。现有KV缓存压缩技术可降低解码阶段内存消耗,但通常需要完整提示词预填充以保留全局上下文,导致构建阶段峰值内存仍较高。在线分块级驱逐技术虽能更早降低内存,但在每层未观察到完整提示词前就进行选择,可能会降低缓存构建和解码性能。本文提出TideKV,一种采用分层优先延迟驱逐的GPU端缓存构建架构。TideKV处理每个Transformer层内的所有提示词分块,仅为当前激活层保留完整提示词的KV缓存,并在层结束时执行驱逐。该调度方案既保留了感知完整提示词的选择能力,又减少了激活内存和临时内存。在多个计算平台上的实验表明,TideKV可保留所评估压缩方法的推理质量和最终缓存大小。在A100平台上处理64K数据时,它将构建阶段的瞬时内存占用降低了83.89%;在RTX 4090平台上,处理64K数据时它将首token生成时间仅增加1.06%,并支持128K提示词预填充;在Jetson平台上,TideKV也能完成128K数据处理,而匹配的预填充后压缩方案在这两个资源受限平台上均会内存耗尽。这些结果表明,层结束时的延迟驱逐可在不牺牲缓存实用性的前提下大幅扩展可行的上下文长度。
英文摘要:
Long-context large language model (LLM) inference is important for modern intelligent applications but remains constrained by peak memory during prompt prefill. Existing KV cache compression reduces decoding memory but typically requires full-prompt prefill to preserve global context, retaining a high construction peak. Online chunk-level eviction lowers memory earlier but selects before each layer has observed the complete prompt, potentially degrading cache construction and decoding. We present TideKV, an on-GPU cache-construction architecture using layer-major delayed eviction. TideKV processes all prompt chunks within each Transformer layer, retains full-prompt KV only for the active layer, and evicts at layer end. This schedule preserves full-prompt-aware selection while reducing activation and temporary memory. Experiments across multiple computing platforms show that TideKV preserves the inference quality and final cache size of the evaluated compression methods. At 64K on A100, it reduces the construction-time transient footprint by 83.89%. On RTX 4090, it increases time to first token by only 1.06% at 64K and enables 128K prefill. TideKV also completes 128K on Jetson, whereas matched post-prefill compression runs out of memory on both resource-constrained platforms. These results show that delayed layer-end eviction substantially expands feasible context lengths without sacrificing cache utility.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。