arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.18599cs.ARcs.LG
收藏

Oaken:采用在线-离线混合 KV Cache 量化的快速高效 LLM 服务

Oaken: Fast and Efficient LLM Serving with Online-Offline Hybrid KV Cache Quantization

KAIST(韩国科学技术院);HyperAccel(HyperAccel公司)

Minsu Kim, Seongmin Hong, RyeoWook Ko, Soongyu Choi, Hunjong Lee, Junsoo Kim, Joo-Young Kim, Jongse Park

AI总结:

本文提出 Oaken,通过离线设定异常值阈值、在线确定量化 scale 的混合 KV cache 量化算法及定制硬件协同设计,在 batch size 256 下较 A100 最高提升 1.58 倍吞吐,平均精度损失仅 0.54%。

摘要:

现代大语言模型(LLM)服务系统通过批处理多个请求来实现高吞吐量,但批处理 attention 操作具有挑战性,使内存带宽成为关键瓶颈。业界依赖具有多个高带宽内存通道的高端 GPU。遗憾的是,HBM 的高带宽往往以有限的内存容量为代价,这会降低核心利用率并增加成本。近期使 LLM 支持更长上下文的进展大幅增加了 key-value cache 大小,进一步加剧了内存容量压力。已有文献探索了 KV cache 量化技术,这类技术通常对大多数值使用低位宽,并选择性地对异常值使用更高位宽。尽管这种方法有助于同时实现高精度和低位宽,但其局限在于在线异常值检测的成本过高,抵消了其优势。我们提出 Oaken,这是一种通过算法与硬件协同设计同时实现高精度和高性能的加速方案。为了在 KV cache 量化的精度-性能权衡空间中有效找到最佳平衡点,Oaken 采用在线-离线混合方法:离线设置异常值阈值,然后在线使用这些阈值确定量化 scale。为了将所提出的算法技术转化为切实的性能收益,Oaken 还配备了可与任何 LLM 加速器集成的定制量化引擎和内存管理单元。我们在 LLM 加速器 LPU 之上构建了 Oaken 加速器,并进行了全面评估。实验表明,在 batch size 为 256 时,Oaken 相比 NVIDIA A100 GPU 实现最高 1.58 倍的吞吐量提升;与最先进的 KV cache 量化技术相比,其精度损失极小,平均仅为 0.54%。

英文摘要:

Modern Large Language Model serving system batches multiple requests to achieve high throughput, while batching attention operations is challenging, rendering memory bandwidth a critical bottleneck. The community relies on high-end GPUs with multiple high-bandwidth memory channels. Unfortunately, HBM's high bandwidth often comes at the expense of limited memory capacity, which reduces core utilization and increases costs. Recent advancements enabling longer contexts for LLMs have substantially increased the key-value cache size, further intensifying the pressures on memory capacity. The literature has explored KV cache quantization techniques, which commonly use low bitwidth for most values, selectively using higher bitwidth for outlier values. While this approach helps achieve high accuracy and low bitwidth simultaneously, it comes with the limitation that cost for online outlier detection is excessively high, negating the advantages. We propose Oaken, an acceleration solution that achieves high accuracy and high performance simultaneously through co-designing algorithm and hardware. To effectively find a sweet spot in the accuracy-performance trade-off space of KV cache quantization, Oaken employs an online-offline hybrid approach, setting outlier thresholds offline, which are then used to determine the quantization scale online. To translate the proposed algorithmic technique into tangible performance gains, Oaken also comes with custom quantization engines and memory management units that can be integrated with any LLM accelerators. We built an Oaken accelerator on top of an LLM accelerator, LPU, and conducted a comprehensive evaluation. Our experiments show that for a batch size of 256, Oaken achieves up to 1.58x throughput improvement over NVIDIA A100 GPU, incurring a minimal accuracy loss of only 0.54\% on average, compared to state-of-the-art KV cache quantization techniques.

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

↑