arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.01199cs.CVcs.AI
收藏

近乎无损的自适应比特切换

Nearly Lossless Adaptive Bit Switching

Xi’an Jiaotong University(西安交通大学)

Haiduo Huang, Zhenhua Liu, Tian Xia, Wenzhe zhao, Pengju Ren

AI总结:

针对多精度量化训练中存储成本高与精度受损问题,提出Double Rounding量化方法、ALRS技术与HASB策略,实现近乎无损的比特切换,在多精度与混合精度训练中均优于现有QAT方法。

摘要:

模型量化被广泛应用于压缩和加速深度神经网络(DNNs)。然而,传统的量化感知训练(QAT)侧重于以统一比特宽度训练DNNs。不同硬件和传输需求下的比特宽度设置各不相同,这导致了相当大的训练和存储成本。因此,提出了一次性联合训练多种精度的方案来解决这一问题。以往的工作要么存储更大的FP32模型以在不同精度模型间切换从而获得更高精度,要么存储较小的INT8模型但由于使用共享量化参数而损害精度。在本文中,我们引入了Double Rounding量化方法,该方法充分利用量化表示范围,通过使用最高整数精度代替全精度来实现近乎无损的比特切换,同时减少存储。此外,我们观察到在一次性联合训练期间,不同精度之间存在竞争干扰,这主要是由于反向传播过程中量化尺度梯度的不一致。为解决此问题,我们提出了一种自适应学习率缩放(ALRS)技术,该技术为各种精度动态调整学习率以优化训练过程。另外,我们将Double Rounding扩展到一次性混合精度训练,并开发了Hessian感知随机比特切换(HASB)策略。在ImageNet-1K分类上的实验结果表明,我们的方法在多精度和混合精度方面均具有足够优势以超越最先进的一次性联合QAT。我们还在检测和分割任务以及LLMs任务上验证了该方法的可行性。代码可在https://github.com/haiduo/Double-Rounding获取。

英文摘要:

Model quantization is widely applied for compressing and accelerating deep neural networks (DNNs). However, conventional Quantization-Aware Training (QAT) focuses on training DNNs with uniform bit-width. The bit-width settings vary across different hardware and transmission demands, which induces considerable training and storage costs. Hence, the scheme of one-shot joint training multiple precisions is proposed to address this issue. Previous works either store a larger FP32 model to switch between different precision models for higher accuracy or store a smaller INT8 model but compromise accuracy due to using shared quantization parameters. In this paper, we introduce the Double Rounding quantization method, which fully utilizes the quantized representation range to accomplish nearly lossless bit-switching while reducing storage by using the highest integer precision instead of full precision. Furthermore, we observe a competitive interference among different precisions during one-shot joint training, primarily due to inconsistent gradients of quantization scales during backward propagation. To tackle this problem, we propose an Adaptive Learning Rate Scaling (ALRS) technique that dynamically adapts learning rates for various precisions to optimize the training process. Additionally, we extend our Double Rounding to one-shot mixed precision training and develop a Hessian-Aware Stochastic Bit-switching (HASB) strategy. Experimental results on the ImageNet-1K classification demonstrate that our methods have enough advantages to state-of-the-art one-shot joint QAT in both multi-precision and mixed-precision. We also validate the feasibility of our method on detection and segmentation tasks, as well as on LLMs task. Our codes are available at https://github.com/haiduo/Double-Rounding.

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

↑