What is AI 8-bit floating point (FP8)?
FP8 is a floating point format representing numbers in 8 bits; the format proposed for deep learning has two encodings: E4M3 with a 4-bit exponent and 3-bit mantissa plus E5M2 with a 5-bit exponent and 2-bit mantissa.
Unlike 8-bit integer, which uses evenly spaced integers, FP8's exponent bits cover a wider range at coarse precision. E4M3 offers more precision, E5M2 more range.
- Topic
- Infrastructure and runtime
- Also known as
- E4M3, E5M2
- Origin
- 2022
How AI 8-bit floating point (FP8) works
- Weights and activations are converted from 16-bit to 8-bit floating point.
- Per-tensor scaling factors fit values into the FP8 range.
- Matrix multiplications run on FP8-capable hardware, with accumulation usually kept at higher precision.
- Results are converted back to 16 or 32 bits when needed.
In more detail
E4M3 for the forward pass and E5M2 for the backward pass: roles and limits
In FP8 mixed-precision training, the two encodings serve complementary roles: E4M3 (with a maximum finite value of 448 and no infinity representation) is used in the forward pass for weights and activations where precision matters, while E5M2 (with a maximum finite value of 57,344 and IEEE 754 Inf/NaN rules) is used in the backward pass for gradients that require wider dynamic range.
Delayed and block-wise scaling
Selecting scaling factors requires either delayed scaling, which tracks the maximum absolute value (amax) history from prior iterations to avoid extra memory passes or current (dynamic) fine-grained scaling, where tile-wise or block-wise scales (such as 1×128 activation blocks and 128×128 weight blocks) absorb outlier spikes common in large language models.
The OCP MXFP8 standard and FP8 KV caches
Following the 2022 NVIDIA-Arm-Intel specification, industry adoption expanded through the Open Compute Project (OCP) Microscaling Formats (MXFP8) standard, pairing E4M3/E5M2 elements with shared 32-element E8M0 block exponents and hardware support across NVIDIA Hopper/Blackwell and AMD Instinct MI300+ accelerators, alongside FP8 KV-cache compression in LLM inference engines.
Commonly confused terms
| Term | How it differs |
|---|---|
| FP4 | FP8 uses 8 bits per element and preserves reasonable accuracy with minimal calibration, whereas FP4 (e.g., E2M1 or NVFP4) halves memory again to 4 bits per element but requires tight block-wise microscaling to maintain LLM quality. |
Why AI 8-bit floating point (FP8) matters for on-premises AI
The paper proposing FP8 calls 8-bit floating point a natural progression for accelerating training and inference beyond common 16-bit formats; it explains E5M2 follows IEEE 754 conventions for special values while E4M3 extends its range by not representing infinities, showing results matching 16-bit training on image and language tasks. The mixed precision training paper shows lower precision narrows range, managing the loss with techniques such as keeping a single-precision weight copy. Example calculation: 8-bit values take half the memory of 16-bit ones.
Before running its in-house language model with FP8 inference on new FP8-capable GPUs, a platform team compares it with the 16-bit version on an internal evaluation set, approving the switch once the gap stays within tolerance.
Common questions
Does FP8 run on every GPU?
No. Speed-ups need hardware supporting FP8 matrix operations; elsewhere gains may be limited to memory.
Does FP8 reduce accuracy?
With proper scaling and mixed precision it comes close to 16-bit on many tasks, but should be tested on the organisation's own tasks.
Related terms
- AI numerical precision
- AI quantisation
- AI 16-bit floating point (FP16)
- AI brain floating point 16 (BF16)
- Mixed precision training
- AI 8-bit integer (INT8)
Sources
In the glossary: Glossary, A to D