EMZETT.
Login

VRAM and model size

In short: VRAM is the memory of the graphics card. A language model runs fastest when it fits completely.

In more detail: The memory need in gigabytes is roughly: parameters (in billions) × bits per weight ÷ 8, plus 10 to 20 % for context and intermediate values. A 70-billion model needs 140 GB in 16-bit and about 40 GB in 4-bit.

Our context: The AI speed calculator checks whether model and context fit into VRAM. Otherwise the remainder is offloaded to the slower main memory (offloading).

In Depth

Model16-bit8-bit4-bit
8 bn16 GB8 GB4.5 GB
32 bn64 GB32 GB18 GB
70 bn140 GB70 GB40 GB
  • KV cache: grows with context length and adds to the model (KV cache).
  • Several cards: The memory adds up; speed depends on the split (multi-GPU and tensor parallelism).
  • Rule of thumb for buyers: 24 GB of VRAM allow models up to about 30 billion parameters in 4-bit, 48 GB up to about 70 billion.

See also: Quantisation, Memory bandwidth