FP8
An 8-bit float per weight with one scale for the whole tensor. The grid is dense near zero and sparse at the edges, which suits bell-shaped weights.
What the figure shows
All 64 weights share one scale, so the figure has a single block. The blue lines are the FP8 values after scaling. They bunch up around zero: each power of two holds the same 8 values (3 mantissa bits), so the gap between neighbours doubles with every binade. Small weights get small errors, and large weights get large ones.
The formats
| E4M3 (OCP "FN") | E5M2 | |
|---|---|---|
| exponent / mantissa | 4 / 3 | 5 / 2 |
| bias | 7 | 15 |
| largest value | 448 | 57344 |
| specials | only S.1111.111 is NaN, no infinity | IEEE-style infinities and NaNs |
Rounding is to nearest, ties to the even code, saturating at the largest value. The helpers E4M3,
E5M2 and E2M1 in the editor are built by minifloat({ exp, man, bias, special }),
so you can define your own, for example minifloat({ exp: 3, man: 4, bias: 3 }).