arXiv:2511.03092cs.AIcs.AR2025-11被引 2

提出SnapStream,高效压缩大模型长序列推理的键值缓存,提升内存利用率。

SnapStream: Efficient Long Sequence Decoding on Dataflow Accelerators

  • 设计可集成于静态图与连续批处理框架的稀疏键值缓存压缩方法
  • 在128k上下文长度下实现4倍内存优化,吞吐达1832词元/秒
  • 适用于工业级部署,对主流评测任务影响极小,适合大模型生产环境

随着支持超10万上下文长度的百亿参数以上大语言模型日益普及,对片上内存以支撑大规模键值缓存的需求激增。尽管StreamingLLM和SnapKV等技术能控制缓存大小并保持模型精度,但因vLLM、SGLang等工业框架采用静态图与连续批处理机制,难以集成此类修改。同时,这些技术对现代指令跟随与推理模型的精度影响尚不明确,制约其应用。本文针对Llama-3.1-8B-Instruct与DeepSeek-R1进行评估,提出SnapStream,一种可规模化部署的键值缓存压缩方法。在16路张量并行的DeepSeek-671B部署中,使用SambaNova SN40L加速器,在128k上下文长度下达到最高1832词元/秒的吞吐。SnapStream实现4倍片上内存效率提升,且在LongBench-v2、AIME24与LiveCodeBench上仅引入轻微精度下降。据我们所知,这是首个在具有静态图与连续批处理的生产系统中落地的稀疏键值注意力技术。

原文摘要 · Abstract (English)

The proliferation of 100B+ parameter Large Language Models (LLMs) with 100k+ context length support have resulted in increasing demands for on-chip memory to support large KV caches. Techniques such as StreamingLLM and SnapKV demonstrate how to control KV cache size while maintaining model accuracy. Yet, these techniques are not commonly used within industrial deployments using frameworks like vLLM or SGLang. The reason is twofold: on one hand, the static graphs and continuous batching methodology employed by these frameworks make it difficult to admit modifications to the standard multi-head attention algorithm, while on the other hand, the accuracy implications of such techniques on modern instruction-following and reasoning models are not well understood, obfuscating the need for implementing these techniques. In this paper, we explore these accuracy implications on Llama-3.1-8B-Instruct and DeepSeek-R1, and develop SnapStream, a KV cache compression method that can be deployed at scale. We demonstrate the efficacy of SnapStream in a 16-way tensor-parallel deployment of DeepSeek-671B on SambaNova SN40L accelerators running at 128k context length and up to 1832 tokens per second in a real production setting. SnapStream enables $4\times$ improved on-chip memory usage and introduces minimal accuracy degradation on LongBench-v2, AIME24 and LiveCodeBench. To the best of our knowledge, this is the first implementation of sparse KV attention techniques deployed in a production inference system with static graphs and continuous batching.

大模型推理内存优化键值缓存工业部署

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。