Skip to main content
QUICK REVIEW

[论文解读] BRECQ: Pushing the Limit of Post-Training Quantization by Block Reconstruction

Yuhang Li, Ruihao Gong|arXiv (Cornell University)|Feb 10, 2021
Advanced Neural Network Applications参考文献 38被引用 115
一句话总结

本文提出 BRECQ,一个后训练量化框架,通过分块重构、混合精度优化和二阶分析,在无需完整再训练的情况下实现 INT2 权重量化并具有有竞争力的准确性。

ABSTRACT

We study the challenging task of neural network quantization without end-to-end retraining, called Post-training Quantization (PTQ). PTQ usually requires a small subset of training data but produces less powerful quantized models than Quantization-Aware Training (QAT). In this work, we propose a novel PTQ framework, dubbed BRECQ, which pushes the limits of bitwidth in PTQ down to INT2 for the first time. BRECQ leverages the basic building blocks in neural networks and reconstructs them one-by-one. In a comprehensive theoretical study of the second-order error, we show that BRECQ achieves a good balance between cross-layer dependency and generalization error. To further employ the power of quantization, the mixed precision technique is incorporated in our framework by approximating the inter-layer and intra-layer sensitivity. Extensive experiments on various handcrafted and searched neural architectures are conducted for both image classification and object detection tasks. And for the first time we prove that, without bells and whistles, PTQ can attain 4-bit ResNet and MobileNetV2 comparable with QAT and enjoy 240 times faster production of quantized models. Codes are available at https://github.com/yhhhli/BRECQ.

研究动机与目标

  • 激励并实现高质量的后训练量化(PTQ),无需端到端再训练。
  • 开发基于重构的 PTQ 框架,在极低比特宽度(INT2)下以最少数据实现。
  • 确定平衡跨层依赖与泛化误差的最佳重构粒度。
  • 集成在每个块的灵敏度指导下的混合精度量化,同时遵守硬件约束。

提出的方法

  • 使用高斯-牛顿和费舍尔信息分析二阶误差,将权重扰动与输出变化相关联。
  • 定义四种重构粒度(网络级、阶段级、块级、层级),并证明块级重构在依赖性与泛化之间取得最佳平衡。
  • 提出带有按块优化的块级重构,使用自适应舍入权重和对激活的学习步长。
  • 用对角费舍尔信息近似前激活 Hessian,用来以梯度重要性加权块重构。
  • 引入遗传算法在层级间搜索延迟与大小约束的混合精度配置(2/4/8 位)。
  • 实现一个实际的 PTQ 流水线,使用较小的校准集(约1024 个样本)实现快速部署。

实验结果

研究问题

  • RQ1PTQ 是否能够在不显著损失准确性的前提下,将权重量化为 INT2,且适用于各种架构?
  • RQ2在 PTQ 约束下,哪种重构粒度最能保留任务性能?
  • RQ3如何利用二阶信息来指导 PTQ 的层/块级重构?
  • RQ4在硬件约束下,混合精度量化是否能在 PTQ 中得到有效优化?

主要发现

  • 块级重构在 INT2/4-bit 设置下的准确性上优于网络级、阶段级和层级重构。
  • BRECQ 使权重在 INT2 下实现量化,在 ResNet-18、ResNet-50、MobileNetV2、RegNet 变体和 NAS 模型上具有有竞争力的准确性。
  • 在 4-bit 激活和 2/4/8-bit 混合精度下,PTQ 性能在多种配置接近或等同于 QAT,同时部署速度显著更快。
  • 量化的 ResNet-18 使用 BRECQ 可以达到接近全精度的准确性,表2中在多种架构有报道结果。
  • 通过遗传算法实现的硬件感知混合精度搜索得到符合延迟/内存约束且保持准确性的配置。
  • 为可重复性发布此项目仓库中的代码。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。