MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed

github.com/deepspeedai/DeepSpeed

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.20.0 ↗ · + Follow · compare 7 versions
17,024 symbols 71,936 edges 1,378 files ⚖ custom 3,280 documented · 19% ● updated todayv0.20.0 · 2026-11-12★ 43,3521,226 open issues

Browse by type

⨍ Functions 14,579◇ Types & classes 2,353↳ Endpoints 92
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

License Apache 2.0 PyPI version Downloads Build OpenSSF Best Practices Twitter Japanese Twitter Chinese Zhihu Slack

English · 简体中文

开发者交流会 (Office Hours)

DeepSpeed 于每月最后一个星期二美东时间 12:00(北京时间次日凌晨 00:00 / 01:00)定期举行线上 Office Hours,共同讨论开发规划、新特性与技术设计等。该会议对所有人公开,欢迎任何人加入并交流提问。 会议基于 Zoom 进行,可通过此处链接直接参会。

最新动态

查看更多历史动态


极致速度与超大规模深度学习训练

DeepSpeed 成功支撑了全球众多极具影响力的大规模语言模型训练,例如 MT-530B 以及 BLOOM。DeepSpeed 汇聚了一系列前沿的系统级创新,使超大规模深度学习训练变得既可行又极其高效,大幅提升了开发易用性,并在模型可扩展性维度彻底重新定义了深度学习的训练边界。这些突破性技术包括 ZeRO、ZeRO-Infinity、3D 并行(3D-Parallelism)、Ulysses 序列并行、DeepSpeed-MoE 等。


DeepSpeed 生态应用

DeepSpeed 是微软 AI at Scale 核心战略的重要支柱,旨在规模化赋能下一代人工智能前沿能力,更多背景可查阅此处详情。

DeepSpeed 已被广泛应用于训练各类超大规模模型,以下为部分知名代表案例(若您希望在此列出您的模型,欢迎提交 PR):

DeepSpeed 已无缝集成至众多主流开源深度学习框架与生态:

文档指引
在 Transformers 中使用 DeepSpeed
在 Accelerate 中使用 DeepSpeed
在 Lightning 中使用 DeepSpeed
在 MosaicML 中使用 DeepSpeed
在 Determined 中使用 DeepSpeed
在 MMEngine 中使用 DeepSpeed

构建流水线状态

平台 / 运行环境 持续集成状态
NVIDIA nv-pre-compile-ops modal-torch-latest
AMD amd-mi200
CPU torch-latest-cpu
Intel Gaudi hpu-gaudi2
Intel XPU xpu-max1100
生态集成 aws-accelerate
其他检查 Formatting pages-build-deployment Documentation Statuspython
华为昇腾 NPU Huawei Ascend NPU

安装指南

通过 pip 安装是快速上手 DeepSpeed 最便捷的方式,这将安装 DeepSpeed 的最新稳定发布版(且无需强制绑定特定的 PyTorch 或 CUDA 版本)。DeepSpeed 包含多个我们通常称为“算子 (Ops)”的 C++/CUDA 原生扩展。默认情况下,所有这些扩展/算子都会通过依赖 ninja 的 PyTorch JIT C++ 扩展加载器在运行时按需即时(JIT)编译并动态链接。

环境要求

  • 在安装 DeepSpeed 之前必须预先安装 PyTorch。
  • 为获得完整的特性支持,建议使用 PyTorch >= 2.0 版本,最佳实践为使用最新的 PyTorch 稳定发布版。
  • 需具备用于编译 C++/CUDA/HIP 扩展的 CUDA 或 ROCm 编译器,例如 nvcc 或 hipcc。
  • 我们日常重点开发与测试的 GPU 架构如下。若您的 GPU 未列在其中并不意味着无法运行,而是指 DeepSpeed 在以下硬件平台上经过了最充分的测试验证:
  • NVIDIA:Pascal、Volta、Ampere 以及 Hopper 架构
  • AMD:MI100 与 MI200

社区贡献硬件支持

  • DeepSpeed 目前已支持多种异构硬件加速器:
贡献方 硬件设备 加速器标识 (Accelerator Name) 贡献方已验证 上游官方已验证
华为 (Huawei) 华为昇腾 NPU (Huawei Ascend NPU) npu 是 (Yes) 否 (No)
英特尔 (Intel) Intel(R) Gaudi(R) 2 AI 加速器 hpu 是 (Yes) 是 (Yes)
英特尔 (Intel) Intel(R) 至强(R) 处理器 (Xeon Processors) cpu 是 (Yes) 是 (Yes)
英特尔 (Intel) Intel(R) 数据中心 GPU Max 系列 (Data Center GPU Max) xpu 是 (Yes) 是 (Yes)
太初元碁 (Tecorigin) SDAA sdaa 是 (Yes) 否 (No)
昆仑芯 (KUNLUNXIN) 昆仑芯 XPU klxpu 是 (Yes) 否 (No)

PyPI 安装

我们定期向 PyPI 发布最新版本,在绝大多数场景下推荐直接从 PyPI 安装:

pip install deepspeed

安装完成后,您可以通过运行 DeepSpeed 环境诊断报告来验证安装,并查看当前机器所兼容支持的扩展/算子列表:

ds_report

如果您希望预先编译安装任意 DeepSpeed 算子/扩展(而非在运行时 JIT 编译),或通过 PyPI 获取预编译好的算子,请参阅我们的进阶安装指南。

Windows 安装支持

DeepSpeed 在 Windows 平台上对训练和推理均已支持大量核心功能。关于此特性的详细背景可参阅官方博客。目前在 Windows 上尚未支持的特性包括异步 I/O (AIO) 与 GDS(其本身不支持 Windows)。 1. 安装 PyTorch(例如 pytorch 2.3+cu121)。 2. 安装 Visual C++ 生成工具(例如 VS2022 C++ x64/x86 生成工具)。 3. 以管理员权限打开 Cmd 控制台以创建所需的符号链接目录,并确保 MSVC 相关工具已添加至 PATH 环境变量中;或者以管理员权限启动 Visual Studio 2022 的 Developer Command Prompt。 4. 运行 build_win.bat,即可在 dist 目录下构建 Wheel 安装包。

延伸阅读

所有关于 DeepSpeed 的官方文档、教程指南与技术博客均可在我们的官方网站上找到:deepspeed.ai

描述
快速上手 (Getting Started) DeepSpeed 初步入门指南
JSON 配置详解 (DeepSpeed JSON Configuration) DeepSpeed 核心配置选项
API 文档 (API Documentation) DeepSpeed API 自动生成文档
教程指南 (Tutorials)

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 8,921
Function 5,658
Class 2,337
Route 92
Enum 16

Languages

Python91%
C++9%

Modules by API surface

deepspeed/runtime/engine.py345 symbols
tests/unit/v1/moe/test_autoep_unit.py211 symbols
deepspeed/runtime/zero/stage3.py204 symbols
deepspeed/runtime/zero/stage_1_and_2.py187 symbols
deepspeed/module_inject/layers.py168 symbols
tests/unit/v1/zero/test_zero.py140 symbols
csrc/deepspeed4science/evoformer_attn/iterators/predicated_tile_iterator_residual_last.h133 symbols
deepspeed/runtime/zero/partition_parameters.py128 symbols
tests/unit/v1/zero/test_zero_user_backward.py127 symbols
tests/unit/runtime/rollout/test_hybrid_engine_rollout.py119 symbols
tests/unit/v1/autotp/test_autotp_training.py114 symbols
csrc/deepspeed4science/evoformer_attn/iterators/predicated_tile_access_iterator_residual_last.h111 symbols

Dependencies from manifests, versioned

autodoc_pydantic2.0.0 · 1×
clang-format18.1.3 · 1×
comet_ml3.41.0 · 1×
diffusers0.25.0 · 1×
importlib-metadata4 · 1×
liger-kernel0.8.1 · 1×
lm-eval0.3.0 · 1×
packaging20.0 · 1×
pre-commit3.2.0 · 1×
pydantic2.0.0 · 1×
pytest7.2.0 · 1×
qtorch0.3.0 · 1×

For agents

$ claude mcp add DeepSpeed \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page