首个支持溢出防护的后训练量化框架,让大模型低精度推理更稳定高效。
Accumulator-Aware Post-Training Quantization for Large Language Models
- 基于溢出感知设计,无需重新训练即可实现高精度低功耗量化
- 在16位多阶段累加下保持98%原始困惑度,比传统方法提升15%
- 兼容现有算法,适合部署大语言模型到资源受限设备
当权值和激活值被量化至越来越窄的表示时,乘积累加(MAC)单元中的加法开销开始超过乘法。近期研究表明,通过低精度累加减少加法开销可提升各类推理平台的吞吐、能效与面积表现,但存在溢出风险。现有累加器感知量化研究仅聚焦于量化感知训练(QAT),需在量化环路中微调或从头训练,代价高昂。为弥补此差距,本文提出AXE——首个专为后训练量化(PTQ)设计的累加器感知量化框架,提供溢出规避保证。我们给出理论依据,并将其应用于两种现有算法(GPFQ与OPTQ)。AXE支持多阶段累加,首次实现完整数据通路优化。在最新语言生成模型上评估:将Llama3 8B在16位多阶段累加路径下量化,AXE维持高达98%的FP16困惑度,较朴素位宽调整方法最高提升15%。
原文摘要 · Abstract (English)
When quantizing weights and activations to increasingly narrower representations, the cost of additions begins to dominate that of multiplications in multiply-accumulate (MAC) units. Recent studies show that reducing addition costs via low-precision accumulation improves throughput, power, and area across inference platforms, albeit with an increased risk of overflow. Accumulator-aware quantization research has so far only considered the quantization-aware training (QAT) paradigm, in which models are fine-tuned or trained from scratch with quantization in the loop. As models and datasets continue to grow in size, QAT techniques become increasingly more expensive, which has motivated the recent surge in post-training quantization (PTQ) research. To bridge this gap, we introduce AXE, the first accumulator-aware quantization framework explicitly designed to endow overflow avoidance guarantees to PTQ algorithms. We present theoretical motivation for AXE and demonstrate its flexibility by implementing it on top of two existing algorithms: GPFQ and OPTQ. We design AXE to support multi-stage accumulation, opening the door to full datapath optimization for the first time. We evaluate AXE using recent language generation models; when quantizing Llama3 8B for a 16-bit multi-stage accumulation datapath, AXE maintains up to 98% of the FP16 perplexity, surpassing naive bit width manipulation by up to 15%.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。