GPU memory (VRAM)

GPU memory, or VRAM, is the fast memory attached to a graphics processor that holds a model's weights and working data while it runs, so its size largely decides which AI models a GPU can handle.

A GPU has its own memory, separate from the computer's main RAM, sitting right beside the processor so that data can reach it quickly. To run a model on a GPU, the model's weights normally have to fit in that memory along with the working data of the calculation. Data centre GPUs use stacked high-bandwidth memory: Nvidia's H100 has 80 GB moving data at 3.35 terabytes per second in its SXM version and 94 GB in the NVL version. Gaming cards use GDDR memory; Nvidia's RTX 5090 has 32 GB.

A quick calculation shows why memory size matters. Each parameter stored at 16-bit precision takes 2 bytes, so a model with 7 billion parameters needs about 14 GB just for its weights, and a 70 billion parameter model about 140 GB, more than any single H100 holds. Running the model also needs room for working data, which grows with longer inputs and more simultaneous users.

Training needs far more. Hugging Face's documentation reckons that mixed-precision training with the Adam optimiser takes about 6 bytes per parameter for the weights, 8 for the optimiser's records and 4 for the gradients, before counting the intermediate results stored for the backward pass. By its estimate, training a 4 billion parameter model on batches of 16 needs roughly 85 GB.

When a model does not fit there are three main answers. Quantisation stores weights in fewer bits: at 4 bits a 70 billion parameter model's weights shrink to about 35 GB. Large models can be split across several GPUs linked by fast connections. Or parts of the model can be moved out to ordinary RAM, which works but runs much more slowly. This is why so much open-model coverage is really about memory: whether a model runs on a laptop or a single card is usually a question of gigabytes, not processing power.

Memory speed matters as much as size. When a model generates text one token at a time it has to read its weights from memory over and over, so the rate at which memory feeds the processor often sets the pace. That is why chip makers advertise memory bandwidth alongside capacity.

Common questions

How much VRAM do I need to run a large language model?

A rough guide is the number of parameters multiplied by the bytes per parameter, plus some extra room for working data. At 16-bit precision a 7 billion parameter model needs about 14 GB for its weights; quantised to 4 bits it needs about 3.5 GB. Longer prompts and more simultaneous users need more.

What is the difference between VRAM and HBM?

VRAM is the general term for memory attached to a graphics processor. High-bandwidth memory, or HBM, is one kind of it: stacked memory chips packaged next to the processor, used on data centre GPUs such as Nvidia's H100 because it moves data much faster. Consumer graphics cards usually use GDDR memory instead.

What happens if a model does not fit in GPU memory?

It either fails to load or has to be adapted. Common fixes are quantising the weights to fewer bits, splitting the model across several GPUs, or moving parts of it to the computer's main memory, which works but makes the model much slower.

Why does training need more GPU memory than running a model?

Training has to store not only the weights but also the gradients and the optimiser's running records for every parameter, plus intermediate results from the forward pass. With common settings that comes to around 18 bytes per parameter before those intermediate results, against about 2 bytes per parameter to run a 16-bit model.

Finding more

Search for "LLM VRAM requirements", "model memory anatomy" and "quantization memory savings" to work out what a given model needs. Reliable sources include GPU makers' specification pages, documentation from Hugging Face and PyTorch, and model cards, which often list memory requirements. Treat online VRAM calculators as estimates, since real use depends on context length, batch size and the software running the model.

  • GPU memory usageReferenceHugging Face's breakdown of what fills GPU memory in training, with bytes per parameter.
  • NVIDIA H100 Tensor Core GPUOfficialMemory capacity and bandwidth for the H100's data centre versions.
  • GeForce RTX 5090OfficialMemory size and type of a high-end consumer graphics card.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.