arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2104.07329cs.LGcs.AI
收藏

适用于深度神经网络精确和内存高效推理的全能8位灵活浮点格式

All-You-Can-Fit 8-Bit Flexible Floating-Point Format for Accurate and Memory-Efficient Inference of Deep Neural Networks

National Yang Ming Chiao Tung University(阳明交通大学)

Cheng-Wei Huang, Tim-Wei Chen, Juinn-Dar Huang

摘要:

现代深度神经网络(DNN)模型通常需要大量的权重和激活值来实现良好的推理结果。这些数据不可避免地需要大量的片外存储器容量/带宽,如果它们以高精度浮点格式表示,情况会变得更糟。尽管已经努力以不同的8位浮点格式表示这些数据,但仍然不可避免地存在显著的精度损失。在本文中,我们介绍了一种非常灵活的8位浮点(FFP 8)格式,其定义因素-指数/分数字段的位宽,指数偏置,甚至符号位的存在-都是可配置的。我们还提出了一种方法来适当地确定这些因素,使模型推理的准确性可以最大化。这种方法的基础是基于一个关键的观察-在大多数DNN模型中,权重和激活之间的最大幅度和值分布都非常不同。实验结果表明,所提出的FFP 8格式实现了极低的准确率损失的$0.1\%\sim 0.3\%$的几个代表性的图像分类模型,即使不需要模型再训练。此外,它很容易把一个经典的浮点处理单元变成一个FFP 8兼容的,和额外的硬件成本很小。

英文摘要:

Modern deep neural network (DNN) models generally require a huge amount of weight and activation values to achieve good inference outcomes. Those data inevitably demand a massive off-chip memory capacity/bandwidth, and the situation gets even worse if they are represented in high-precision floating-point formats. Effort has been made for representing those data in different 8-bit floating-point formats, nevertheless, a notable accuracy loss is still unavoidable. In this paper we introduce an extremely flexible 8-bit floating-point (FFP8) format whose defining factors - the bit width of exponent/fraction field, the exponent bias, and even the presence of the sign bit - are all configurable. We also present a methodology to properly determine those factors so that the accuracy of model inference can be maximized. The foundation of this methodology is based on a key observation - both the maximum magnitude and the value distribution are quite dissimilar between weights and activations in most DNN models. Experimental results demonstrate that the proposed FFP8 format achieves an extremely low accuracy loss of $0.1\%\sim 0.3\%$ for several representative image classification models even without the need of model retraining. Besides, it is easy to turn a classical floating-point processing unit into an FFP8-compliant one, and the extra hardware cost is minor.

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

↑