deepspeed

Configure distributed training with DeepSpeed ZeRO stages, pipeline parallelism, and mixed precision.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Clay-HHK/claude-skills --skill deepspeed-clay-hhk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: deepspeed
Source: https://github.com/Clay-HHK/claude-skills/tree/main/deepspeed
Command: npx skills add https://github.com/Clay-HHK/claude-skills --skill deepspeed-clay-hhk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires deepspeed, torch, transformers, accelerate, and includes references (resource) components.

What problem does it solve? Training large language models exceeds single-GPU memory and compute limits, requiring complex distributed training configurations that are difficult to set up and tune correctly. ## Core Features & Use Cases - ZeRO Optimization: Configure ZeRO stages 1-3, ZeRO-Offload, and ZeRO-Infinity to partition optimizer states, gradients, and parameters across GPUs, CPU, and NVMe. - Parallelism Strategies: Implement pipeline parallelism, tensor parallelism, and Mixture of Experts (MoE) training including PR-MoE and Mixture-of-Students compression. - Communication & Memory Efficiency: Apply 1-bit Adam, sparse attention, FP16/BF16/FP8 mixed precision, and DeepNVMe high-performance I/O for checkpointing. - Use Case: When pre-training a multi-billion parameter model on a GPU cluster, use this Skill to generate a DeepSpeed config JSON with ZeRO stage 3, CPU offloading, and activation checkpointing to fit the model in memory. ## Quick Start Ask the assistant to generate a DeepSpeed configuration for training a 7B parameter model with ZeRO stage 2 and BF16 mixed precision across 8 GPUs.

Frequently Asked Questions about deepspeed

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure DeepSpeed ZeRO stage 3 for multi-GPU training?▼

Create a ds_config JSON with zero_optimization stage set to 3, optionally adding offload_param and offload_optimizer entries targeting cpu or nvme devices. Launch training with the deepspeed CLI command specifying your config file and number of GPUs.

What is the difference between ZeRO stage 1, 2, and 3?▼

ZeRO stage 1 partitions optimizer states, stage 2 additionally partitions gradients, and stage 3 also partitions model parameters across GPUs. Higher stages save more memory but increase communication overhead between devices.

Does DeepSpeed support training models larger than GPU memory?▼

Yes, ZeRO-Offload moves optimizer states and gradients to CPU memory, while ZeRO-Infinity extends offloading to NVMe storage. This enables training models with trillions of parameters on limited GPU hardware.

How do I enable mixed precision training with DeepSpeed?▼

Add an fp16 or bf16 block with enabled set to true in the DeepSpeed config JSON. DeepSpeed handles automatic loss scaling for FP16 and supports FP8 on compatible hardware.

Why does my DeepSpeed training run out of memory?▼

Out-of-memory errors typically occur when the ZeRO stage is too low for the model size or activation checkpointing is disabled. Increase the ZeRO stage, enable gradient checkpointing, or offload parameters to CPU or NVMe.

Can DeepSpeed train Mixture of Experts models?▼

Yes, DeepSpeed supports MoE training with expert parallelism via num-experts and moe-expert-parallel-size parameters. It also supports PR-MoE and Mixture-of-Students distillation to reduce model size by up to 3.7x.