From chips and CUDA to parallel training, training frameworks and the runtime of RL systems.
12 core notes, about 2.5 h. 12 deep dives fold under the notes they extend.
The whole system2
Two maps: the hardware stack from wafer to product, and ML systems from data to serving
Hardware: chips, GPUs and CUDA4 core · 4 deep
How chips are made, how GPUs organize compute and memory, kernels, and finding the bottleneck
- GPU architecture: SMs, warps, the memory hierarchy, and Tensor CoresDeriving H100's 989.4 TFLOPS, and why it takes many warps to hide memory waits17 min
- How chips are made: wafers, process nodes, packaging, and HBM8× the die area, 20× fewer good dies; with chiplets, packaging and HBM cap supply12 min
- CPU architecture: pipelines, caches, SIMD, and NUMARow order misses 256 times, column order all 4,096; cores needed to feed eight GPUs12 min
- NVIDIA GPU generations: what each one changed, and whyBandwidth lags compute: ridge point about 140 on V100, 1,900 on GB300; GPUs for 70B21 min
- CUDA: threads, memory, and kernelsUnused warp bytes and repeated reads: tiling cuts a 4×4 matmul from 128 reads to 6418 min
- The framework layer: from one line of PyTorch to kernels on the GPUrelu(x @ w + b): three ops, two needless memory trips; what torch.compile removes18 min
- Performance: the roofline, arithmetic intensity, and MFU100% utilization only means a kernel is running; 7B decode does about 1 FLOP per byte17 min
- AI infrastructure: review questionsReview: node names aren't sizes, why batch-1 decode is memory-bound, what MFU counts12 min
Training on many GPUs3 core · 1 deep
When one GPU is too small or slow: DDP, FSDP, TP, PP, Megatron's groups, picking a framework
- Distributed training: how are data, state, and computation divided?Replicas on different data, or one model split up: what DDP, FSDP, TP and PP divide13 min
- Tensor parallelism: two GPUs, one layerPartial sums [1, 2] + [8, 4] give [9, 6]: where TP must communicate, and how often8 min
- From one update to Megatron: distributed training basicsOne update by hand, w from 2 to 3.2, then eight ranks grouped as TP=2, PP=2, DP=211 min
- Choosing a training stack: DDP, FSDP2, and the surrounding toolsToo slow or won't fit? 4 GB of sharded state per GPU, yet backward reaches 7.9 GB8 min
Runtimes of training and RL systems2 core · 4 deep
One RL update through the code: who runs what, how stale async data gets, why it destabilizes
- One RL update: what NeMo RL, verl and AReaL connectRewards [1,0,1,0] for four answers become a training signal; when new weights go live12 min
- From workers to GPUs: execution and schedulingAn idle GPU, a waiting job: no device, no data, no KV-cache space, or peers not ready10 min
- Async RL and AReaL: less waiting, older dataStarted on v10, delivered at v12: version age, complete groups and partial rollouts15 min
- From algorithms to source: generation, training, and stabilityFour tokens in, three out; answers updating a model; code that runs but learns wrong7 min
- Follow a training run through NeMo RLTwo questions, four answers each: scoring, masks, loss, weights back to generation9 min
- Why training becomes unstable: from samples to an updatePer-batch means of 100 and 10 tokens give 2, not 1.182; then NaNs and stale rollouts9 min
Serving, queues and failures1 core · 3 deep
Serving all day: the stack, queues and scaling, timeouts and retries, sharing GPUs in a cluster
- From request to GPU: taking a model service apartQueueing is 80 of 156 ms to first token; at 32 requests, 8K prompts add 24 GiB of KV9 min
- Queues, capacity, and failures: when requests pile upA 10 s burst leaves 200 queued, 10 s more to drain; three retry layers mean 27 tries7 min
- Failure and recovery: did the action happen before the timeout?A timed-out refund may have gone through: record the unknown, then bound every retry7 min
- Kubernetes and GPU clusters: handing GPUs to jobsOnly 8 of 24 GPUs working: why a 16-GPU job stalls, and what gang scheduling changes18 min
No notes match.