training numerics — loss scale and master weights

Training in a narrow format such as fp8 cannot hold a tiny gradient or a huge one. A loss scale multiplies the gradient before it is stored. Too small and the gradient flushes to zero. Too large and it overflows. The optimizer still steps a full-precision master copy of the weights, and that copy is the memory price of the narrow format.

A loss scale moves one tiny gradient and one ordinary gradient through the FP8 E4M3 range. Flush, keep, and overflow are the three fates. The fp32 master copy is four times the fp8 weight bytes.