FP8 E4M3 - 8-Bit Floating Point

OCP 8-bit format with higher precision: 4 exponent bits, 3 mantissa bits

Bit Layout

Sign
S
1 bit
Exponent
E
E
E
E
4 bits
Mantissa
M
M
M
3 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.

Overview

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.

No infinity in OCP E4M3 Unlike standard IEEE 754 formats, OCP E4M3 does not have infinity. Overflow saturates to the maximum normal value (±448) instead of producing infinity. This is intentional, as it prevents training instabilities caused by inf propagation.

Encoding Rules

Normal Numbers

value = (-1)sign × 2(exponent - 7) × (1 + mantissa / 8)

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).

Subnormal Numbers

value = (-1)sign × 2-6 × (mantissa / 8)

Special Values (OCP Rules)

OCP NaN convention In standard IEEE 754, any non-zero mantissa at max exponent is NaN (giving many NaN encodings). In OCP E4M3, only the all-ones mantissa is NaN. This reclaims the other patterns as usable normal values, increasing the format's representable range.

Interactive Value Visualizer

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.

Dynamic Range & Precision

PropertyValue
Max Positive (Normal)448
Min Positive (Normal)0.015625
Max Subnormal0.013671875
Min Positive (Subnormal)0.001953125
Machine Epsilon (at 1.0)0.125
Approx. Decimal Digits~0.9
Exponent Bias7
Exponent Range2^-6 to 2^8
Total Bit Patterns256
Supports InfinityNo
Supports NaNYes

Special Values & Bit Patterns

ValueBit PatternDecimal
+00 0000 0000
-01 0000 000-0
Min Subnormal0 0000 0010.001953125
Max Subnormal0 0000 1110.013671875
Min Normal0 0001 0000.015625
Max Normal0 1111 110448
NaN0 1111 111NaN

Format Comparison

PropertyFP8 E4M3FP8 E5M2FP6 E3M2FP6 E2M3E8M0
Total Bits88668
Sign Bits11110
Exponent Bits45328
Mantissa Bits32230
Bias71531127
Max Value44857344287.51.701411835e+38
Min Normal0.0156250.000061035156250.2515.877471754e-39
Epsilon0.1250.250.250.1251
~Decimal Digits~0.9~0.6~0.6~0.9~0.0
Has InfinityNoYesNoNoNo
Has NaNYesYesNoNoYes
Has SubnormalsYesYesYesYesNo

Where FP8 E4M3 Is Used