How do you speed up PyTorch training on cloud GPUs?
The PyTorch speed levers in payoff order, from BF16 autocast to CUDA graphs, with sourced speedups, a timing harness and what each is worth in dollars.
The PyTorch speed levers in payoff order, from BF16 autocast to CUDA graphs, with sourced speedups, a timing harness and what each is worth in dollars.
Use FSDP by default. Use DeepSpeed ZeRO-3 when only CPU optimizer offload makes the model fit. Memory math for 8B and 70B, configs and a decision rule.
Make your script save and resume, size the GPU by memory, time a 200-step probe, then launch with a cost cap. A worked $1.67 run, with the code.
Use DDP until params, grads and AdamW state stop fitting on one GPU, about 3.75B params on an 80 GB H100. Then shard with FSDP. The memory math, worked.
Read what the OOM error says, then cut the biggest consumer: activations, optimizer state or fragmentation. An ordered checklist with GB math and code.
Low GPU utilization in PyTorch usually means the GPU is waiting on the CPU. How to measure it, what each symptom means, and what idle time costs.
Use DDP when the model fits on one GPU, FSDP when it doesn't, and launch with torchrun. Code, memory math and a cost check for going multi-node.
Save model, optimizer and step atomically, reload on start, and save again on the reclaim notice. Nodus restores the state on a new machine for you.