arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.12951cs.CV
收藏

AdaLog:基于自适应对数量化器的视觉Transformer训练后量化

AdaLog: Post-Training Quantization for Vision Transformers with Adaptive Logarithm Quantizer

State Key Laboratory of Virtual Reality Technology and Systems, Beihang University(北京航空航天大学虚拟现实技术与系统国家重点实验室);School of Computer Science and Engineering, Beihang University(北京航空航天大学计算机科学与工程学院)

Zhuguanyu Wu, Jiaxin Chen, Hanwen Zhong, Di Huang, Yunhong Wang

AI总结:

针对ViT训练后量化中幂律分布激活量化不灵活的问题,提出自适应对数量化器AdaLog,优化对数底数并采用偏置重参数化,配合快速渐进组合搜索策略,在分类、检测和分割任务上验证了有效性。

摘要:

视觉Transformer(ViT)已成为计算机视觉领域最主流的基础骨干网络之一。尽管其精度很高,但在实际应用中部署仍面临严峻挑战,包括高计算成本和推理延迟。近年来,训练后量化(PTQ)技术已成为提升ViT效率的一种有前景的方法。然而,现有的ViT PTQ方法在处理遵循幂律分布的Softmax后和GELU后激活时,量化不够灵活。为解决这些问题,我们提出了一种新颖的非均匀量化器,称为自适应对数AdaLog(AdaLog)量化器。它优化对数底数以适应激活的幂律分布,同时允许硬件友好的量化和反量化。通过采用偏置重参数化,AdaLog量化器适用于Softmax后和GELU后的激活。此外,我们开发了一种高效的快速渐进组合搜索(FPCS)策略,以确定AdaLog的最优对数底数,以及均匀量化器的缩放因子和零点。在公共基准上的大量实验结果表明,我们的方法对各种基于ViT的架构和视觉任务(包括分类、目标检测和实例分割)均有效。代码可在https://github.com/GoatWu/AdaLog获取。

英文摘要:

Vision Transformer (ViT) has become one of the most prevailing fundamental backbone networks in the computer vision community. Despite the high accuracy, deploying it in real applications raises critical challenges including the high computational cost and inference latency. Recently, the post-training quantization (PTQ) technique has emerged as a promising way to enhance ViT's efficiency. Nevertheless, existing PTQ approaches for ViT suffer from the inflexible quantization on the post-Softmax and post-GELU activations that obey the power-law-like distributions. To address these issues, we propose a novel non-uniform quantizer, dubbed the Adaptive Logarithm AdaLog (AdaLog) quantizer. It optimizes the logarithmic base to accommodate the power-law-like distribution of activations, while simultaneously allowing for hardware-friendly quantization and de-quantization. By employing the bias reparameterization, the AdaLog quantizer is applicable to both the post-Softmax and post-GELU activations. Moreover, we develop an efficient Fast Progressive Combining Search (FPCS) strategy to determine the optimal logarithm base for AdaLog, as well as the scaling factors and zero points for the uniform quantizers. Extensive experimental results on public benchmarks demonstrate the effectiveness of our approach for various ViT-based architectures and vision tasks including classification, object detection, and instance segmentation. Code is available at https://github.com/GoatWu/AdaLog.

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

↑