arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2010.06192cs.LGstat.ML
收藏

重温BFloat16培训

Revisiting BFloat16 Training

University of Michigan(密歇根大学);SambaNova Systems(SambaNova系统公司);Cornell University(康奈尔大学)

Pedram Zamirai, Jian Zhang, Christopher R. Aberger, Christopher De Sa

摘要:

最先进的通用低精度训练算法使用16位和32位精度的混合,造成了16位硬件计算单元本身不足以最大限度地提高模型精度的民间传说。因此,深度学习加速器被迫同时支持16位和32位浮点单元(FPU),这比仅使用16位FPU进行硬件设计成本更高。我们问:我们是否可以仅使用16位浮点单元来训练深度学习模型,同时仍然匹配32位训练所达到的模型精度?为此,我们研究了广泛采用的BFloat16单元上的16位FPU训练。虽然这些单元通常使用最近的舍入来将输出转换为16位精度,但我们表明,模型权重更新的最近舍入通常会取消小的更新,这会降低收敛性和模型精度。受此启发,我们研究了两个简单的技术,以及建立在数值分析,随机舍入和Kahan求和,以弥补模型精度下降,在16位FPU训练。我们证明了这两种技术可以在16位FPU训练中实现高达7%的绝对验证精度增益。这导致在七个深度学习应用程序中,与32位训练相比,验证准确率降低0.1%至提高0.2%。

英文摘要:

State-of-the-art generic low-precision training algorithms use a mix of 16-bit and 32-bit precision, creating the folklore that 16-bit hardware compute units alone are not enough to maximize model accuracy. As a result, deep learning accelerators are forced to support both 16-bit and 32-bit floating-point units (FPUs), which is more costly than only using 16-bit FPUs for hardware design. We ask: can we train deep learning models only with 16-bit floating-point units, while still matching the model accuracy attained by 32-bit training? Towards this end, we study 16-bit-FPU training on the widely adopted BFloat16 unit. While these units conventionally use nearest rounding to cast output to 16-bit precision, we show that nearest rounding for model weight updates often cancels small updates, which degrades the convergence and model accuracy. Motivated by this, we study two simple techniques well-established in numerical analysis, stochastic rounding and Kahan summation, to remedy the model accuracy degradation in 16-bit-FPU training. We demonstrate that these two techniques can enable up to 7% absolute validation accuracy gain in 16-bit-FPU training. This leads to 0.1% lower to 0.2% higher validation accuracy compared to 32-bit training across seven deep learning applications.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑