P-G*_*-Gn 17

bfloat16是一种特定于张流的格式,与IEEE自己的格式不同float16,因此是新名称.

基本上,blfoat16float32截断到它的前16位.所以它对于指数具有相同的8位,对于尾数只有7位.因此,它易于转换float32,并且由于它具有基本相同的范围float32,因此可以最大限度地降低NaN切换时出现s或爆炸/消失梯度的风险float32.

来自消息来源:

// Compact 16-bit encoding of floating point numbers. This representation uses
// 1 bit for the sign, 8 bits for the exponent and 7 bits for the mantissa.  It
// is assumed that floats are in IEEE 754 format so the representation is just
// bits 16-31 of a single precision float.
//
// NOTE: The IEEE floating point standard defines a float16 format that
// is different than this format (it has fewer bits of exponent and more
// bits of mantissa).  We don't use that format here because conversion
// to/from 32-bit floats is more complex for that format, and the
// conversion for this format is very simple.
Run Code Online (Sandbox Code Playgroud)

对于量化整数,它们被设计为替换训练网络中的浮点以加速处理.基本上,它们是实数的一种定点编码,尽管选择的操作范围表示在网络的任何给定点处观察到的分布.

更多关于量化的信息.

  • 我认为他们只是指[bfloat16在内部如何表示](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/numeric_types.h#L49)。 (2认同)