FP8 E4M3 - 8-Bit Floating Point

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

Bit Layout

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

Special Values & Bit Patterns

Format Comparison

Where FP8 E4M3 Is Used