arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.04719cs.LGcs.PF
收藏

GPU加速的INT8量化用于大型语言模型中KV缓存压缩

GPU-Accelerated INT8 Quantization for KV Cache Compression in Large Language Models

Maanas Taneja, Purab Shingvi(独立研究者)

Maanas Taneja, Purab Shingvi

AI总结:

本研究通过GPU加速的INT8量化技术,实现了大型语言模型中KV缓存压缩,达到4倍内存减少,同时保持高精度和低计算开销。

摘要:

大型语言模型中的键值(KV)缓存是在推理过程中出现的重要内存瓶颈,其规模与序列长度成线性增长,往往超过模型权重本身的内存占用。我们实现了并评估了GPU加速的INT8量化用于KV缓存压缩,实现了4倍的内存减少,同时精度损失很小。我们开发了四种CUDA内核变体--朴素、分块、粗粒度和向量化--并在现实的工作负载规模上至10亿个元素进行基准测试。我们的向量化内核在CPU基准线上实现了高达1694倍的速度提升,同时保持重建误差低于0.004,即使在8K维头的情况下,注意力分数误差也低于0.1。这些结果表明,INT8量化提供了一种实用的方法,用于减少LLM推理中的内存压力,同时计算开销(6-58毫秒)和对下游模型行为的最小影响。

英文摘要:

The key-value (KV) cache in large language models presents a significant memory bottleneck during inference, growing linearly with sequence length and often exceeding the memory footprint of model weights themselves. We implement and evaluate GPU-accelerated INT8 quantization for KV cache compression, achieving 4$\times$ memory reduction with minimal accuracy degradation. We develop four CUDA kernel variants -- naive, tiled, coarsened, and vectorized -- and benchmark them across realistic workload sizes up to 1 billion elements. Our vectorized kernel achieves up to 1,694$\times$ speedup over CPU baselines while maintaining reconstruction error below 0.004 and attention score error below 0.1 even for 8K-dimensional heads. These results demonstrate that INT8 quantization provides a practical approach for reducing memory pressure in LLM inference with negligible computational overhead (6--58ms) and minimal impact on downstream model behavior

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

↑