[论文解读] A Study of BFLOAT16 for Deep Learning Training
该论文在多样任务中实证验证 BFLOAT16 作为鲁棒的半精度格式用于深度学习训练,且在未经超参数更改的情况下达到与 FP32 相同的结果。
This paper presents the first comprehensive empirical study demonstrating the efficacy of the Brain Floating Point (BFLOAT16) half-precision format for Deep Learning training across image classification, speech recognition, language modeling, generative networks and industrial recommendation systems. BFLOAT16 is attractive for Deep Learning training for two reasons: the range of values it can represent is the same as that of IEEE 754 floating-point format (FP32) and conversion to/from FP32 is simple. Maintaining the same range as FP32 is important to ensure that no hyper-parameter tuning is required for convergence; e.g., IEEE 754 compliant half-precision floating point (FP16) requires hyper-parameter tuning. In this paper, we discuss the flow of tensors and various key operations in mixed precision training, and delve into details of operations, such as the rounding modes for converting FP32 tensors to BFLOAT16. We have implemented a method to emulate BFLOAT16 operations in Tensorflow, Caffe2, IntelCaffe, and Neon for our experiments. Our results show that deep learning training using BFLOAT16 tensors achieves the same state-of-the-art (SOTA) results across domains as FP32 tensors in the same number of iterations and with no changes to hyper-parameters.
研究动机与目标
- 评估 BFLOAT16 在跨多领域的深度学习训练中的有效性
- 分析在 BFLOAT16 的混合精度训练中张量流动与核心运算
- 演示在流行框架中对 BFLOAT16 的仿真,并与 FP32 基线进行比较
- 评估在使用 BFLOAT16 时对损失缩放与超参数调优的需求
- 探讨 BFLOAT16 训练在硬件和软件栈上的实际影响
提出的方法
- 通过将 FP32 操作数的下 16 位置零并应用最近偶数舍入(RNE)来仿真 BFLOAT16
- 开发 Quantlib,将 FP32 张量修改为 BFLOAT16 格式,用于前向、反向传播和非 GEMM 运算
- 使用 FP32 累加器和 BFLOAT16 输入,并保持 FP32 权重更新以确保准确性
- 在 AlexNet、ResNet-50、DC-GAN、SR-GAN、DeepSpeech2、GNMT 以及两种工业工作负载上进行评估
- 将 BFLOAT16 与 FP16 和 INT16 在准确性和所需超参数调优方面进行比较
- 在 Tensorflow、Caffe2、IntelCaffe 和 Neon 中实现 BFLOAT16 仿真以进行实验
- 展示训练轨迹与 FP32 极为相近,且无需更改超参数
实验结果
研究问题
- RQ1BFLOAT16 训练是否能在视觉、语音、语言、GANs 与推荐系统等领域实现与 FP32 相同的准确性?
- RQ2BFLOAT16 是否消除了 FP16 混合精度常见的损失缩放与超参数调优需求?
- RQ3BFLOAT16 在多样化工作负载中的性能与准确性相比 FP16 与 INT16 如何?
- RQ4BFLOAT16 对训练流程的影响,包括 GEMM 和非 GEMM 运算,在标准框架中为何?
- RQ5在大规模训练管道中采用 BFLOAT16 是否存在实际的硬件与软件影响?
主要发现
- BFLOAT16 在相同迭代次数下,在多个领域取得与 FP32 相同的最先进结果。
- 用 BFLOAT16 仿真训练的 AlexNet 与 ResNet-50 达到与 FP32 基线相似的 top-1/top-5 精度。
- 在 BFLOAT16 下 GNMT BLEU 分数与评估的翻译任务中的 FP32 基线相匹配或超越。
- 用 BFLOAT16 训练的 GAN(DC-GAN、SR-GAN)产生的 inception 分数和 SSIM 指标与 FP32 相当。
- 在推荐系统的工业工作负载中,使用 BFLOAT16 并采用适当的舍入时几乎无损失;直接截断可能带来微小降级。
- BFLOAT16 训练避免了 FP16 与 INT16 方法所需的超参数调优与复杂软件管理。
- 在 AVX512BF16 上的高级仿真表明 BFLOAT16 能在 ResNet-50 上给出使用 FP32 累加的最先进结果。
- 在硬件路径实验中,基于 BFLOAT16 的训练在最少的软件变更下可行,与未来 Xeon CPU 能力相吻合。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。