arXiv:2503.18599cs.ARcs.LG2025-03被引 31

Oaken通过在线离线混合量化,实现大模型服务的高速低损推理。

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

  • 离线设定阈值,线上快速判断异常值,降低检测开销。
  • 批量大小256时,吞吐提升1.58倍,精度损失仅0.54%。
  • 可集成于任意大模型加速器,适合追求高并发的部署场景。

现代大语言模型服务系统通过批处理请求以提高吞吐量,但批处理注意力操作面临挑战,导致内存带宽成为关键瓶颈。社区依赖高端多通道高带宽内存的GPU,然而高带宽常伴随有限内存容量,降低核心利用率并增加成本。近期支持更长上下文的技术显著增大了键值缓存(KV cache)规模,进一步加剧内存压力。已有研究采用键值缓存量化技术,对大多数值使用低位宽,对异常值保留高位宽,虽能兼顾精度与压缩率,但在线异常值检测成本过高,抵消优势。本文提出Oaken,通过算法与硬件协同设计,实现高精度与高性能并重。Oaken采用在线-离线混合量化策略:离线设定异常阈值,线上据此确定量化尺度。为将算法优势转化为实际性能,配套定制量化引擎与内存管理单元,可集成至任意大模型加速器。我们在LPU基础上构建Oaken加速器并进行全面评估。实验表明,在批量大小256下,相比NVIDIA A100 GPU,Oaken吞吐量最高提升1.58倍,平均精度损失仅为0.54%,优于当前最先进量化技术。

原文摘要 · Abstract (English)

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.

大模型推理量化缓存优化硬件协同

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