← All questions
Training & Fine-tuningHard· Numerical Precision· Optimization· Training Stability

Walk me through every place in a BF16 training run wher...

While BF16 is used for the HBM-heavy tensors, FP32 is necessary in specific areas to maintain numerical stability. First, matmul accumulation occurs in FP32 register buffers before writing to HBM to prevent precision loss. Second, Adam optimizer states (mt, vt, and master weights) require FP32 because weight updates involve very small increments that would be rounded to zero in BF16. Third, LayerNorm and softmax reductions use FP32 to avoid accumulating rounding bias over wide dimensions. Finally, the loss scalar is kept in FP32 for accurate logging and numerical debugging.

Code playground (Python)