GPU Kernels Explained

GPU Kernels Explained

How a GPU actually executes the maths.

An interactive guide to how a GPU runs kernels, from the A100 to Blackwell: the memory hierarchy, warps, coalescing, occupancy, GEMM, FlashAttention and the warp-specialised tensor-core pipeline, each animated by a tested execution model.

A100BF16 201H100BF16 295 · FP8 591B200BF16 313 · FP8 625 · NVFP4 1,250BF16FP8NVFP4
Flops of tensor-core work each byte from HBM must feed before the GPU stops waiting on memory (dense peak over HBM bandwidth), to scale. Each generation, and each narrower format, moves it right.

How this is checkedThe GPU model is checked against the CUDA Programming Guide's worked examples (coalescing, bank conflicts, occupancy), and its TypeScript port reproduces the Python reference exactly. How it is tested →

What you'll learn

A GPU can do arithmetic far faster than it can fetch the numbers to do it on. A B200's tensor cores need 313 flops of BF16 work on every byte from its HBM just to keep busy (1,250 at NVFP4); an H100's needed 295 and an A100's 201. Every fast kernel is a way of closing that gap: reuse data close to the ALUs, fetch it in whole transactions, avoid serialising on shared memory, keep the tensor cores fed from a pipeline of loads. Chapter 12 shows how Hopper and Blackwell kernels do it.

Each chapter here is built around an animation, and every frame is computed by a small GPU execution model that is tested against a Python reference. The hardware figures come from NVIDIA's whitepapers and datasheets, the CUDA Programming Guide and published microbenchmarks.

Every number on the GPUs the model uses, with its source: the GPU presets.

New to the Hardware track? Start here: the four sites in reading order, what you need first, and a glossary of the terms they define.

Built by a hardware engineer

The author designs hardware: the RTL, SoC and signal-integrity work behind this track is public too.

Part of a family of sixteen companion sites in four tracks, all in the site menu above: Foundations (Decoder, Training), Hardware (Kernels, Systolic, Accelerators, Racks), Inference (Serving, Architectures, Numerics, Trade-offs) and Agents (Harnesses, Protocols, Context, Orchestration, Evals, Security). This site is the layer underneath: the kernels. How it was built, and how to check it: about.