Skip to content
All papers

Mixed Precision Training

Paulius Micikevicius, Sharan Narang, Jonah Alben, et al.2018ICLR 2018

Read it on arxiv.org(opens in a new tab)

Why this one

Read this before LLM.int8(), GPTQ, SmoothQuant, AWQ, and the 4-bit inference paper. Those later tricks look like compression, but this one teaches the older lesson: lower precision is mostly a numerics problem before it is a hardware problem. The key idea is not “use fp16 and go faster.” It is that some tensors can be rounded aggressively, while others need a safe place to accumulate small changes, and gradients may need to be lifted into range before they vanish. People get this wrong when they treat mixed precision as a flag in PyTorch instead of a contract between the optimizer, the loss scale, and the accelerator. If you train or serve models, this is worth an evening because it gives you the mental model behind every precision knob you will touch later.

What to take away

  • Keep fp32 master weights because fp16 updates can be too small to change stored parameters.
  • Loss scaling protects tiny gradients from underflow before backprop stores them in fp16.
  • Mixed precision works when each tensor type gets the precision its numerical role requires.

Reads with

Where it lands in the course

Inference Engineering · Fewer Bytes, Fewer Steps