Skip to content
$ lynuxpro
← AI Infrastructure & GPUs

LESSON 2 OF 18 · BEGINNER · 11 MIN

GPU basics for engineers

Free previewLesson 2 of the 2 free lessons in this Pro course.Unlock all 18

HOW IT WORKSFour numbers that matter

VRAMdoes the model fit?Memory bandwidthhow fast data movesComputetensor coresInterconnectNVLink, PCIeGPU choice
1/5

Memory: weights need about parameters times bytes per parameter.

7B x 2 bytes = 14 GB (FP16)

In simple words

  • GPU memory (VRAM): the GPU's own fast memory. The model and its working data must fit in it.
  • Tensor Cores: special parts of NVIDIA GPUs that speed up AI maths.
  • Precision (FP32, FP16, BF16, FP8): how many bits each number uses. Fewer bits are faster and use less memory, with a small loss of accuracy.
  • Quantization: shrinking a model by storing its numbers with fewer bits.

Big picture

You do not need to design chips, but you must know a few numbers to choose and run GPUs: how much memory it has, how fast it moves data, how much maths it can do, and how GPUs connect to each other. These four numbers explain most AI infrastructure decisions.

Think of a GPU as a factory. Memory is the size of the warehouse. Memory speed is how fast trucks move boxes in and out. Compute is how many workers there are. The links between GPUs are the roads between factories.

What is inside a GPU

PartPlain meaning
CoresMany small workers. CUDA cores do general maths. Tensor cores are special workers for the matrix maths AI uses
VRAM (also called HBM)The GPU's own fast memory. The model and its working data must fit here
Memory bandwidthHow many GB per second can move between VRAM and the cores
InterconnectLinks to other GPUs: PCIe (slower, common) or NVLink (much faster)
Power and heatA big GPU draws 300 to 1000 W and needs strong cooling

Common data center GPUs

Numbers are approximate. Always check the maker's current data sheet.

GPUVRAMTypical use
T416 GBSmall inference, video, cheap
L424 GBInference, small models
A1024 GBInference, fine-tuning small models
A10040 or 80 GBTraining and large inference
H10080 GBFast training and inference
H200141 GBLarge models, long prompts
B200180+ GBNewest generation, very large models

Will my model fit?

The first question for any model: does it fit in GPU memory? A quick estimate:

memory for weights  =  number of parameters  x  bytes per parameter
OUTPUTterminalutf-8 · 1L
PrecisionBytes per parameter7B model70B model
FP32428 GB280 GB
FP16 / BF16214 GB140 GB
INT817 GB70 GB
INT40.53.5 GB35 GB

This is only the weights. You also need room for the KV cache (the memory a language model uses to remember the conversation, lesson 16) and for working space. A good rule: plan for 20 to 50 percent extra.

So a 7B model in 16-bit (14 GB) fits on a 24 GB GPU. A 70B model in 16-bit (140 GB) needs at least two 80 GB GPUs, or one GPU if you shrink it to 4-bit.

Precision: smaller numbers, faster work

Models can store numbers with fewer bits. This is called quantization. Fewer bits means less memory and faster work, with a small loss in accuracy.

  • FP32: full precision, mostly for old or sensitive work.
  • FP16 / BF16: the normal choice for training and serving.
  • INT8 / INT4 / FP8: used for faster, cheaper serving. Test quality before you rely on it.

How GPUs talk to each other

LinkSpeed (approx.)Where
PCIetens of GB/sBetween a GPU and the CPU, or GPUs in cheaper servers
NVLinkhundreds of GB/sBetween GPUs inside one server
InfiniBand / RoCEup to ~50 GB/s per linkBetween servers (lesson 14)

Why it matters: a model split over several GPUs sends data between them all the time. A slow link makes the GPUs wait.

See how GPUs in a server are connected:

nvidia-smi topo -m
SHELLbashutf-8 · 1L
        GPU0    GPU1    GPU2    GPU3    CPU AffinityGPU0     X      NV12    NV12    NV12    0-31GPU1    NV12     X      NV12    NV12    0-31GPU2    NV12    NV12     X      NV12    0-31GPU3    NV12    NV12    NV12     X      0-31Legend:  X = self,  NV# = connected through # NVLink lanes,  PHB = through PCIe host bridge
OUTPUTterminalutf-8 · 7L

NV12 means fast NVLink. If you saw PHB or SYS, those GPUs talk through slower paths.

Useful commands

nvidia-smi                                  # overviewnvidia-smi --query-gpu=name,memory.used,memory.total,utilization.gpu --format=csvwatch -n 1 nvidia-smi                       # refresh every second
SHELLbashutf-8 · 3L
name, memory.used [MiB], memory.total [MiB], utilization.gpu [%]NVIDIA A100-SXM4-80GB, 61230 MiB, 81920 MiB, 87 %
OUTPUTterminalutf-8 · 2L

Memory use versus GPU use

These are two different numbers.

  • Memory used says how full the warehouse is.
  • GPU utilization says how often the workers had something to do.

A GPU can be 90% full of memory but only 10% busy, for example when a model is loaded but gets few requests. Watch both.

Common mistakes

  • Looking only at the number of GPUs, and not at memory size or links.
  • Forgetting the KV cache and working space, then running out of memory.
  • Using PCIe-only servers for training that needs fast GPU-to-GPU traffic.
  • Assuming 100% utilization means the GPU is used well. It only means something was running.

Summary

  • Four numbers matter: VRAM, memory bandwidth, compute and interconnect.
  • Weights memory is about parameters times bytes per parameter. Add 20 to 50 percent.
  • Lower precision (BF16, INT8, INT4) saves memory and time.
  • NVLink connects GPUs inside a server quickly. Use nvidia-smi topo -m to check.

CHECK YOUR UNDERSTANDING

3 quick questions

  1. 1. A 7B-parameter model is stored in FP16 (2 bytes per parameter). About how much memory do the weights need?

  2. 2. Which link connects GPUs inside one server at the highest speed?

  3. 3. A GPU shows 90 percent memory used but only 10 percent GPU utilization. What is the likely reason?

You've finished the free preview of AI Infrastructure & GPUs

Upgrade to Pro to unlock the remaining 16 lessons, every practice lab and a certificate when you finish.

See plans