Graph
ZeRO

đź§ ZeRO

NEW

Also known as: Zero Redundancy Optimizer

A distributed training memory optimization that shards optimizer states, gradients, and parameters across data-parallel workers to enable training very large models.

DESCRIPTION

ZeRO is a DeepSpeed technology that reduces memory redundancy in data-parallel training by partitioning model states—optimizer states, gradients, and parameters—across processes. It is implemented in stages (ZeRO-1, ZeRO-2, ZeRO-3) that progressively shard more states to increase scalability. ZeRO enables training models with billions to trillions of parameters on commodity GPU clusters while maintaining high throughput. It complements techniques like gradient checkpointing, CPU/NVMe offloading, and pipeline/model/tensor parallelism. ZeRO is widely adopted across PyTorch ecosystems and inspired the PyTorch Fully Sharded Data Parallel approach. It helps teams scale training while controlling memory footprint and communication overhead.

ALTERNATIVE DEFINITIONS

arXiv

We present ZeRO, a novel optimizer that significantly reduces memory redundancy in data-parallel training of deep neural networks. ZeRO partitions optimizer states, gradients, and parameters across processes to enable training of extremely large models.

Highlights the novelty of the optimizer and the partitioning of all model states to reduce redundancy.

Source

DeepSpeed

ZeRO is a parallelized optimizer that reduces memory redundancy in data-parallel training by partitioning model states (optimizer states, gradients, and parameters) across data-parallel processes.

Concise focus on memory reduction by partitioning the three core model state types across workers.

Source

Microsoft DeepSpeed

ZeRO (Zero Redundancy Optimizer) enables training models with billions of parameters by eliminating memory redundancies and retaining training throughput.

Emphasizes practical impact—training extremely large models while sustaining performance.

Source

DeepSpeed Distributed Training Data Parallelism Pipeline Parallelism Tensor Parallelism Gradient Checkpointing Offloading Megatron-LM

COMPETING TERMS

Fully Sharded Data Parallel Model Parallelism

KNOWLEDGE AREAS

AI MLOps Infrastructure Data Engineering

TARGET AUDIENCE

AI Engineer MLOps Engineer Data Scientist Data Engineer Cloud Architect Hardware Engineer

EXTERNAL SOURCES

TOP QUESTIONS

Why is ZeRO important for training large AI models?

ZeRO enables training models that exceed single-GPU memory by sharding model states across data-parallel workers. This dramatically expands feasible model sizes without prohibitive hardware costs.

Category: Relevancy

What are the main stages of ZeRO in DeepSpeed?

ZeRO-1 shards optimizer states, ZeRO-2 additionally shards gradients, and ZeRO-3 shards parameters as well. Each stage further reduces memory redundancy and increases scalability.

Category: Overview

How does ZeRO differ from traditional data parallelism?

Traditional data parallelism replicates model states on each worker, while ZeRO partitions them. ZeRO lowers memory overhead and communication demands for large-scale training.

Category: Comparison

What are common mistakes when configuring ZeRO?

Misaligned batch sizes, insufficient communication bandwidth, or incompatible optimizer settings can hurt performance. Skipping checkpointing and offloading configuration can cause memory pressure and instability.

Category: Mistakes

Is ZeRO compatible with gradient checkpointing and offloading?

Yes. ZeRO is often combined with gradient checkpointing and CPU/NVMe offloading to further reduce memory use while preserving throughput on commodity GPU clusters.

Category: Integration

What risks come with adopting ZeRO for production training?

Complex configuration and sensitivity to cluster topology can cause performance regressions. Monitoring communication overhead and stability is crucial for reliable runs.

Category: Risks

What is a competing approach to ZeRO?

PyTorch Fully Sharded Data Parallel is a key competitor that also shards model states to scale training. Model parallelism and pipeline parallelism are alternative strategies.

Category: Alternatives

How do I know if my model needs ZeRO?

If model states exceed available GPU memory or replicas cause severe redundancy, ZeRO helps. Evaluate memory footprint, target model size, and desired throughput.

Category: Requirements

Does ZeRO improve training speed or only memory use?

Primarily memory savings, but it can retain or improve throughput by reducing memory bottlenecks. Overall speed depends on communication, batch sizes, and cluster bandwidth.

Category: Understanding

Where should I start learning ZeRO?

Begin with the DeepSpeed ZeRO tutorial and the arXiv paper. Then test small experiments, incrementally tuning stages and offloading options.

Category: Learning