Model memory footprint

Inference · Formula · Appears in 7 lessons

Mweights=N⋅bM_{\text{weights}} = N \cdot b

Parameters times bytes per parameter. At fp16 a 7-billion-parameter model needs about 14 GB before any activations or cache; at 4-bit it needs under 4. Training needs several times more, because the optimiser keeps its own copies.

Symbols

NN
The number of parameters.
bb
Bytes per parameter — 4 at fp32, 2 at fp16, 0.5 at int4.
Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark