Arrow keys / space to advance · Ctrl-P to export PDF

Parallel Programming

GPU + ML Expert Tutor

From "what is a GPU thread" to designing, profiling, and shipping production ML systems on AMD and NVIDIA hardware. 30 modules, four tracks, every claim reproducible.

AMD ROCm / HIP   NVIDIA CUDA   + portable Triton

Parallel Programming · Curriculum overview
01

The promise

Two altitudes, every single time

Every module explains the idea twice: a plain-language analogy that a non-programmer can follow, then the rigorous framing a Principal Engineer would expect.

A GPU is a stadium of 50,000 diligent students, not a faster CPU. That gets you in the door. Then we map it onto wavefronts, occupancy, and HBM bandwidth.

Parallel Programming · Design intent
02

What you get

30

modules across four tracks — roughly 203 learner-hours if you do the labs and the drills, not just the reading. Every module ships runnable code, exercises, and worked solutions.

Parallel Programming · Scope
03

Structure

Four tracks, one arc

A · Write kernels

Programming model, memory, execution, reduction, scan, GEMM, softmax, Triton, FlashAttention. 10 modules.

B · Reason about speed

Architecture, roofline, profiling, precision, transformer perf, serving, sharding. 7 modules.

C · Ship systems

Framing, data, training, optimization, deployment, monitoring, two capstones. 7 modules.

D · Scale across nodes

Scaling limits, MPI, NCCL and RCCL, RDMA and fabrics, topology, and where real systems stop scaling. 6 modules.

Parallel Programming · Tracks A / B / C / D
04

Consistency

Every module, the same nine sections

1–2
Layman analogy, then first principles — derived, not asserted
3
Deep dive mapped onto real silicon (CDNA and Hopper)
4–5
Hands-on labs, then performance analysis against the roofline
6
Challenges, drawbacks, tradeoffs — and when not to do this
7–8
Where it appears in production ML, with cited sources
9
Self-assessment and interview drills, with solutions

It is a quality contract, not bureaucracy: a technique with no stated downside means nobody looked hard enough.

Parallel Programming · Module template
05

Portability

Dual-vendor, and honest about the gaps

Labs ship as hip/ and cuda/ line-for-line counterparts, plus a triton/ path that runs on both.

Parallel Programming · Dual-vendor design
06

The rule that shaped everything

Never publish a number the repo cannot reproduce

Parallel Programming · Evidence standard
07

Module A01 · Foundations

0.06%

of the run was the kernel. A profiled vector-add took 44 microseconds inside a 72 millisecond program. On a GPU, moving the data usually costs more than doing the math — and if you only measure kernel time you will optimize the wrong thing for years.

Parallel Programming · A01 · rocprofv3 profile
08

Module A02 · Memory coalescing

4.8×

faster, same arithmetic. Four transpose kernels, all producing verified-correct output: 700 GB/s naive to 3,400 GB/s tiled-and-padded. One of those steps is a single character — tile[32][32] to tile[32][33].

Parallel Programming · A02 · transpose ladder
09

Module B04 · Precision

"fp8" is two different formats

CDNA 3 implements the FNUZ variants (bias 8, max 240). Hopper implements OCP (bias 7, max 448).

Parallel Programming · B04 · cited to the HIP low-precision reference
10

Module B07 · Sharding

Pipelining does not reduce activation memory

Under 1F1B scheduling, each stage holds L/S layers but keeps S micro-batches in flight. The S cancels.

Engineers reach for pipeline parallelism as a memory fix. It is a throughput fix. Deriving why is worth more than a page of guidance.

Parallel Programming · B07 · derived cost models
11

Module C07 · Capstone

The KV cache was not the binding constraint

Sizing an LLM serving node: HBM allows a 3.56 million token KV pool, but the 30 ms latency SLO caps the scheduler at 567 thousand. Latency binds first.

Quantizing to fp8 then flips decode to compute-bound — so further KV quantization buys nothing. Knowing where an optimization stops paying is the harder judgement.

Parallel Programming · C07 · every figure from the shipped calculator
12

How to use it

Four routes, depending on why you are here

Write fast kernels

Track A end to end, with B01–B03 early so you can measure what you write.

Make models fast

The ML-critical kernels, then all of Track B.

Design ML systems

Track C in order, pulling in B04 and B06 where design needs them.

Interview soon

The canonical kernels, perf fundamentals, and end-to-end design.

Parallel Programming · Learning paths
13

Start here

Pick a path, then do the labs

Plan
Study planner — tick modules off, watch the hours drop
Test
Recall cards — retrieval practice, every card cited
Look up
Reference sheets — track and concept cheatsheets, printable
Play
Concept players — twelve interactive controls, one per concept cluster
Index
CURRICULUM.md — dependency graph and learning paths
Setup
docs/SETUP.md — get hipcc, nvcc, or Triton working
First
Module A01 — assumes no GPU experience

Reading teaches you the shape of the answer. Running the labs on your own GPU is what makes it yours — so re-measure everything here and quote your own numbers.

Parallel Programming · Thank you
14