AMS-QUANT:用于浮点量化的自适应尾数共享
AMS-QUANT: Adaptive Mantissa Sharing for Floating-point Quantization
AI总结:
本文提出 AMS-Quant,通过尾数比特共享和自适应搜索实现非整数位宽浮点量化,并以 CUDA 内核在可忽略精度损失下获得最高 3.2 倍解码加速。
摘要:
大语言模型(LLM)已在各类任务中展现出卓越能力,但其数十亿甚至万亿级参数给推理带来了存储和效率瓶颈。量化,尤其是浮点量化,被认为能够通过减少推理过程中的内存占用和数据移动来加速 LLM 推理。我们首次将浮点量化探索从整数位宽推进到非整数位宽,即 AMS-Quant,以进一步逼近量化最佳点。AMS-Quant 融合了两项新技术以实现这一目标:(1)提出尾数比特共享(Mantissa-bit Sharing),将 k 个量化权重分组,使其共享最低有效尾数比特,从而在不损失精度的情况下进一步逼近最小量化位宽。(2)引入自适应搜索(Adaptive Searching),采用离线优化策略,最小化共享带来的精度下降。此外,AMS-Quant 还被原型实现为高效的 CUDA Linear 内核,通过减少内存访问将内存节省转化为实际时钟延迟降低。在大规模数据集和模型上的大量实验表明,AMS-Quant 可将模型量化至 FP-5.33-e2m3 和 FP4.25-e2m2,并相较 FP16 推理显著加速 LLM 解码(分别为 2.8 倍和 3.2 倍),且精度损失可忽略不计。
英文摘要:
Large language models (LLMs) have demonstrated remarkable capabilities in various kinds of tasks, while the billion or even trillion parameters bring storage and efficiency bottlenecks for inference. Quantization, particularly floating-point quantization, is known to be capable of speeding up LLM inference by reducing memory footprint and data movement during the inference process. For the first time, we advance the floating-point quantization exploration from integer bitwidths to non-integer bit-widths, namely AMS-Quant, to further approach the quantization sweet spot. AMS-Quant incorporates two novel techniques to put it into effect: (1) it proposes Mantissa-bit Sharing, which groups k quantized weights and lets them share the least significant mantissa bit, allowing us to further approach the minimum quantization bit-width without accuracy loss. (2) It introduces Adaptive Searching, which employs an offline optimization strategy to minimize the accuracy degradation introduced by sharing. Moreover, AMS-Quant is also prototyped as efficient CUDA Linear kernels, which translates memory savings into wall-clock latency reduction by reducing memory access. Extensive experiments on large-scale datasets and models show that AMS-Quant can quantize the model to FP-5.33-e2m3 and FP4.25-e2m2, and significantly speed up the LLM decoding over FP16 inference (2.8x and 3.2x), with negligible accuracy loss.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。