Need lower-memory floating-point arrays for deep learning? bfloat16 gives JAX a 16-bit format with a float32-like exponent range and reduced significand precision. It uses less storage than float32 and sits alongside float16, float32, and float64 in JAX's dtype system. section 3.3.2
Create and inspect a bfloat16 array
xb16 = jnp.array(range(10), dtype=jnp.bfloat16) xb16.dtype >>> dtype(bfloat16) xb16.nbytes >>> 20 A ten-element array therefore reports the bfloat16 dtype and occupies 20 bytes. Mixing xb16 with float16 promotes the result to float32, while adding two bfloat16 arrays preserves bfloat16. section 3.3.2


