Distributed training practice problems

21 problems · 0 solved

Large models do not fit on one GPU, and even when they do, training on one GPU would take too long. Distributed training splits the work across many devices. Data parallelism copies the model and splits the batch, tensor parallelism splits each layer, and pipeline parallelism splits the stack of layers, like an assembly line where each worker handles one station. These problems simulate these schemes with plain arrays so you can see exactly what moves where. You will average gradients across workers, pick gradient accumulation steps for a global batch, simulate ring all-reduce step by step, shard flattened parameters across ranks, estimate per-GPU memory under ZeRO stages, estimate communication for DP, ZeRO and TP, split an MLP with tensor parallelism, compute the pipeline bubble fraction, and generate GPipe and 1F1B schedules. Start with the Easy problems on gradient averaging and accumulation. Then do all-reduce, sharding and ZeRO memory, and finish with tensor parallelism and pipeline schedules. LLM infrastructure roles expect you to reason about memory and communication cost, and these questions come up often in systems interviews.

Easy 7

Medium 7

Hard 7

Related topics

All practice problems