Log inStart free
LESSON 30.09 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

FP8 inference

Watch one layer run in 8-bit floats and see what each bit costs.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 30.09 · LOW-BIT BAYFP8 E4M3 · 126 VALUES · MAX 448
01
Stage 1 of 5 · The value grid
FP8 E4M3 has 4 exponent bits and 3 mantissa bits. Its 126 positive values run from 0.00195 to 448.
Explain it simply

Each tick is one value the format can store. The line doubles at each equal width. Inside each doubling there are 8 evenly spaced values, so the gap grows with the value. Every value keeps about the same share of precision, about 1 part in 8.

A powers-of-two number line has 126 ticks, one per positive FP8 E4M3 value. They run from 0.00195 to 448. A bit box shows the layout.

activations xweights W, formatrounding erroroutput yexact value
2⁻¹⁶2⁻¹²2⁻⁸2⁻⁴12⁴2⁸2¹²2¹⁶signexponentmantissaFP8 E4M30.00195448max = 2⁸ × 1.75 = 448the value grid2⁻¹⁶2⁻¹²2⁻⁸2⁻⁴12⁴2⁸2¹²2¹⁶signexponentmantissaFP8 E4M30.00195448max = 2⁸ × 1.75 = 448the value grid
Toy: one layer, 8 activations × a 4 × 8 weight matrix; seeded, not trained
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
v=(−1)s 2 e−b(1+m2M)\sy{v}{param}{v} = (-1)^{s}\, 2^{\,e-\sy{b}{param}{b}} \left(1 + \tfrac{m}{2^{\sy{M}{param}{M}}}\right)
b=7,  M=3,  max⁡=28⋅1.75=448b = 7,\; M = 3,\; \max = 2^{8} \cdot 1.75 = 448

A float is a sign, a power of two and a fraction.

Common mix-ups

MYTHFP8 needs no scale because floats have a wide range.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With INT8, a per-tensor scale and the outlier 600, do small activations keep their values?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.