GPU architecture and its evolution
A clear, exam-focused summary of GPU architecture and how it evolved from fixed-function graphics hardware to modern programmable streaming multiprocessors, with definitions, formulas, worked numerical examples, common mistakes and exam-style guidance.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
GPUs accelerate data-parallel and throughput-oriented tasks such as graphics, scientific computing and machine learning. An engineer uses GPU-architecture knowledge to choose hardware, map algorithms (see Parallelism on the GPU) and optimise performance (see Optimising CUDA applications and Reducing global memory traffic with tiling).
Key ideas
Start with the purpose: a processor design trades latency (time to finish one task) for throughput (tasks per second). GPUs are designed for high throughput on many similar tasks.
- GPU (Graphics Processing Unit): a processor specialised for highly parallel, regular computations. It contains many simple compute lanes and a memory hierarchy optimised for high bandwidth. (First use.)
- CPU (Central Processing Unit): a processor designed for low-latency execution of few threads, with complex control and large caches.
- SIMD (Single Instruction, Multiple Data): a parallel execution model where one instruction operates on multiple data elements simultaneously. Assumes data-level parallelism and same control flow.
- SIMT (Single Instruction, Multiple Threads): NVIDIA's term for executing many threads per warp under one program counter; similar to SIMD but with separate thread contexts and dynamic branching handled by masking. Refer also to Warps, threads, blocks and grids for implementation details.
- ALU (Arithmetic Logic Unit): hardware unit that performs arithmetic (add, multiply) and logic operations.
- Streaming Multiprocessor (SM): the basic compute cluster in an NVIDIA GPU; contains many ALUs, special-function units, warp schedulers, register file and shared memory.
- Shader / programmable shader: a small program that runs on GPU units (vertex, fragment, compute shaders). The move from fixed-function pipelines to programmable shaders enabled GPGPU.
- Memory hierarchy: the organisation of registers, on-chip shared memory (per-SM SRAM) and caches (L1/L2), and off-chip DRAM. Note: in CUDA, per-thread 'local memory' resides in off-chip DRAM (though it may be cached), not on-chip scratch. Important for bandwidth and latency trade-offs.
Exact definition used in exams: "A GPU is a throughput-oriented parallel processor comprised of multiple streaming multiprocessors, each with multiple ALUs and local fast memory, designed to maximise arithmetic operations per second given a high-bandwidth DRAM system." Assumptions: uniform-cost compute lanes, large parallel workload, memory accesses can be coalesced.
Roofline model (exact statement):
- Let P_peak be the processor peak compute (FLOPS). Let B_peak be the peak memory bandwidth (bytes/s). Let I be arithmetic intensity (FLOPs per byte). Then the achievable performance P satisfies:
- P <= P_peak (compute bound)
- P <= I * B_peak (memory bound)
- Therefore P <= min(P_peak, I * B_peak). Assumptions: steady-state execution, ideal utilisation, no other bottlenecks (e.g., instruction issue limits or latency penalties). Also, I and B_peak refer to off-chip DRAM traffic; cache effects and uncoalesced accesses can increase effective bytes transferred. Derivation: performance = (FLOPs executed) / time; time >= data_bytes / B_peak; so FLOPs/time <= FLOPs/(data_bytes/B_peak)=I*B_peak. Compare with compute-bound limit P_peak.
Diagram to draw for an exam (exact description):
- Draw a rectangular box labelled "GPU chip". Inside, draw 4 smaller boxes labelled "SM 0", "SM 1", "SM 2", "SM 3" (for example). Inside each SM box, draw and label: "Warp scheduler(s)", "Register file", "ALUs / FPUs (n units)", "Load/store unit", "Shared memory / L1 cache". Outside the SMs but inside the GPU chip draw "L2 cache". Inside the GPU chip (near the edge), draw "Memory controller(s)" connecting via off-chip channels to "DRAM (GDDR)". Label arrows: SM -> L1, SM -> L2, L2 -> Memory controller -> DRAM. This shows locality and where to optimise.
Evolution timeline (high-level steps):
- Fixed-function graphics pipelines: hardware units for rasterization and texturing.
- Programmable shaders: small programs for vertices/pixels, more general but still graphics-focused.
- GPGPU (General-Purpose GPU): using shaders for non-graphics tasks (early 2000s).
- CUDA / OpenCL and compute APIs: explicit programming models, kernels, threads — made GPUs general-purpose parallel processors.
- Modern GPUs: large SMs with many ALUs, higher memory bandwidth, specialised units (tensor cores) for ML.
Formulas
P_peak = N_cores · f_clock · ops_per_core_per_cycle
- N_cores: number of ALUs (unitless). f_clock: clock frequency (Hz). ops_per_core_per_cycle: FLOPs per core per cycle (unitless). P_peak in FLOPS (s^-1). Applies to arithmetic peak estimate.
Bandwidth = (bus_width_bits / 8) · data_rate_bits_per_pin
- bus_width_bits: aggregate memory bus width in bits (across all pins/channels). data_rate_bits_per_pin: effective data rate in bits/s per pin (published as Gbps per pin). Bandwidth in bytes/s. Applies to DRAM bandwidth (e.g., GDDR).
Arithmetic intensity I = FLOPs_executed / bytes_transferred
- Units FLOPs/byte. Use steady-state values for roofline.
P_max (upper bound) = min(P_peak, I · B_peak)
- Roofline upper bound under ideal conditions; P_max in FLOPS.
Latency hiding heuristic: Effective throughput ≈ Issue-rate · Utilisation, where utilisation improves with parallel threads when memory latency >> compute time. (No single formula; reason qualitatively.)
Note: When counting FLOPs, a fused multiply–add (FMA) usually counts as 2 FLOPs per cycle per FMA-capable unit. Verify for the specific GPU model.
Worked examples
Example 1 — Compute peak FP32 FLOPS Problem: A GPU has 2048 CUDA cores, core clock 1.20 GHz, and each core can do one FMA per cycle (count as 2 FLOPs). Compute peak single-precision FLOPS. Steps:
- Use formula: P_peak = N_cores · f_clock · ops_per_core_per_cycle.
- Substitute: N_cores = 2048, f_clock = 1.20e9 Hz, ops/core/cycle = 2.
- P_peak = 2048 · 1.20e9 · 2 = 4.9152e12 FLOPS. Final answer: 4.9152 × 10^12 FLOPS = 4.9152 TFLOPS (single-precision). (Units: FLOPS = operations per second.)
Example 2 — Memory bandwidth calculation Problem: A GPU has a 256-bit memory bus and uses GDDR5 memory rated at 7.0 Gbits/s per pin. Compute peak memory bandwidth in GB/s. Steps:
- Bytes per transfer = 256 bits / 8 = 32 bytes.
- Data rate per pin = 7.0e9 bits/s per pin (effective, equals 7.0e9 transfers/s per 1-bit pin). So Bandwidth = 32 bytes · 7.0e9 s^-1 = 224e9 bytes/s. Final answer: 224 × 10^9 bytes/s = 224 GB/s. Note: Confirm the GDDR generation and its effective rate from the vendor for exact figures.
Example 3 — Apply roofline Problem: Using Example 1 (P_peak = 4.9152 TFLOPS) and Example 2 (Bandwidth = 224 GB/s), find minimum arithmetic intensity I that makes the kernel compute-bound. Steps:
- For compute-bound I such that P_peak <= I · Bandwidth, solve I >= P_peak / Bandwidth.
- P_peak / Bandwidth = 4.9152e12 FLOPS / 224e9 bytes/s = 21.94 FLOPs/byte. Final answer: Arithmetic intensity ≥ 21.94 FLOPs/byte for compute-bound operation.
Common mistakes
- Using raw core count without checking whether the core can perform 2 FLOPs per cycle (FMA) or only 1.
- Confusing clock frequency of shader cores with memory clock for bandwidth.
- Applying roofline without stating assumptions (steady-state, no other bottlenecks).
- Drawing SM diagrams without labelling register file, warp scheduler, or shared memory.
- Saying "GPU is SIMD" as a precise statement without explaining SIMT and thread masking differences.
For your exam
Kinds of questions:
- Definitions and short notes: define GPU, SM, SIMD vs SIMT, memory hierarchy.
- Diagrams: draw and label SM and memory hierarchy; explain data path for a load/store.
- Derivations: derive the roofline inequality and explain assumptions.
- Numericals: compute peak FLOPS and bandwidth; compute arithmetic intensity threshold.
- Long answers: explain evolution from fixed-function to programmable GPUs and the impact on GPGPU. Full-marks answer checklist:
- Give precise definitions with assumptions.
- For diagrams: include all major blocks and arrows showing data flow, and label each block.
- For derivations: show each algebraic step and state assumptions.
- For numericals: show formula, substitute numbers with units, calculate step-by-step, and give final result with correct units.
Quick check
- Define arithmetic intensity in one sentence.
- Write the roofline inequality relating peak FLOPS, bandwidth and arithmetic intensity.
- When is a kernel memory-bound versus compute-bound? Answers: 1) Arithmetic intensity = FLOPs executed divided by bytes transferred (FLOPs/byte). 2) P <= min(P_peak, I · Bandwidth). 3) Memory-bound when I · Bandwidth < P_peak; compute-bound when I · Bandwidth ≥ P_peak.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?