OCP 8-bit format with higher precision: 4 exponent bits, 3 mantissa bits
FP8 E4M3 uses 4 exponent bits and 3 mantissa bits. The extra mantissa bit (compared to E5M2) doubles the number of distinct values per power-of-2 interval from 4 to 8, at the cost of a narrower exponent range.
FP8 E4M3 is the precision-focused variant of the OCP Microscaling Specification. It's designed for storing weights and activations in neural networks, where precision matters more than range.
The OCP variant of E4M3 has an important special rule: it does not support infinity. The bit pattern that would normally be infinity (max exponent, mantissa = 0) instead represents a normal number. Only the single pattern with max exponent and all-ones mantissa (0 1111 111) is reserved for NaN. This gives E4M3 a higher maximum representable value (448 vs 240 if infinity were supported).
FP8 E4M3 is the preferred format for quantized inference on NVIDIA Hopper (H100) and later GPUs. Combined with E5M2 for gradients, it enables full FP8 training pipelines.
With 3 mantissa bits, there are 8 representable values per power-of-2 interval: 1.000, 1.125, 1.250, 1.375, 1.500, 1.625, 1.750, 1.875 (times the power of 2). The bias of 7 is calculated as 2(e-1) - 1, where e is the number of exponent bits (4).
S 1111 111 (max exponent, all-ones mantissa) is NaN. All other max-exponent patterns are normal numbers.Click any bit to flip it, drag the slider, or enter a decimal or hex value. The graphs show how values are distributed across the encoding space.
torch.float8_e4m3fn as a native dtype. The torchao quantization library uses it directly in Float8DynamicActivationFloat8WeightConfig pipelines.float_e4m3_t with PTX inline asm for saturation-mode conversion. Triton exports float8e4nv as a kernel-programmable dtype.float8_e4m3fn (and variants float8_e4m3fnuz, float8_e4m3b11fnuz) as NumPy dtype extensions for JAX and TensorFlow. The ONNX proto defines FLOAT8E4M3FN = 17.