Software comparisons

FSDP vs DeepSpeed: sharded training compared

FSDP vs DeepSpeed is mostly a question of stack and offload needs, not raw capability. Both shard parameters, gradients and optimizer states across GPUs; FSDP FULL_SHARD maps to DeepSpeed ZeRO stage 3. Pick PyTorch FSDP2 for native PyTorch, torchrun and simpler debugging. Pick DeepSpeed when you need fine-grained CPU offload, NVMe offload, or its extra parallelism features. Measure step time and peak memory on your own model.

A large model block split into slices spread across a row of eight GPU cards
Both FSDP and DeepSpeed ZeRO split model state across GPUs so each card holds only a slice. AI-generated illustration.

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.

FSDP vs DeepSpeed at a glance
ItemPyTorch FSDP2DeepSpeed
Latest releasePyTorch 2.15.0, 28 Oct 2026v0.20.0, 12 Nov 2026
DistributionPart of PyTorchSeparate pip package, Apache-2.0
APIfully_shard(module, mesh, ...)deepspeed.initialize with a JSON config
Launchertorchrundeepspeed launcher with hostfile, or no-SSH mode
Sharding levelsFull shard; keep params after forward; hybrid via 2D meshZeRO stage 1, 2, 3; ZeRO++
OffloadCPUOffloadPolicy: params, grads and optimizer togetherOptimizer and params separately; CPU or NVMe
Mixed precisionMixedPrecisionPolicy per moduleSet in the DeepSpeed config
CheckpointsDistributed Checkpoint (DCP), shardedSharded; zero_to_fp32.py to consolidate
ExtrasDTensor-based; 2D mesh for hybrid shardingUlysses sequence parallel, MoE, 3D parallelism, AutoTP
Hardware most testedWherever PyTorch distributed runsNVIDIA 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.

How the sharding levels map
What is shardedDeepSpeedFSDP (Accelerate name)FSDP2 setting
NothingStage 0NO_SHARDUse DDP instead
Optimizer statesStage 1No direct equivalentNo direct equivalent
Optimizer states, gradientsStage 2SHARD_GRAD_OPreshard_after_forward=False
Optimizer states, gradients, parametersStage 3FULL_SHARDreshard_after_forward=True
Stage 3 within node, replicate across nodesZeRO++ stage 3 (hpZ)HYBRID_SHARD2D 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.

The memory math behind both
7B model, 8 GPUs (illustrative)Bytes per parameter per GPUModel states per GPU
No sharding (DDP)16112 GB
ZeRO-14 + 12/838.5 GB
ZeRO-2 or SHARD_GRAD_OP2 + 14/826.25 GB
ZeRO-3 or FULL_SHARD16/814 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

Three storage tiers of GPU, CPU memory and NVMe drives with blocks moving between them
Offload trades speed for capacity: GPU memory is fastest, CPU memory slower, NVMe slower still. AI-generated illustration.

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.

Published FSDP vs DeepSpeed results
Source and dateClaim as publishedCaveat
PyTorch FSDP paper, Apr 2023Comparable performance to DDP, larger models, near-linear TFLOPS scalingFSDP1-era; authors’ own tests
ZeRO paper, Oct 2019Up to 4x, 8x and N-times memory reduction per stageModel states only, not activations
DeepSpeed ZeRO tutorial1.5B GPT-2 trained with stage 1 on 8 V100s where plain training ran out of memoryOlder 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.

When to pick FSDP or DeepSpeed
Your situationPickReason
Pure PyTorch code, want fewest dependenciesFSDP2Built into PyTorch, torchrun
Already using DTensor or PyTorch-native parallel APIsFSDP2Same DTensor building blocks
Model only fits with offload on few GPUsDeepSpeedSeparate optimizer and param offload, NVMe
Very long sequencesDeepSpeedUlysses sequence parallelism
Model fits on each GPU alreadyNeitherUse DDP; less communication
Using Accelerate or TrainerTest bothConfig 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

NeuraMesh prices per GPU-hour in USD, excluding taxes, as of 2026-11-27. Live prices are on the rental pages.
GPUMemoryData centerValue
RTX 409024 GB$0.46$0.40
L40S48 GB$1.26$0.54
A10080 GB$1.56$0.98
H10080 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

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.

Read the editorial policy.

Need this GPU? Rent it from NeuraMesh: choose a GPU and plan, get a confirmed quotation, and pay only when you approve. See pricing.