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. For FSDP against plain data parallel see our FSDP vs DDP guide, and for CPU offload see FSDP vs DeepSpeed.
What does each one actually split?
FSDP splits the training state; Megatron-LM splits the math. PyTorch FSDP shards every weight, gradient and optimizer value across the data-parallel GPUs. Before each layer runs, it all-gathers that layer's full weights, then frees them, and after the backward pass it reduce-scatters the gradients. Every GPU still runs the whole model on its own slice of the batch.
Megatron-LM does three different splits at once, often called 3D parallelism. Tensor parallelism cuts each matrix multiply across GPUs, from Shoeybi et al. 2019. Pipeline parallelism gives each group of GPUs a block of consecutive layers. Data parallelism then copies that whole arrangement, which Narayanan et al. 2021 combined and scaled to 3,072 GPUs.
| PyTorch FSDP (FSDP2) | Megatron-LM / Megatron Core | |
|---|---|---|
| What is split | Weights, gradients and optimizer state across data-parallel GPUs | Each layer's matrices (TP), the layer stack (PP), the batch (DP), plus long sequences (CP) |
| Main traffic | All-gather and reduce-scatter of the full model, every microbatch | TP all-reduces inside a machine; small activations between pipeline stages |
| Model code | Any PyTorch module, wrapped layer by layer | Megatron Core model definitions; Hugging Face checkpoints converted with Megatron Bridge |
| Checkpoints | PyTorch Distributed Checkpoint | torch_dist, built on PyTorch's checkpointing, loadable under a different TP/PP/DP |
| Ships with | PyTorch | Separate NVIDIA library |
Sources: FSDP2 docs, Megatron parallelism guide, Megatron distributed checkpointing, Megatron-LM README. Checked November 27, 2026.
The line between them is blurring. PyTorch's own tensor parallel tutorial applies tensor parallelism inside each machine and FSDP across machines, and Megatron Core ships its own Megatron-FSDP. So the real question is which split runs over which wire.
How much memory does each need per GPU for 8B and 70B?
Both fit a 70B model on 80 GB H100s once there are 32 GPUs; neither fits it on one 8-GPU machine. We wrote a short standard-library Python script for this post using the Llama 3.1 8B and 70B shapes from their Hugging Face config files: 8.03B and 70.55B parameters, 4,096-token sequences and a global batch of 256 sequences.
The script uses published cost models, not measurements. FSDP state is 16 bytes per parameter, the ZeRO paper count for bf16 with Adam, with full activation checkpointing. Megatron state uses the distributed optimizer table: 18 bytes per parameter, or 6 + 12/d with d data-parallel copies. Megatron activations follow Korthikanti et al. 2022, with sequence parallelism and selective recompute.
| 70B layout | Machines x GPUs | State per GPU | Total per GPU | Fits 80 GB? |
|---|---|---|---|---|
| FSDP full shard | 1 x 8 | 141.1 GB | 151.0 GB | No |
| FSDP hybrid shard (shard inside a machine) | 4 x 8 | 141.1 GB | 151.0 GB | No |
| FSDP full shard, 1 sequence per GPU | 4 x 8 | 35.3 GB | 45.2 GB | Yes |
| FSDP full shard, 4 sequences per GPU | 4 x 8 | 35.3 GB | 64.7 GB | Yes |
| Megatron TP=8, PP=4, DP=1 | 4 x 8 | 39.7 GB | 51.1 GB | Yes |
| Megatron TP=8, PP=2, DP=2 | 4 x 8 | 52.9 GB | 64.3 GB | Yes |
Re-check two rows: 70.55B x 16 bytes / 32 = 35.3 GB, and 70.55B x 18 bytes / 32 = 39.7 GB. The totals add activations and temporary buffers.
The 8B model is easy for both. FSDP full shard holds it at 18.6 GB per GPU on one machine, so there is nothing for tensor or pipeline parallelism to fix. NVIDIA's own parallelism guide lists Llama 3 8B on 8 GPUs at TP=1 and PP=1.
How much traffic crosses between machines each step?
This is where they part. With FSDP full shard on 32 GPUs, every microbatch all-gathers the weights twice and reduce-scatters the gradients once. That is 3 x 2 bytes x 70.55B x 31/32, or 410 GB sent per GPU per microbatch, over rings that span all four machines.
Megatron keeps its heavy traffic inside the machine. Narayanan et al. put tensor parallelism at 8bsh(t-1)/t values per layer per microbatch, which our script turns into 2,405 GB per GPU per step on the 900 GB/s NVLink that NVIDIA lists for the H100 SXM. Only the pipeline hand-offs cross machines: one activation of b x s x h values forward and one gradient back.
| 70B on 4 x 8 H100 | Cross-machine traffic per GPU per step |
|---|---|
| FSDP, 1 sequence per GPU (8 microbatches) | 3,280.7 GB |
| FSDP, 4 sequences per GPU (2 microbatches) | 820.2 GB |
| Megatron TP=8, PP=2, DP=2 | 15.4 GB |
| Megatron TP=8, PP=4, DP=1 | 4.3 GB |

Megatron moves about 190 times less data between machines than FSDP's best layout here.
The pipeline does cost something else: idle time. Narayanan et al. give the bubble as (p-1)/m, the pipeline depth minus one over the microbatch count. At PP=4 with 256 microbatches that is 3/256, or 1.2% of the step.
How fast does the network need to be for FSDP?
Fast enough to finish a microbatch's traffic while the GPU computes it, and the size of the model cancels out. The traffic is 6P bytes per microbatch, and with activation checkpointing the compute is 8P FLOPs per token. So each GPU needs about 0.75 x its achieved FLOP/s divided by the tokens per microbatch, in bytes per second.
For an H100 SXM, NVIDIA lists 1,979 bf16 teraFLOPS with sparsity, so about 990 dense. At an assumed 40% utilization, about 396 TFLOP/s, the bandwidth each GPU needs is:
| Tokens per GPU per microbatch | Network per GPU to hide FSDP traffic |
|---|---|
| 4,096 (1 sequence) | 579.8 Gb/s |
| 8,192 (2 sequences) | 289.9 Gb/s |
| 16,384 (4 sequences) | 144.9 Gb/s |
| 32,768 (8 sequences) | 72.5 Gb/s |
Re-check the first row: 0.75 x 395.8 TFLOP/s / 4,096 tokens = 72.5 GB/s, which is 579.8 Gb/s. The 40% is an assumption for the example, not a measurement.

Doubling the tokens each GPU processes per microbatch halves the network FSDP needs.
Inside one machine this is never the limit, since NVLink is far faster than any of these rows. Across machines it often is. The FSDP paper shows FSDP can scale: 173 to 186 TFLOPS per A100 on a 175B model from 128 to 512 GPUs. Those runs used a 2 Tb/s RoCE network, and the paper notes that communication starts to outweigh compute on large clusters.
What does the choice cost on Nodus?
On a network that keeps up, the gap is about a third; on a slow one, it is several times. Take 1B training tokens of the 70B model on 4 machines of 8 H100s. At $2.60/hr per GPU that is $83.20/hr for the gang. Prices checked November 27, 2026.
| Layout | Hours | GPU-hours | Cost at $2.60/GPU-hr |
|---|---|---|---|
| Megatron TP=8, PP=4 | 9.4 | 301 | $782.60 |
| FSDP, 4 sequences per GPU, network keeps up | 12.4 | 396 | $1,029.60 |
| FSDP, 1 sequence per GPU, 400 Gb/s per GPU | 17.4 | 556 | $1,445.60 |
| FSDP, 1 sequence per GPU, 100 Gb/s per GPU | 69.5 | 2,225 | $5,785.00 |
All rows assume the same 396 TFLOP/s per GPU and perfect overlap of traffic and compute, so treat them as best cases. The Megatron row also assumes its in-machine tensor traffic is hidden. Re-check the last row: 410 GB per microbatch at 12.5 GB/s is 32.8 s, against 5.8 s of compute, over 7,629 microbatches.

A slow network multiplies FSDP's bill; Megatron's layout barely notices it.
Most of the first gap is not the network. FSDP here recomputes every activation to fit, which is 8 FLOPs per parameter per token instead of Megatron's 6 with selective recompute. Selective activation checkpointing in FSDP narrows that, so measure before you rewrite a model for Megatron.
When is Megatron's 3D parallelism worth it?
When the model no longer fits on one machine and the network cannot keep up. Our decision rule, from the math above:
- If the model's state at 16 bytes per parameter, divided by 8, fits in one GPU with room for activations, use FSDP. Add machines with hybrid shard, which only sends a gradient shard between machines (3.0 GB per GPU per step for 8B on 4 machines).
- If it needs more than one machine to fit, check the network per GPU against the bandwidth table. If you can feed enough tokens per microbatch to stay under it, FSDP full shard still works.
- If you cannot, or your links are slow, use tensor parallelism inside each machine and pipeline parallelism across them. That is Narayanan et al.'s first takeaway: tensor parallel up to the GPUs in one server, then pipeline across servers.
- Past a few hundred GPUs, use both. PyTorch's tensor parallel tutorial says FSDP collectives become "dominated by ring latency" beyond 128 to 256 GPUs.
For reference, NVIDIA's guide suggests TP=4, PP=4, CP=2 for Llama 3 70B on 64 GPUs, and TP=8, PP=8 for Llama 3.1 405B on 1,024.
Where is Megatron-LM the better choice?
Megatron wins on large pretraining runs. Its kernels and schedules are built for NVIDIA GPUs, and its published results are strong: 52% of peak per A100 on a 1T model in Narayanan et al., and 54.2% model FLOPs utilization on a 530B model in Korthikanti et al. It also covers expert parallelism for mixture-of-experts models and context parallelism for long sequences out of the box.
It is also the safer pick when machines are connected by ordinary Ethernet instead of a fast fabric. Its cross-machine traffic stayed under 16 GB per GPU per step in every 70B layout we modeled.
Where is FSDP the better choice?
FSDP wins for fine-tuning and anything up to the size of one machine. It wraps any PyTorch model, including Hugging Face ones, without converting weights into Megatron Core's format. It ships with PyTorch, and FSDP2's per-parameter sharding makes checkpoints with PyTorch Distributed Checkpoint simple.
That checkpoint format matters on Nodus. The Nodus checkpoint guide says a stateful multi-node Job requires recovery.checkpoint.format: Dcp, with every rank saving through nodus.checkpoint.dcp. FSDP2's state dicts map onto that directly. Megatron's torch_dist format is built on the same PyTorch machinery, but we have not tested it with Nodus gang recovery.
How do you run FSDP or Megatron-LM on Nodus?
Both start with torchrun, so the Nodus command is the same and your own launch line goes after --. The multi-node guide gives this two-machine example:
nodus run --name torchrun-2-node --gpu H100 --nodes 2 --launcher torchrun --max-cost 2.00 -- torchrun train.py Nodus sets the PET_* variables on every rank, so torchrun finds its peers with no flags. For Megatron, replace torchrun train.py with the torchrun ... pretrain_gpt.py line and parallel sizes from its parallelism guide. Before a long run, preview the shape and holds:
$ nodus run --dry-run --gpu H100 --total-gpus 16 --launcher torchrun -- torchrun train.py Multi-node is in Beta, with gangs of 2 to 8 machines within each qualified provider pair's member cap. A Global network shows a WANBound condition because distant machines are network-limited, which is exactly where pipeline parallelism across machines beats FSDP. The guide also says a two-host DDP result does not qualify cross-host FSDP, so check the exercised combinations for your release.
Our multi-node training guide covers the setup and debugging in detail, and our multi-GPU training guide starts with one machine.
FAQ
Can I combine FSDP with tensor parallelism instead of switching to Megatron?
Yes. PyTorch's tensor parallel tutorial builds a 2D device mesh, applies tensor parallelism inside each machine and FSDP across machines, with no changes to the Llama model code. It is the middle path if you want Megatron's network profile without leaving plain PyTorch.
Does pipeline parallelism change my results?
Not the math, if microbatches sum to the same global batch. The cost is the idle bubble, (p-1)/m, which shrinks as you add microbatches; the interleaved schedule in Narayanan et al. improved throughput by more than 10% at similar memory.
Can I change TP or PP sizes after a Megatron checkpoint is saved?
Yes, with care. Megatron's distributed checkpointing docs say the default optimizer format cannot change model parallelism, so resume once with --dist-ckpt-optim-fully-reshardable, save, then switch back.
Which is better for fine-tuning a 70B model with LoRA?
Neither needs 3D parallelism. LoRA trains a small set of adapter weights, so the frozen model mostly needs to be sharded or quantized to fit, as our 70B VRAM guide shows. On Nodus, the managed sft runtime runs full, LoRA and QLoRA fine-tuning as a TrainingJob.
Originally published on the Nodus blog.
