12. Distributed Training: Parallel Engineering for LLMs
Chapter focus: This chapter teaches distributed training through minimal reproducible experiments: first understand NCCL communication and autograd with hand-written code, then progressively enter tensor parallelism, Flash Attention, mixed precision and checkpoints, ending with loss debugging and network tuning in real training.
🧭 Reading Map
- Prerequisites: 11. Pre-trained Models + 03. Network — parallelism is bounded by both model structure and network ceiling
- Role: core chapter of Part 4, L4 — 3D parallelism, hands-on LLM Lab, mixed precision/NCCL tuning and debugging
- Order: parallelism principles → LLM Lab 01→07 hands-on (DDP→TP→Megatron→FlashAttention) → tuning & debugging
- Next: 13. Inference Engines — how to serve the trained model efficiently
Articles
Run LLM Lab 01-03 first to build communication intuition, then tensor parallelism (04-06) and Flash Attention (07) as needed; production training starts with mixed precision/checkpoints, loss debugging, and nccl tuning.
Key Takeaways
The "minimal unit" of distributed training is NCCL collectives plus autograd; parallel-strategy selection is driven by three questions: does it fit in memory, what is the communication share, and is the load balanced?