FSDP vs Megatron-LM: which scales LLM training better?
FSDP is simpler and enough while a model fits on one 8-GPU machine. Megatron-LM's tensor and pipeline split wins across machines on slow links.
FSDP is simpler and enough while a model fits on one 8-GPU machine. Megatron-LM's tensor and pipeline split wins across machines on slow links.
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.
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.