Retrieval-augmented and agentic workloads repeatedly prefill recurring predictable structured inputs (which we call "spans") such as documents and code files. Yet, prefix caching in engines such as vLLM cannot reuse their KV entries unless they share identical prefixes with another request, while Position-Independent Caching (PIC) implementations within production-grade inference servers typically either require substantial server code changes or keep KV state outside the server, incurring host-to-device transfer overhead. We present Minimalistic PIC (MiniPIC): a minimal, flexible and fast vLLM design built from two ingredients: positional-encoding-free KV cache and user-controlled cache-reuse primitives. MiniPIC stores unrotated K vectors in the KV cache, applies RoPE to K tiles inside attention using per-request logical positions, and exposes three user-facing and token-level primitives: block-aligned padding, span separator (SSep), and prompt depend (PDep), that modify hashing behavior and effective block-level causal attention structure. With fewer than 100 lines of core-engine changes plus a custom attention backend, these primitives are sufficient to realize multiple PIC methods, including Block-Attention, EPIC, and Prompt Cache, within the same running vLLM instance, while natively integrating with KV cache CPU offload implementations. On 2WikiMultihopQA, MiniPIC with interleaved scheduling improves prefill throughput by 49% over baseline vLLM, reduces cached-span time-to-first-token by up to two orders of magnitude, preserves the linear prefill scaling of uncached spans, and incurs only 5.7% worst-case overhead.


翻译:检索增强和智能代理工作负载会频繁预填充可重复出现的结构化输入(我们称之为"段落"),例如文档和代码文件。然而,在vLLM等引擎中使用的前缀缓存机制,除非请求共享相同前缀,否则无法复用KV条目;而生产级推理服务器中的位置无关缓存(PIC)实现,要么需要大量修改服务器代码,要么将KV状态保留在服务器外部,从而产生主机到设备的数据传输开销。我们提出MiniPIC(极简位置无关缓存):一种由两个核心组件构成的轻量、灵活且高效的vLLM设计方案——无需位置编码的KV缓存和用户可控的缓存复用原语。MiniPIC在KV缓存中存储未旋转的K向量,通过按请求逻辑位置对注意力计算中的K块应用RoPE,并暴露三个面向用户的token级原语:块对齐填充(block-aligned padding)、段落分隔符(SSep)和提示依赖(PDep),这些原语可修改哈希行为及有效的块级因果注意力结构。通过不足百行的核心引擎修改代码及自定义注意力后端,这些原语足以在同一个运行的vLLM实例中实现多种PIC方法(包括Block-Attention、EPIC和Prompt Cache),同时原生集成KV缓存CPU卸载方案。在2WikiMultihopQA数据集上,采用交错调度的MiniPIC相较于基准vLLM将预填充吞吐量提升49%,将缓存段的首token生成时间降低多达两个数量级,保持未缓存段线性预填充扩展特性,且最坏情况下的额外开销仅为5.7%。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
《分布式多智能体强化学习的编码》加州大学等
专知会员服务
56+阅读 · 2022年11月2日
八个不容错过的 GitHub Copilot 功能!
CSDN
11+阅读 · 2022年9月22日
【Flink】基于 Flink 的流式数据实时去重
AINLP
14+阅读 · 2020年9月29日
国家自然科学基金
1+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
7+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
5+阅读 · 6月17日
相关基金
国家自然科学基金
1+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
Top
微信扫码咨询专知VIP会员