SysDesignAtlas

GPUs & Accelerators

SMs, HBM, tensor cores, and the memory hierarchy that decides your kernel's speed — plus why every accelerator vendor is fighting the same battle against memory bandwidth.

HLDMedium11 min readaigpuhardwareaccelerators
Confidence

#What a GPU is, structurally

A CPU is optimised for latency on one thread: deep pipelines, huge caches, aggressive branch prediction and speculation, all to finish a single instruction stream as fast as possible.

A GPU is optimised for throughput across tens of thousands of threads. It gives up per-thread speed almost entirely and spends the transistor budget on parallel arithmetic units and memory bandwidth.

   CPU (a modern server socket)      GPU (a datacenter accelerator)

     16-128 complex cores              100-150 streaming multiprocessors
     ~5 GHz, deep OoO pipelines        ~1.5-2 GHz, in-order, simple
     large L1/L2/L3 per core           small caches, huge register file
     ~100-400 GB/s memory bandwidth    ~2-8 TB/s HBM bandwidth
     latency-optimised                 throughput-optimised

   The GPU hides slow memory by keeping ~2,000 threads per unit
   ready to go: the instant one group of threads stops to wait
   for data, another runs. There is no big cache to save you —
   there is only more parallelism.

That last sentence is the design philosophy. A CPU avoids memory stalls with caches and prefetching. A GPU accepts them and covers them with concurrency.

#The memory hierarchy that matters

Two abbreviations run through the rest of this page. An SM (streaming multiprocessor) is one of the ~100 independent processing units a GPU is built from — the rough equivalent of a CPU core, except each one runs thousands of threads. HBM (high-bandwidth memory) is the GPU's main memory, stacked physically next to the chip; it's where your model weights live, and it's the slowest tier that still counts as "on the GPU".

Registers ~256 KB per SM · ~100 TB/s aggregate Shared memory / L1 ~228 KB per SM · ~20 TB/s · programmer-controlled L2 cache ~50-100 MB · ~7 TB/s · shared by all SMs HBM (device memory) 80-192 GB · 2-8 TB/s · where your weights live Host memory over PCIe/NVLink-C2C TBs · 60-900 GB/s · offload territory
Bandwidth drops by orders of magnitude at each step. Kernel optimisation is entirely about staying high in this stack.

Shared memory is the one that distinguishes GPU programming. It is a software-managed scratchpad — you explicitly stage data into it, and it's roughly 100× faster than HBM. Every high-performance GPU kernel is fundamentally an exercise in tiling work so that each tile fits in shared memory and gets reused many times before being written back.

This is exactly what FlashAttention does. Standard attention computes a score for every pair of tokens — an n × n matrix — writes the whole thing out to HBM, then reads it back for the next step. FlashAttention never builds that full matrix. It works through attention in small tiles that fit in shared memory (the on-chip SRAM), and when it needs a value again later it recomputes it rather than storing it and fetching it from HBM. The arithmetic is higher and the runtime is much lower, because HBM traffic — not FLOPs — was what was actually slowing things down.

#Tensor cores

An ordinary GPU core multiplies and adds a few numbers at a time. A tensor core is dedicated hardware that multiplies two small matrices and adds a third, all as a single instruction — because that operation is essentially the only thing neural networks do, and doing it in one step rather than hundreds is where the order-of-magnitude speedup comes from.

   CUDA core:    one fused multiply-add per cycle per lane

   Tensor core:  D = A × B + C  for small matrices (e.g. 16×8×16)
                 in one instruction

   → roughly an order of magnitude more FLOP/s for
     matrix-shaped work

   Consequences that bite:

     · Only matrix multiplication benefits. Elementwise
       operations, softmax, normalisation, and activations
       run on the ordinary cores and are usually
       memory-bound anyway.

     · Dimensions must align to the tensor core tile (multiples
       of 8 or 16). A hidden size of 4,096 is fast; 4,090 may
       not fill the tiles evenly, so the work gets padded or
       falls back to the slower ordinary cores.

     · Lower precision means more throughput: FP8 is typically
       2× FP16, which is ~2× FP32.

#Reading a spec sheet

The comparison that matters, in rough current-generation terms:

PropertyWhat it determinesTypical range
HBM capacityModel size + KV cache = concurrency80–192 GB
HBM bandwidthDecode latency, directly2–8 TB/s
BF16/FP8 dense TFLOPSPrefill and training speed500–5,000
NVLink bandwidthTensor-parallel scaling within a node400–1,800 GB/s
Network per GPUMulti-node training scaling200–800 Gb/s
PowerDatacenter density and cost400–1,200 W

#Power, cooling, and why they became architectural

A modern accelerator draws up to ~1,200 W. Eight in a node is ~10 kW before CPUs, networking, and storage.

   Traditional air-cooled datacenter rack:   6-15 kW
   One 8-GPU AI node:                        ~10-14 kW

   → ONE node fills a conventional rack.

   Consequences:
     · liquid cooling is no longer exotic, it's required
     · power delivery is a hard constraint on how many
       GPUs fit in a building
     · you cannot simply add GPUs to an existing datacenter
     · "GPU shortage" is frequently a power and cooling
       shortage wearing a different name

The newest systems go further and treat the rack as the unit. NVIDIA's GB200 NVL72 (2025) puts 72 GPUs in one liquid-cooled rack drawing roughly 120 kW, all joined by NVLink (NVIDIA's fast GPU-to-GPU link) into a single high-bandwidth domain. That changes parallelism as well as plumbing. Some ways of splitting a model across GPUs — tensor and expert parallelism, covered in model parallelism — make GPUs exchange data constantly, so they only work over NVLink. They used to stop at the 8 GPUs inside one server; now they can span all 72 in the rack.

This is why capacity planning for AI infrastructure involves megawatts and lead times measured in quarters, not an autoscaling group. It's also why autoscaling GPU capacity is slow in a way that has no equivalent in stateless web serving.

#Multi-instance GPU and sharing

A whole accelerator is wasteful for a small model. Three sharing mechanisms, with real differences:

MechanismIsolationNotes
MIG (hardware partitioning)Strong — separate SMs, cache slices, and memory pathsFixed partition sizes; must be configured before workloads start; genuine QoS
Time slicingWeak — contexts swap on the same hardwareEasy, no config; noisy neighbours affect each other's latency badly
MPS (multi-process service)Medium — concurrent kernels, shared memory spaceBetter utilisation than time slicing, no memory protection

For multi-tenant inference where you must guarantee latency, MIG is the only one that actually isolates. For a research cluster where fairness matters more than predictability, time slicing is fine.

#The other accelerators

AcceleratorDistinguishing idea
TPUSystolic array rather than SMs — a big grid of multiply units that pass partial results directly to their neighbours, so data is reused without going back to memory; very high matmul density; 2D/3D torus interconnect that scales to thousands of chips without a switch fabric
Trainium / InferentiaAWS silicon; cost-optimised per unit of throughput; requires its own compiler stack
AMD InstinctCompetitive hardware, particularly on memory capacity; the gap is software maturity, and ROCm has been closing it
Groq / CerebrasBet on enormous on-chip SRAM instead of HBM — eliminating the bandwidth bottleneck entirely for models that fit

That last row is the interesting architectural bet. If decode is bandwidth-bound because weights live in HBM, then putting the weights in SRAM — hundreds of megabytes of it, or a whole wafer's worth — removes the bottleneck rather than optimising around it. The constraint becomes total on-chip memory, so it works for models that fit and not at all for models that don't.

#Exercise

#Check yourself

How does a GPU hide slow memory?Show answer
With massive parallelism rather than caches: ~2,000 threads per SM ready to run, so whenever one group waits on data another executes.
What are SMs and HBM?Show answer
SMs are the ~100 independent processing units of a GPU, each running thousands of threads. HBM is the stacked on-package main memory (80–192 GB, 2–8 TB/s) where weights live.
Why is shared memory the lever in GPU programming?Show answer
It's a programmer-managed scratchpad ~100× faster than HBM; fast kernels tile work to reuse data there. FlashAttention computes attention in SRAM tiles, doing more FLOPs but far less HBM traffic.
What do tensor cores accelerate, and what are the gotchas?Show answer
Only small matrix multiply-accumulates (D = A×B + C) in one instruction — about 10× for matmul. Softmax and norms don't benefit, dimensions must align to tiles, and lower precision means more throughput.
What utilisation do real workloads reach?Show answer
Training 35–55% of peak (50% MFU is excellent), prefill 40–60%, decode at batch 1 under 1% — so judge inference GPUs on bandwidth, capacity and interconnect.
Why are power and cooling architectural constraints?Show answer
An 8-GPU node draws 10–14 kW — a whole conventional rack — and rack-scale systems ~120 kW, so liquid cooling and power delivery limit how many GPUs a building holds.
Which GPU sharing mechanism gives real isolation?Show answer
MIG — hardware partitions with separate SMs, cache slices and memory paths. Time slicing and MPS share hardware, so neighbours affect each other's latency.
What is the bet behind Groq and Cerebras, and what is CUDA's moat?Show answer
Keep weights in huge on-chip SRAM to remove the HBM bottleneck, for models that fit. CUDA's moat is fifteen years of kernels and tooling — cheaper silicon carries a porting bill.

#What to carry forward

  • GPUs are throughput machines that hide memory latency with thousands of threads, not caches.
  • Shared memory is the lever — high-performance kernels tile work to stay out of HBM. FlashAttention is the canonical example.
  • Tensor cores only accelerate matmul, and want aligned dimensions.
  • For inference, judge on bandwidth, capacity, interconnect — not peak TFLOPS.
  • Power and cooling are hard constraints; one 8-GPU node fills a conventional rack.
  • MIG is the only sharing mechanism with real isolation.
  • CUDA is the moat; a cheaper accelerator has an engineering bill attached.
00:00
/ 11m