FSDP vs DeepSpeed at a glance
Both tools solve the same problem: plain data parallelism copies the whole model, its gradients and its optimizer state onto every GPU, which wastes memory. Sharding splits those copies across GPUs and gathers pieces only when a layer needs them. The table lists what each project states in its own docs, read on 24 November 2026. PyTorch 2.15.0 shipped on 28 October 2026; DeepSpeed v0.20.0 on 12 November 2026.
FSDP now means FSDP2, the fully_shard API. The PyTorch tutorial states that FSDP1 is deprecated, and FSDP2 represents each sharded parameter as a DTensor, which allows per-parameter handling, communication-free sharded state dicts and simpler meta-device initialization.
| Item | PyTorch FSDP2 | DeepSpeed |
|---|---|---|
| Latest release | PyTorch 2.15.0, 28 Oct 2026 | v0.20.0, 12 Nov 2026 |
| Distribution | Part of PyTorch | Separate pip package, Apache-2.0 |
| API | fully_shard(module, mesh, ...) | deepspeed.initialize with a JSON config |
| Launcher | torchrun | deepspeed launcher with hostfile, or no-SSH mode |
| Sharding levels | Full shard; keep params after forward; hybrid via 2D mesh | ZeRO stage 1, 2, 3; ZeRO++ |
| Offload | CPUOffloadPolicy: params, grads and optimizer together | Optimizer and params separately; CPU or NVMe |
| Mixed precision | MixedPrecisionPolicy per module | Set in the DeepSpeed config |
| Checkpoints | Distributed Checkpoint (DCP), sharded | Sharded; zero_to_fp32.py to consolidate |
| Extras | DTensor-based; 2D mesh for hybrid sharding | Ulysses sequence parallel, MoE, 3D parallelism, AutoTP |
| Hardware most tested | Wherever PyTorch distributed runs | NVIDIA Pascal to Hopper, AMD MI100, MI200 |
References: PyTorch: Getting started with Fully Sharded Data Parallel (FSDP2) · PyTorch 2.15 fully_shard API reference · DeepSpeed GitHub repository and releases · DeepSpeed ZeRO tutorial
How the sharding levels map
The ZeRO paper defined three stages, and FSDP settings line up with them. Hugging Face Accelerate’s docs give the mapping: FULL_SHARD maps to ZeRO stage 3, sharding optimizer states, gradients and parameters. SHARD_GRAD_OP maps to stage 2, sharding optimizer states and gradients. NO_SHARD is plain data parallelism. HYBRID_SHARD shards within each node and keeps a full copy per node, which maps to ZeRO++ stage 3.
In FSDP2 these names become arguments. reshard_after_forward=True frees gathered parameters after the forward pass and gathers them again in backward, like stage 3. False keeps them, trading memory for less communication, like stage 2. An integer reshards to a smaller group, a middle ground. A 2D device mesh gives hybrid sharding.
| What is sharded | DeepSpeed | FSDP (Accelerate name) | FSDP2 setting |
|---|---|---|---|
| Nothing | Stage 0 | NO_SHARD | Use DDP instead |
| Optimizer states | Stage 1 | No direct equivalent | No direct equivalent |
| Optimizer states, gradients | Stage 2 | SHARD_GRAD_OP | reshard_after_forward=False |
| Optimizer states, gradients, parameters | Stage 3 | FULL_SHARD | reshard_after_forward=True |
| Stage 3 within node, replicate across nodes | ZeRO++ stage 3 (hpZ) | HYBRID_SHARD | 2D mesh |
References: Hugging Face Accelerate: FSDP guide and ZeRO mapping · PyTorch 2.15 fully_shard API reference · Rajbhandari et al., ZeRO: Memory optimizations toward training trillion parameter models
The memory math behind both
The ZeRO paper gives the figure everyone uses: mixed-precision Adam needs 16 bytes per parameter for model states. That is 2 bytes for 16-bit weights, 2 for 16-bit gradients and 12 for the FP32 weight copy, momentum and variance. Activations, buffers and fragmentation come on top. The paper reports up to 4x, 8x and N-times reductions per GPU for stages 1, 2 and 3, where N is the data-parallel degree.
Here is an illustrative calculation for a 7B-parameter model on 8 GPUs, counting model states only. Without sharding, each GPU holds 112 GB, which does not fit on an 80 GB card. Stage 1 keeps 4 bytes per parameter on every GPU and splits the other 12, so about 38.5 GB. Stage 2 keeps the 2-byte weights and splits 14 bytes, about 26 GB. Stage 3 splits all 16 bytes, 14 GB. Our LLM VRAM budget guide adds activations and context.
One precision difference matters on small GPU counts. Accelerate’s concept guide notes that DeepSpeed creates its flattened parameters and optimizer in FP32 regardless of the loading dtype. FSDP keeps the loading dtype and, without a mixed precision policy, can run the optimizer in BF16, which saves memory but can hurt stability.
| 7B model, 8 GPUs (illustrative) | Bytes per parameter per GPU | Model states per GPU |
|---|---|---|
| No sharding (DDP) | 16 | 112 GB |
| ZeRO-1 | 4 + 12/8 | 38.5 GB |
| ZeRO-2 or SHARD_GRAD_OP | 2 + 14/8 | 26.25 GB |
| ZeRO-3 or FULL_SHARD | 16/8 | 14 GB |
References: Rajbhandari et al., ZeRO: Memory optimizations toward training trillion parameter models · Hugging Face Accelerate: FSDP vs DeepSpeed
Offload: where DeepSpeed goes further
Offload moves state off the GPU to fit bigger models on fewer cards, at the cost of speed. FSDP2’s CPUOffloadPolicy moves parameters, gradients and optimizer states to CPU together, runs the optimizer step on the CPU and pins host memory by default. Accelerate describes FSDP offload as all or nothing.
DeepSpeed splits the choice. ZeRO-Offload moves optimizer and gradient state to CPU memory within stage 2, and ZeRO-Infinity, the stage 3 offload engine, can move the full model state to CPU or NVMe. Its config takes offload_optimizer and offload_param blocks separately. On a rented machine, NVMe offload only helps if the instance has fast local NVMe and enough of it; network storage will be far slower.
References: PyTorch 2.15 fully_shard API reference · Hugging Face Accelerate: FSDP vs DeepSpeed · DeepSpeed ZeRO tutorial
How each behaves on a rented GPU
FSDP2 needs nothing beyond PyTorch. Launch with torchrun --nproc_per_node set to the GPU count, and multi-node runs use torchrun’s rendezvous options. Checkpoints go through Distributed Checkpoint as shards per rank, which writes fast and survives a restart on the same GPU count. Our PyTorch FSDP training guide walks through a full script.
DeepSpeed installs as a pip package and, by default, compiles its C++ and CUDA ops just-in-time on first use, so allow time and keep the CUDA toolkit version consistent with PyTorch. Its launcher reads a hostfile of hosts and GPU slots and expects passwordless SSH between nodes; without SSH, run the launcher on each node with its own node rank, which behaves like torchrun. Stage 3 checkpoints are sharded too, and zero_to_fp32.py consolidates them for export.
For either, interconnect sets the speed of stage 3 and FULL_SHARD, because every layer gathers parameters every step. NVLink inside a node helps; across nodes, fast networking matters. If your model fits with stage 2 or plain DDP, those communicate less. Save checkpoints often on rented capacity, as checkpoint GPU training explains.
References: PyTorch: Getting started with Fully Sharded Data Parallel (FSDP2) · DeepSpeed getting started: launcher and hostfile · Hugging Face Accelerate: FSDP vs DeepSpeed

Published FSDP vs DeepSpeed results
NeuraMesh has not benchmarked these frameworks, and we found no neutral, current head-to-head we could verify. The published results below come from each project’s own authors and measure scaling against their own baselines, not against each other. Real step time depends on model shape, sequence length, batch size, interconnect and settings such as prefetching and activation checkpointing.
| Source and date | Claim as published | Caveat |
|---|---|---|
| PyTorch FSDP paper, Apr 2023 | Comparable performance to DDP, larger models, near-linear TFLOPS scaling | FSDP1-era; authors’ own tests |
| ZeRO paper, Oct 2019 | Up to 4x, 8x and N-times memory reduction per stage | Model states only, not activations |
| DeepSpeed ZeRO tutorial | 1.5B GPT-2 trained with stage 1 on 8 V100s where plain training ran out of memory | Older GPUs; illustrates fit, not speed |
References: Zhao et al., PyTorch FSDP: Experiences on scaling Fully Sharded Data Parallel · Rajbhandari et al., ZeRO: Memory optimizations toward training trillion parameter models · DeepSpeed ZeRO tutorial
When to pick FSDP or DeepSpeed
If you use Hugging Face Accelerate or the Transformers Trainer, you can switch between the two with a config file, so test both. The table is a starting point.
| Your situation | Pick | Reason |
|---|---|---|
| Pure PyTorch code, want fewest dependencies | FSDP2 | Built into PyTorch, torchrun |
| Already using DTensor or PyTorch-native parallel APIs | FSDP2 | Same DTensor building blocks |
| Model only fits with offload on few GPUs | DeepSpeed | Separate optimizer and param offload, NVMe |
| Very long sequences | DeepSpeed | Ulysses sequence parallelism |
| Model fits on each GPU already | Neither | Use DDP; less communication |
| Using Accelerate or Trainer | Test both | Config switch, same script |
References: Hugging Face Accelerate: FSDP vs DeepSpeed · DeepSpeed GitHub repository and releases · PyTorch: Getting started with Fully Sharded Data Parallel (FSDP2)
A test you can run yourself
Rent one node, for example 8 H100s, and run the same training script for 200 steps under each framework at the same global batch size, sequence length and precision. Try FULL_SHARD against ZeRO-3, then SHARD_GRAD_OP against ZeRO-2. Log step time after warm-up, tokens per second, peak memory from torch.cuda.max_memory_allocated and checkpoint save and load time. If your plan is multi-node, repeat on two nodes before you book a long run.
References: PyTorch: Getting started with Fully Sharded Data Parallel (FSDP2) · DeepSpeed ZeRO tutorial
Checklist and next step
Check whether the model fits with DDP first. Estimate model states at 16 bytes per parameter. Choose the lowest sharding level that fits. Turn on offload only when nothing else fits. Match precision settings between frameworks before comparing. Test checkpoint restore on a fresh machine. Compare cost per completed run, not step time alone.
NeuraMesh rents multi-GPU nodes by the hour for training runs like this. Choose GPU, plan, count, hours and region on rent GPUs, and you receive a confirmed quotation, typically within one business day, with nothing charged until you approve. Not sure how many GPUs you need? Ask the compute advisor.
NeuraMesh prices for these GPUs
| GPU | Memory | Data center | Value |
|---|---|---|---|
| RTX 4090 | 24 GB | $0.46 | $0.40 |
| L40S | 48 GB | $1.26 | $0.54 |
| A100 | 80 GB | $1.56 | $0.98 |
| H100 | 80 GB | $2.88 | $2.00 |
Every order is confirmed in a quotation before you pay. See all GPU prices.
Questions readers ask
Is FSDP the same as DeepSpeed ZeRO-3?
They are equivalent in what they shard. FSDP FULL_SHARD and ZeRO stage 3 both split parameters, gradients and optimizer states across GPUs. They differ in API, launcher, offload options, precision handling and checkpoint format.
Which is faster, FSDP vs DeepSpeed?
Neither wins everywhere, and we found no neutral current benchmark to cite. Speed depends on model, sequence length, interconnect and settings. Run the same script under both for a few hundred steps and compare tokens per second and peak memory.
Is FSDP1 deprecated?
Yes. The PyTorch FSDP tutorial states that FSDP1 is deprecated and recommends FSDP2, the fully_shard API, which represents sharded parameters as DTensors. The API reference offers a migration guide for FSDP1 users.
Can FSDP offload to NVMe?
Not natively. FSDP2’s CPUOffloadPolicy moves parameters, gradients and optimizer state to CPU memory together. DeepSpeed ZeRO-Infinity can offload to CPU or NVMe, and can offload optimizer and parameters separately.
How much GPU memory do I need for full fine-tuning?
Model states with mixed-precision Adam take about 16 bytes per parameter before sharding, per the ZeRO paper. Divide by GPU count for ZeRO-3 or FULL_SHARD, then add activations. LoRA cuts this sharply because only small adapters train.
Sources and editorial notes
- PyTorch: Getting started with Fully Sharded Data Parallel (FSDP2)
- PyTorch 2.15 fully_shard API reference
- DeepSpeed GitHub repository and releases
- DeepSpeed ZeRO tutorial
- Hugging Face Accelerate: FSDP guide and ZeRO mapping
- Rajbhandari et al., ZeRO: Memory optimizations toward training trillion parameter models
- Hugging Face Accelerate: FSDP vs DeepSpeed
- DeepSpeed getting started: launcher and hostfile
- Zhao et al., PyTorch FSDP: Experiences on scaling Fully Sharded Data Parallel
Primary documentation reviewed November 24, 2026. Provider descriptions reflect published documentation. Recommendations are our analysis; worked figures are illustrative unless explicitly stated otherwise. No independent provider benchmark or uptime ranking is claimed.
Need this GPU? Rent it from NeuraMesh: choose a GPU and plan, get a confirmed quotation, and pay only when you approve. See pricing.

