[论文解读] Low-Precision Floating-Point Schemes for Neural Network Training
本文提出了一种低精度浮点数和定点数算术方案,以减少能耗和内存使用,从而加速神经网络训练。该研究引入了一种12位浮点数格式并采用随机舍入,一种局部缩放的浮点数变体,其精度相比32位基线训练提升了2.42%;此外还提出了一种基于2的幂的神经网络,通过位移操作替代乘法运算,显著降低了训练时间和资源消耗,同时保持了极小的精度损失。
The use of low-precision fixed-point arithmetic along with stochastic rounding has been proposed as a promising alternative to the commonly used 32-bit floating point arithmetic to enhance training neural networks training in terms of performance and energy efficiency. In the first part of this paper, the behaviour of the 12-bit fixed-point arithmetic when training a convolutional neural network with the CIFAR-10 dataset is analysed, showing that such arithmetic is not the most appropriate for the training phase. After that, the paper presents and evaluates, under the same conditions, alternative low-precision arithmetics, starting with the 12-bit floating-point arithmetic. These two representations are then leveraged using local scaling in order to increase accuracy and get closer to the baseline 32-bit floating-point arithmetic. Finally, the paper introduces a simplified model in which both the outputs and the gradients of the neural networks are constrained to power-of-two values, just using 7 bits for their representation. The evaluation demonstrates a minimal loss in accuracy for the proposed Power-of-Two neural network, avoiding the use of multiplications and divisions and thereby, significantly reducing the training time as well as the energy consumption and memory requirements during the training and inference phases.
研究动机与目标
- 评估低精度定点数算术结合随机舍入在训练深度神经网络时的局限性。
- 探索替代的低精度数值表示方法,在保持模型精度的同时提升效率。
- 设计一种使用2的幂值的简化神经网络模型,以消除昂贵的乘除运算。
- 证明局部缩放浮点数算术可在仅使用12位的情况下,实现超越32位基线的精度表现。
- 通过在低精度格式中利用硬件友好的运算,实现节能、高吞吐量的训练。
提出的方法
- 使用双精度Caffe框架模拟12位定点数和12位浮点数算术,所有数值均限制在12位范围内。
- 采用随机舍入处理溢出和下溢问题,通过概率性地舍入到最近的可表示值,保持期望值的准确性。
- 提出上下文浮点数(context float),一种局部缩放的浮点数格式,可按层或参数组动态调整指数范围。
- 提出基于2的幂的神经网络,其中输出和梯度被限制为2的幂,从而可使用位移操作替代乘法运算。
- 采用7位表示用于2的幂值,极大降低了训练过程中的计算复杂度。
- 在CIFAR-10数据集上对ResNet类架构进行训练,评估所有方案的精度、训练时间和资源消耗。
实验结果
研究问题
- RQ112位定点数算术结合随机舍入是否能在CIFAR-10上保持模型训练的精度?
- RQ212位浮点数格式结合随机舍入是否在精度和稳定性方面优于定点数?
- RQ3在仅使用12位的情况下,浮点数或定点数格式中的局部缩放是否能实现超越32位基线的精度?
- RQ4将网络输出和梯度限制为2的幂值是否能消除训练过程中的昂贵乘除运算?
- RQ5在训练中使用简化数值表示时,精度损失与性能提升之间的权衡关系如何?
主要发现
- 12位定点数算术结合随机舍入在CIFAR-10训练中导致显著的精度下降,因此不适合用于训练阶段。
- 所提出的12位浮点数格式结合随机舍入可实现接近基线的精度,与32位浮点数训练相比仅有极小的精度损失。
- 局部缩放浮点数(上下文浮点数)方法相比32位基线精度提升了2.42%,证明了动态范围自适应的优势。
- 基于2的幂的神经网络表示通过用位移操作替代乘除运算,显著降低了训练时间和能耗。
- 基于2的幂的模型在仅使用7位表示关键参数的情况下,实现了极小的精度损失(可忽略的下降),显著减少了内存和计算开销。
- 低精度算术与硬件友好的运算相结合,可在资源受限平台上实现高效训练,且不牺牲模型性能。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。