Model Online / On-Site
Duration
Modules 5 modules

Course Objective & Scope

When model parameters, context lengths or dataset volumes outgrow a single GPU, training must shard model states (weights, gradients, optimizer states) and computation across multi-GPU and multi-node clusters. Configured poorly, distributed runs spend most of their time stalled on NCCL collective communications rather than matrix multiplication.

This advanced course covers GPU memory accounting, DeepSpeed ZeRO (Stages 1, 2, 3 and CPU/NVMe Offload), PyTorch FSDP / FSDP2, Context/Sequence Parallelism (Ulysses and Ring Attention), Hugging Face Accelerate orchestration and profiling Model FLOPs Utilization (MFU). Participants configure, profile and tune a multi-GPU LLM training pipeline.

Who Should Attend?

  • Machine learning and AI engineers training LLMs across multi-GPU or multi-node clusters
  • ML platform and infrastructure engineers managing GPU clusters on Kubernetes or Slurm
  • Researchers optimising throughput and memory for large-scale SFT, continual pre-training or RL runs
  • Prerequisite: solid PyTorch proficiency, Linux skills and single-GPU training experience

Key Takeaways

  • Calculate exact per-GPU memory budgets for any model size, batch size and sequence length
  • Configure DeepSpeed ZeRO Stages 1/2/3 and PyTorch FSDP2 sharding strategies for optimal throughput
  • Overlap backward-pass computation with NCCL all-gather and reduce-scatter collectives
  • Combine Data, Tensor, Pipeline and Context Parallelism across intra-node (NVLink) and inter-node networks
  • Diagnose communication bottlenecks, NCCL hangs and stragglers using PyTorch Profiler and distributed checkpointing

Curriculum

Distributed Training Mathematics and NCCL Collectives
  • The $16\Psi$ mixed-precision AdamW memory formula and activation memory scaling
  • NCCL collectives (all-reduce, all-gather, reduce-scatter) across NVLink and InfiniBand/RoCE
DeepSpeed ZeRO (Stages 1, 2, 3) and ZeRO-Offload
  • Throughput-versus-memory trade-offs across ZeRO-1 (optimizer), ZeRO-2 (+ gradients) and ZeRO-3 (+ weights)
  • When and how to use ZeRO-Offload to CPU RAM without starving GPU compute
  • Tuning communication bucket sizes and prefetching in DeepSpeed and Accelerate
PyTorch FSDP and FSDP2 (DTensor)
  • Transformer layer wrapping policies, FULL_SHARD, SHARD_GRAD_OP and node-aware HYBRID_SHARD
  • Per-parameter DTensor sharding in FSDP2, torch.compile integration and QLoRA + FSDP
  • Fast asynchronous checkpointing with torch.distributed.checkpoint (DCP)
3D Parallelism and Context Parallelism for Long Sequences
  • Combining intra-node Tensor Parallelism with inter-node Pipeline and Data Parallelism
  • Sharding long-sequence activations with DeepSpeed Ulysses and Ring Attention
Profiling, MFU Optimisation and Debugging
  • Inspecting compute-communication overlap in PyTorch Profiler and Perfetto traces
  • Maximising Model FLOPs Utilization (MFU), debugging NCCL hangs and elastic fault recovery

Other Courses in This Category

Get in touch