Skip to main content
QUICK REVIEW

[论文解读] TensorQuant - A Simulation Toolbox for Deep Neural Network Quantization

Dominik Marek Loroch, Norbert Wehn|arXiv (Cornell University)|Oct 13, 2017
Advanced Neural Network Applications被引用 5
一句话总结

TensorQuant 是一个基于 TensorFlow 的工具箱,可实现对深度神经网络中低精度定点量化进行细粒度仿真,模拟自定义硬件的算术级行为。结果表明,内在舍入和梯度量化具有高度的拓扑依赖性,对于像 AlexNet 这类更深的网络,16 位定点格式至少需要 12 位小数位才能实现稳定训练。

ABSTRACT

Recent research implies that training and inference of deep neural networks (DNN) can be computed with low precision numerical representations of the training/test data, weights and gradients without a general loss in accuracy. The benefit of such compact representations is twofold: they allow a significant reduction of the communication bottleneck in distributed DNN training and faster neural network implementations on hardware accelerators like FPGAs. Several quantization methods have been proposed to map the original 32-bit floating point problem to low-bit representations. While most related publications validate the proposed approach on a single DNN topology, it appears to be evident, that the optimal choice of the quantization method and number of coding bits is topology dependent. To this end, there is no general theory available, which would allow users to derive the optimal quantization during the design of a DNN topology. In this paper, we present a quantization tool box for the TensorFlow framework. TensorQuant allows a transparent quantization simulation of existing DNN topologies during training and inference. TensorQuant supports generic quantization methods and allows experimental evaluation of the impact of the quantization on single layers as well as on the full topology. In a first series of experiments with TensorQuant, we show an analysis of fix-point quantizations of popular CNN topologies.

研究动机与目标

  • 为解决在训练和推理过程中评估 DNN 量化影响时缺乏系统性工具的问题。
  • 研究量化位置(内在 vs. 外在)和舍入方法对模型准确率的影响。
  • 提供一个透明且可扩展的仿真框架,可在操作级别模拟定点算术。
  • 评估量化对 SOTA CNN 模型(如 Inception V3 和 ResNet-152)的影响,超越简单架构的范围。
  • 支持分布式训练和自定义硬件部署中量化策略的实验验证。

提出的方法

  • 将量化层集成到 TensorFlow 计算图中,支持用户自定义的量化方法。
  • 支持逐层量化和定点运算的完整算术级仿真,包括舍入和溢出处理。
  • 实现内在和外在舍入策略,以比较不同层间噪声传播的影响。
  • 使用标准 DNN 训练流程,对量化后的梯度、权重和激活进行处理,同时保持完整的 TensorFlow 功能。
  • 仿真不同字长和小数位分配,以评估准确率的权衡。
  • 在标准数据集(MNIST、CIFAR-10)和大规模模型(LeNet、AlexNet、Inception V3、ResNet-152)上进行基准测试。

实验结果

研究问题

  • RQ1量化位置(内在 vs. 外在)在训练过程中如何影响深度神经网络的准确率?
  • RQ2不同 DNN 拓扑结构实现稳定训练所需的最小位宽和小数位分配是多少?
  • RQ3梯度量化如何影响收敛性和最终准确率,尤其是在 AlexNet 这类更深的网络中?
  • RQ4LeNet 等简单网络的结果能否推广到更大规模、最先进的架构中?
  • RQ5不同舍入方法(如最近舍入、向下舍入)如何影响训练动态和最终模型性能?

主要发现

  • 对于 MNIST 上的 LeNet,使用 4 位定点格式并分配 2 个小数位,可达到 97% 的相对准确率,表明浅层网络中低精度训练是可行的。
  • AlexNet 在 16 位字长格式下至少需要 12 个小数位才能达到 92.6% 的相对准确率,凸显深层网络对量化精度的敏感性。
  • 在 AlexNet 中,尽管测试准确率很高,但使用 16 位最近舍入时训练损失上升,这表明 L2 正则化效果不佳,导致损失与泛化能力之间出现脱节。
  • 与外在舍入相比,内在舍入对舍入方法和位宽更加敏感,使得其在不同架构间难以泛化。
  • 不存在一种通用的位宽配置能保证在所有 DNN 拓扑结构中实现稳定训练,因为瓶颈层对敏感度各不相同。
  • 16 位定点格式对所测试的所有网络层均足够,但小数位比整数位对保持准确率更为关键。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

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