What is mixed precision training?

Mixed precision training is a training method that runs most of a neural network's computation in lower-precision number formats such as 16-bit floating point, Brain Floating Point 16 or FP8 while keeping parts needing numerical stability, such as the master copy of weights, in FP32.

Unlike quantisation, which permanently lowers a trained model's precision for inference, mixed precision training uses low precision only during training to speed up computation and save memory; the resulting model itself is not quantised.

Topic
Machine learning, models and training
Also known as
Mixed-precision training, AMP
Origin
2017, Micikevicius et al.

How mixed precision training works

  1. Matrix multiplications in the forward and backward passes run in low precision on the hardware's accelerated units.
  2. An FP32 master copy of weights is kept; each update is applied to it and the low-precision copy is derived from it.
  3. With FP16, the loss is scaled by a factor so small gradients do not round to zero, then unscaled before the update.
  4. BF16 has the same exponent range as FP32, so it usually needs no loss scaling.

In more detail

FP8 mixed precision training

On modern GPUs (Hopper, Blackwell and MI300X architectures), FP8 mixed precision training (using E4M3 for forward activations and weights and E5M2 for gradients) can double peak Tensor Core throughput over BF16. Because FP8 has an even narrower range than FP16, it relies on dynamic per-tensor or fine-grained block-wise scaling factors; some pipelines also keep attention in BF16 and master weights and optimiser states in FP32.

Dynamic loss scaling and overflow handling

In practice, FP16 training uses dynamic loss scaling (such as PyTorch's GradScaler): the scale factor starts high, multiplies the loss before backpropagation and checks unscaled gradients for inf or NaN values. If an overflow is detected, the optimiser step is skipped and the scale factor is halved; if no overflow occurs for a set window of steps, the scale is increased.

Operation lists in automatic mixed precision

Not all operations are safe in 16-bit precision: reductions such as softmax, LayerNorm and RMSNorm, cross-entropy loss and large dot-product accumulations are automatically promoted to FP32 by frameworks like PyTorch AMP (autocast), while matrix multiplications and convolutions run in FP16 or BF16 on Tensor Cores.

Commonly confused terms

TermHow it differs
Quantisation-aware trainingQuantisation-Aware Training (QAT) inserts fake-quantisation nodes into the training graph so the model adapts to target integer inference constraints (such as INT4 or INT8), whereas standard mixed precision training optimises floating-point speed and memory without targeting integer deployment.
FP16 and BF16IEEE FP16 uses 5 exponent and 10 mantissa bits (high precision in a narrow dynamic range, needing loss scaling), whereas BF16 uses 8 exponent and 7 mantissa bits (matching FP32's dynamic range, avoiding underflow at the cost of lower precision).

Why mixed precision training matters for on-premises AI

Mixed precision training lets the same GPU memory train larger models or batches while speeding up training; where in-house GPU capacity is limited, this is a direct saving in cost and time. It is now a default for training and fine-tuning large models. Loss values and gradient overflows are monitored during training to catch numerical problems early. The format depends on hardware support.

ON-PREMISES EXAMPLE

An insurer fine-tunes its claims document classifier on an in-house GPU server with BF16 mixed precision training, using a larger batch in the same memory while monitoring the loss curve.

Common questions

Does mixed precision training quantise the model?

No. Low precision is used only in training computations. The resulting model is not quantised, though it can be quantised separately for inference.

Why is loss scaling needed?

FP16 has a narrow range, so very small gradients can round to zero. Loss scaling moves them into a representable range. It is usually unnecessary with BF16.

Sources

In the glossary: Glossary, M to Q

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.