Syllabus
The path
112 hours if you do the work. Progress stays on this device.
M0
8 h
Setup, profiling, roofline
From FLOPs, bytes, a peak and a bandwidth, compute intensity, the ridge, the bound, and the roofline time. The unit test is the answer key for the arithmetic.
Full lesson · Any GPU, or CPU for the arithmetic
M1
10 h
Compilation and fusion
Name the compile mode you used and which of fusion, autotune, or a CUDA graph you actually got. A flag you set is not evidence the graph replayed.
Full lesson · Tier A. CUDA graphs want a fixed shape.
M2
16 h
Writing a real kernel
Pass assert_close against eager PyTorch on a fixed seed, including a negative input and a length that is not a multiple of the tile.
Skeleton + gates · Tier A. Triton first. CUDA C++ only after the Triton kernel matches PyTorch.
M3
16 h
Attention, exact and sparse
Match a dense reference on a short sequence, including a causal or padding mask, before you drop any block.
Skeleton + gates · Tier A for a short sequence. Tier B if you approach real video token counts.
M4
12 h
Step caching
At a threshold of zero, match the uncached loop within a tolerance you wrote down first.
Skeleton + gates · Tier A on the synthetic DiT. Tier B before you trust a long video.
M5
12 h
Low precision
Quantise one GEMM, keep the residual add and the softmax in a wider type, and show a case where doing it backwards destroys the update.
Skeleton + gates · FP8 wants Hopper or newer for tensor-core paths. NVFP4 is a Blackwell topic.
M6
14 h
Serving and scale
Name the batching unit (token, sequence, clip, or diffusion step) and show that pad tokens are not billed as work.
Skeleton + gates · Tier A for a batching toy. Multi-GPU is Tier B or a rental.
M7
24 h
Capstone
Publish four rows that share a seed, a decode path, and a step count: dense, kernels, plus sparse attention, plus cache.
Skeleton + gates · Tier A if the target is the synthetic DiT or a small Apache-licensed video model that fits. Tier B for larger open video DiTs.