[论文解读] Training DNNs with Hybrid Block Floating Point
本文提出 HBFP,一种用于训练深度神经网络的混合块浮点数与浮点数表示方法,其中点积运算采用块浮点数(BFP)以提升硬件效率,而其他运算则使用全精度浮点数以保持精度。HBFP 在实现 FP32 级模型精度的同时,相比 FP16 实现了高达 8.5 倍的吞吐量提升和 2 倍的模型压缩,从而支持高密度、高能效的 DNN 加速器。
The wide adoption of DNNs has given birth to unrelenting computing requirements, forcing datacenter operators to adopt domain-specific accelerators to train them. These accelerators typically employ densely packed full precision floating-point arithmetic to maximize performance per area. Ongoing research efforts seek to further increase that performance density by replacing floating-point with fixed-point arithmetic. However, a significant roadblock for these attempts has been fixed point's narrow dynamic range, which is insufficient for DNN training convergence. We identify block floating point (BFP) as a promising alternative representation since it exhibits wide dynamic range and enables the majority of DNN operations to be performed with fixed-point logic. Unfortunately, BFP alone introduces several limitations that preclude its direct applicability. In this work, we introduce HBFP, a hybrid BFP-FP approach, which performs all dot products in BFP and other operations in floating point. HBFP delivers the best of both worlds: the high accuracy of floating point at the superior hardware density of fixed point. For a wide variety of models, we show that HBFP matches floating point's accuracy while enabling hardware implementations that deliver up to 8.5x higher throughput.
研究动机与目标
- 解决固定点算术在 DNN 训练中动态范围有限和硬件效率低下的问题。
- 克服纯块浮点数(BFP)的局限性,如指数选择困难和宽张量分布导致的数据损失。
- 设计一种混合表示方法,兼顾固定点算术的硬件密度和浮点数计算的精度优势。
- 实现高吞吐量、低面积的 DNN 加速器,在保持 FP32 精度的同时减少内存带宽和模型尺寸。
- 验证 HBFP 可作为多种 DNN 架构和数据集中的 FP32 的即插即用替代方案。
提出的方法
- HBFP 使用 8 位或 12 位尾数在 BFP 中执行所有点积运算,而所有其他运算(如激活、归一化)则在全精度浮点数中进行。
- 在每次点积前动态选择指数,以实现激进的缩放并最小化尾数宽度需求。
- 应用分块和宽权重存储优化,以在极小的面积和内存开销下提升 BFP 精度。
- 激活值以浮点数格式存储,但可通过 8 位表示或单比特标志(如 ReLU)进行压缩,以减少内存带宽。
- 基于 8 位 BFP 乘法器和类似 FP32 的激活单元,实现 FPGA 原型,验证了高吞吐量和低资源占用。
- 在 ResNet、WideResNet、DenseNet 和 LSTM 模型上,针对图像分类和语言建模任务对设计进行了评估。
实验结果
研究问题
- RQ1混合 BFP-FP 表示能否在显著提升硬件吞吐量的同时,实现与 FP32 相当的 DNN 训练精度?
- RQ2BFP 中的动态指数选择如何缓解窄尾数宽度下的数据损失并改善收敛性?
- RQ3在其他运算保持 FP32 的前提下,选择性地将 BFP 用于点积运算,在多大程度上可保持模型精度?
- RQ4与 FP16 或 FP32 相比,使用 HBFP 在面积、吞吐量和内存带宽方面能带来多大的硬件效率提升?
- RQ5HBFP 是否可作为多种 DNN 架构和数据集中的 FP32 即插即用替代方案?
主要发现
- 使用 8 位尾数的 HBFP 在相同 FPGA 上相比基于 FP16 的加速器实现了 8.5 倍的吞吐量提升,且无转换单元带来的性能开销。
- 使用 12 位尾数的 HBFP 在所有评估模型上均达到 FP32 的测试误差:CIFAR-100 上 ResNet-50 为 26.07%,ImageNet 上为 1.89%,PTB 上 LSTM 为 61.31 的困惑度。
- 使用 8 位尾数的 HBFP 在 ImageNet 上实现 23.88% 的测试误差,与 FP32 相差仅 0.24%,表明在降低精度的同时实现近乎相同的精度。
- HBFP 通过将激活值存储在窄浮点数或压缩格式中,将前向和反向传播的内存带宽减少高达 4 倍。
- FPGA 原型中的转换单元占用资源不足 1%,且无性能损耗,实现了高效集成。
- HBFP 可实现高达 2 倍的模型压缩,减少片上内存容量和分布式训练的片外带宽需求。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。