Menu

1 / 3

FSDP vs Megatron-LM: which scales LLM training better?

DEV Community: pytorch·Viswaretas Kotra·8 days ago
#vUljqdQ2
#devtopytorch#devto#dev#fsdp#megatron
Long article (2238 words) — no AI summary yet.
Reading 0:00
15s threshold

PyTorch FSDP scales well until a model's training state outgrows one 8-GPU machine; past that, Megatron-LM scales better unless every GPU has a fast network, because its tensor and pipeline split sends a small fraction of FSDP's traffic between machines. Nodus launches either one with the same torchrun command on one machine or across a multi-node Beta gang, which has an API ceiling of 8 machines, with the H100 SXM listed at $2.60/hr on the Nodus pricing page . In our worked math for a 70B model on 32 H100s, FSDP has to push about 820 GB per GPU across machines every step, while a Megatron TP=8, PP=4 layout pushes 4.3 GB.

That gap is the whole story. Both tools fit a 70B model on 80 GB GPUs once you use four machines. They differ in what has to travel between the machines, and that decides whether you pay for GPUs that compute or GPUs that wait.

This post compares the two at scale.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.