CacheGen使用新的KV编码器将这些特征张量压缩(而不是丢弃或重写)为更紧凑的比特流,从而减少了传输长上下文的 KV 特征所需的带宽。本文提出的KV编码器的设计利用了跨Token和层的KV特征的独特属性,以实现高度的尺寸减小和很少的信息丢失。凭借其KV编码器,CacheGen可以灵活地以不同形式传输上下文,包括多个比特流表示形式...
本文介绍了CacheGen,这是一种用于LLM系统的快速上下文加载模块,旨在(1)减少传输上下文的KV特征所需的带宽,以及(2)最大限度地减少获取和处理上下文的总延迟,而不是单独地减少每个延迟。 CacheGen使用新的KV编码器将这些特征张量压缩(而不是丢弃或重写)为更紧凑的比特流,从而减少了传输长上下文的 KV 特征所需的带宽...
CacheGen is a fast context-loading module for LLM systems. First, CacheGen uses a custom tensor encoder, whichembraces KV cache’s distributional properties, toencodeaKV cache into more compact bitstream representations withnegligible encoding/decoding overhead. This reduces...
LMCache: The modules for KV cache encoding / decoding with CacheGen's customized codec test_data: The example testing cases for CacheGen. src: Some helper functions used by CacheGen (e.g., transforming tensor to tuple, transforming tuple to tensor etc.) ...
# CacheGen: Fast Context Loading for Language Model Applications via KV Cache Streaming This is the code repo for [CacheGen: Fast Context Loading for Language Model Applications via KV Cache Streaming](https://arxiv.org/pdf/2310.07240.pdf). **For the latest update and integration, please ch...
Figure 1: When the context is reused, CacheGen speeds up the sharing of its KV cache by compressing (encoding) the KV cache.表1:CacheGen与基线在Mistral-7B上使用LongChat数据集[90]的表现。完整结果见§7。 Table 1: Performance of CacheGen and the baselines on Mistral-7B with LongChat dataset...
CacheGen:KV Cache Compression and Streaming for Fast Large Language Model Serving 对CacheGen的关键部分进行解读 KV 缓存的经验见解 我们重点介绍了关于 KV 缓存值特性的三个观察结果。 虽然从本质上讲,很难证明它们适用于任何具有任何上下文的 LLM, 但在这里,我们使用一个代表性的工作负载来经验性地证明这些观察...
最近在调查LLM推理时KV Cache压缩的事,发现了 CacheGen这篇工作做的很好,简单做一个阅读笔记。这篇论文发布在SIGCOMM 2024,主要解决KV Cache在网络传输中的带宽问题,可以将KV Cache的大小减少3.5-4.3 倍。 基…
第一幅图是普通的推理,第二幅是加kv cache了,第三幅就外挂一个cache,这个cache就可以在多个序列之间cache已经算出来的logit,那它咋识别的? 答案是PML 像上图所示 PML明确定义可重用的文本段,称为提示模块(prompt modules)。PML确保在重用注意力状态时位置的准确性,并为用户提供了一个接口来访问他们的提示中的缓...
First, CacheGen uses a custom tensor encoder, which embraces KV cache’s distributional properties, to encode a KV cache into more compact bitstream representations with negligible encoding/decoding overhead. This reduces the bandwidth demand to fetch the KV cache. Second, to maint...