Skip to main content
QUICK REVIEW

[论文解读] F8Net: Fixed-Point 8-bit Only Multiplication for Network Quantization

Qing Jin, Jian Ren|arXiv (Cornell University)|Feb 10, 2022
Advanced Neural Network Applications被引用 21
一句话总结

F8Net 使用仅 8 位定点乘法对神经网络进行量化,自动为每层选择定点格式,并将定点量化与 PACT 统一,在 ImageNet 上达到与 INT32/float 基线模型竞争力或更优的准确性。

ABSTRACT

Neural network quantization is a promising compression technique to reduce memory footprint and save energy consumption, potentially leading to real-time inference. However, there is a performance gap between quantized and full-precision models. To reduce it, existing quantization approaches require high-precision INT32 or full-precision multiplication during inference for scaling or dequantization. This introduces a noticeable cost in terms of memory, speed, and required energy. To tackle these issues, we present F8Net, a novel quantization framework consisting of only fixed-point 8-bit multiplication. To derive our method, we first discuss the advantages of fixed-point multiplication with different formats of fixed-point numbers and study the statistical behavior of the associated fixed-point numbers. Second, based on the statistical and algorithmic analysis, we apply different fixed-point formats for weights and activations of different layers. We introduce a novel algorithm to automatically determine the right format for each layer during training. Third, we analyze a previous quantization algorithm -- parameterized clipping activation (PACT) -- and reformulate it using fixed-point arithmetic. Finally, we unify the recently proposed method for quantization fine-tuning and our fixed-point approach to show the potential of our method. We verify F8Net on ImageNet for MobileNet V1/V2 and ResNet18/50. Our approach achieves comparable and better performance, when compared not only to existing quantization techniques with INT32 multiplication or floating-point arithmetic, but also to the full-precision counterparts, achieving state-of-the-art performance.

研究动机与目标

  • 阐明将 8 位定点乘法作为量化模型对 INT32/float 的可行替代方案的动机。
  • 分析定点表示并识别每层的小数长度如何影响量化误差。
  • 开发训练技术,使定点量化与 PACT 以及 BN 统计在高效推理中实现统一。
  • 提出一种方法,在整个网络(尤其是残差块)中确定并共享小数长度和裁剪阈值。
  • 在 ImageNet 上对 MobileNet 与 ResNet 架构经验性验证 F8Net,并与现有量化方法进行比较。

提出的方法

  • 分析定点格式并用统计方法表征 8 位定点表示的量化误差。
  • 推导半经验公式,从层统计(权重/激活的标准差)确定最佳的小数长度。
  • 将参数化裁剪激活(PACT)与定点量化统一起来,以在定点算术中实现可训练的裁剪。
  • 在训练过程中确定的每层小数长度对权重/激活进行量化;通过双前向传播自适应 BN 的运行统计以实现 Conv+BN 的融合。
  • 关联并吸收层间缩放因子以计算用于量化的有效权重,包括在残路块中主裁剪/同级裁剪水平的共享。
  • 结合最近的量化微调方法以在仅使用定点乘法的情况下验证性能。

实验结果

研究问题

  • RQ1在标准卷积神经网络上,8 位定点算术是否能达到与基于 INT32 的量化和浮点基线相当或更好的精度?
  • RQ2应如何选择小数长度(每层定点格式)以在不同层和分布中最小化量化误差?
  • RQ3PACT 激活裁剪能否对定点算术进行有效重新表述,以提高训练稳定性和精度?
  • RQ4在使用 8 位定点乘法时,哪些策略(如 BN 融合、分数长度共享)最能保持残差网络的准确性?
  • RQ5每层自动确定的格式是否能在 ImageNet 的 MobileNet 与 ResNet 系列中实现有竞争力的结果?

主要发现

  • F8Net 在 ImageNet 上对 MobileNet V1/V2 与 ResNet18/50 的 8 位定点乘法量化显示了业界领先的性能。
  • 在多个案例中,8 位定点量化,结合从层统计确定的每层小数长度,能够达到与全精度基线相当或更好的性能。
  • 一套将定点量化与类似 PACT 的裁剪结合起来的统一训练方法能够实现有效的训练动态和高精度。
  • 小数长度在各层之间变化,包括在残差块内,跨同级共享裁剪水平有助于保持一致性,同时保持性能。
  • 实验显示 F8Net 超过或匹配依赖于 INT32 乘法或二进制尺度的方法,表明高精度乘法并非强量化模型性能的关键。
  • 在经过良好训练的全精度模型上进行的微调进一步证实了定点方法的鲁棒性和实用性。

更好的研究,从现在开始

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

无需绑定信用卡

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