arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.17092cs.LGcs.AIcs.DM
收藏

面向大语言模型的累加器感知训练后量化

Accumulator-Aware Post-Training Quantization for Large Language Models

AMD(AMD公司);TUM(慕尼黑工业大学);GSK(葛兰素史克);University of California San Diego(加州大学圣地亚哥分校)

Ian Colbert, Giuseppe Franco, Fabian Grob, Jinjie Zhang, Rayan Saab

AI总结:

针对大模型量化感知训练成本高、低精度累加易溢出的问题,提出首个累加器感知训练后量化框架AXE,支持多阶段累加,在Llama3 8B量化中性能接近FP16且优于传统位宽调整方法。

摘要:

当将权重和激活量化为越来越窄的表示时,乘累加(MAC)单元中加法运算的开销开始超过乘法运算。近期研究表明,通过低精度累加降低加法开销可提升各类推理平台的吞吐量、功耗表现与面积效率,但会带来更高的溢出风险。目前累加器感知量化研究仅涉及量化感知训练(QAT)范式,即在训练循环中引入量化,对模型进行微调或从头训练。随着模型和数据集规模持续增长,QAT技术的成本越来越高,这也推动了近期训练后量化(PTQ)研究的热潮。为填补这一空白,我们提出AXE——首个专为PTQ算法提供溢出避免保障的累加器感知量化框架。我们阐述了AXE的理论依据,并通过在GPFQ和OPTQ两种现有算法之上实现该框架,验证了其灵活性。AXE被设计为支持多阶段累加,首次为全数据通路优化提供了可能。我们使用最新的语言生成模型对AXE进行评估:当针对16位多阶段累加数据通路量化Llama3 8B时,AXE可保留高达98%的FP16困惑度性能,比单纯的位宽调整方法最高高出15%。

英文摘要:

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%.

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

↑