DeepSpeed:基于 PyTorch 生态的深度学习训练优化项目

DeepSpeed is a deep learning optimization library that makes distributed training and inference easy, efficient, and effective.

分支846Tags124
文件最后提交记录最后更新时间
13 天前
23 天前
3 年前
2 个月前
1 年前
1 个月前
13 天前
2 天前
2 天前
1 年前
7 天前
1 个月前
10 天前
1 年前
7 天前
27 天前
2 天前
4 年前
2 年前
13 天前
2 年前
1 年前
4 年前
2 年前
3 年前
3 个月前
3 个月前
1 年前
4 年前
10 个月前
10 天前
1 年前
3 年前
2 年前
3 年前
1 年前
12 天前
7 个月前
27 天前
1 年前
2 年前
1 年前
5 年前
7 天前
22 天前

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

办公时间

DeepSpeed 每月最后一个周二的 12:00(美国/纽约时间)定期举办办公时间,讨论开发计划、功能特性等内容。本次会议对公众开放,任何人都可以参加并提问。 会议通过 Zoom 平台举办,可通过此处加入。

最新动态

更多新闻

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

DeepSpeed 助力了(在撰写本文时)世界上最强大的语言模型,例如 MT-530BBLOOM。DeepSpeed 融合了多项系统创新,这些创新让大规模深度学习训练变得高效、有效,极大地提升了易用性,并重新定义了深度学习训练在可实现规模方面的格局。这些创新包括 ZeRO、ZeRO-Infinity、3D 并行、Ulysses 序列并行、DeepSpeed-MoE 等。


DeepSpeed 的应用

DeepSpeed 是微软AI at Scale计划的重要组成部分,该计划旨在大规模赋能下一代 AI 能力,更多相关信息可在此处获取。

DeepSpeed 已被用于训练众多不同的大规模模型,以下是我们已知的部分示例(如果您希望将您的模型加入列表,请提交 PR):

DeepSpeed 已与多个流行的开源深度学习框架集成,例如:

文档说明
Transformers 与 DeepSpeed
Accelerate 与 DeepSpeed
Lightning 与 DeepSpeed
MosaicML 与 DeepSpeed
Determined 与 DeepSpeed
MMEngine 与 DeepSpeed

构建流水线状态

描述 状态
NVIDIA nv-pre-compile-ops aws-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

安装

使用 DeepSpeed 的最快方式是通过 pip,这将安装 DeepSpeed 的最新版本,该版本不绑定特定的 PyTorch 或 CUDA 版本。DeepSpeed 包含多个 C++/CUDA 扩展,我们通常将其称为“ops”。默认情况下,所有这些扩展/ops 将使用PyTorch 的 JIT C++ 扩展加载器(依赖 ninja)进行即时(JIT)构建,以在运行时构建并动态链接它们。

要求

  • 必须在安装 DeepSpeed 之前 安装 PyTorch
  • 为获得完整功能支持,我们建议使用 PyTorch 2.0 或更高版本,理想情况下是最新的 PyTorch 稳定版本。
  • 用于编译 C++/CUDA/HIP 扩展的 CUDA 或 ROCm 编译器,例如 nvcchipcc
  • 我们开发和测试所针对的特定 GPU 如下所列,这并不意味着您的 GPU 如果不在此类别中就无法工作,只是 DeepSpeed 在以下 GPU 上经过了最充分的测试:
    • NVIDIA:Pascal、Volta、Ampere 和 Hopper 架构
    • AMD:MI100 和 MI200

贡献的硬件支持

  • DeepSpeed 现在支持各种硬件加速器。
贡献者 硬件 加速器名称 贡献者已验证 上游已验证
华为 华为 Ascend NPU npu
英特尔 Intel(R) Gaudi(R) 2 AI 加速器 hpu
英特尔 Intel(R) Xeon(R) 处理器 cpu
英特尔 Intel(R) 数据中心 GPU Max 系列 xpu
天数智芯 可扩展数据 analytics 加速器 sdaa

PyPI

我们会定期将版本发布到 PyPI,并且在大多数情况下建议用户从该平台进行安装。

pip install deepspeed

安装完成后,您可以通过 DeepSpeed 环境报告验证安装情况,并查看您的机器兼容哪些扩展/操作。

ds_report

如果您希望预安装任何 DeepSpeed 扩展/操作(而非即时编译),或通过 PyPI 安装预编译操作,请参阅我们的高级安装说明

Windows

Windows 系统支持 DeepSpeed 的许多训练和推理功能。您可以在原始博客文章此处了解更多相关信息。目前不支持的功能包括异步输入输出(AIO)和 GDS(GDS 本身不支持 Windows)。

  1. 安装 PyTorch,例如 pytorch 2.3+cu121。
  2. 安装 Visual C++ 构建工具,例如 VS2022 C++ x64/x86 构建工具。
  3. 以管理员权限启动 Cmd 控制台,以创建所需的符号链接文件夹,并确保 MSVC 工具已添加到您的 PATH 中;或者以管理员权限启动 Visual Studio 2022 的开发者命令提示符。
  4. 运行 build_win.bat,在 dist 文件夹中构建 wheel 包。

进一步阅读

所有 DeepSpeed 文档、教程和博客均可在我们的网站上找到:deepspeed.ai

描述
Getting Started DeepSpeed 入门步骤
DeepSpeed JSON Configuration DeepSpeed 配置
API Documentation 生成的 DeepSpeed API 文档
Tutorials 教程
Blogs 博客

CI 资金支持

作为一个开源项目,我们依赖各方提供的 CI 硬件资源。目前,Modal 友好地为我们的 GPU CI 运行提供硬件资金支持。Modal 是一个 AI 基础设施平台,可用于推理、微调、批处理作业等。立即访问 https://modal.com,即可获得每月 30 美元的免费 credits 开始使用。我们得到了 Modal 团队的大力支持,强烈向您的业务推荐他们。

贡献指南

DeepSpeed 欢迎您的贡献!有关格式、测试等更多详细信息,请参阅我们的贡献指南
非常感谢所有杰出的贡献者!

开发者原产地证书

本项目欢迎贡献和建议。大多数贡献要求您同意开发者原产地证书 DCO,表明您同意就该特定贡献遵守在 https://developercertificate.org 上发布的条款。

DCO 针对每个提交,因此每个提交都需要签名。可以通过添加 -s 标志在提交中进行签名。也可以通过点击 PR 中的 DCO 强制检查来完成签名。

行为准则

本项目采用了 Microsoft 开源行为准则。有关更多信息,请参阅行为准则常见问题解答,或通过 opencode@microsoft.com 联系我们以获取其他问题或意见。

发表论文

  1. Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, Yuxiong He. (2019) ZeRO: memory optimizations toward training trillion parameter models. arXiv:1910.02054 and In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (SC '20).

  2. Jeff Rasley, Samyam Rajbhandari, Olatunji Ruwase, and Yuxiong He. (2020) DeepSpeed: System Optimizations Enable Training Deep Learning Models with Over 100 Billion Parameters. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (KDD '20, Tutorial).

  3. Minjia Zhang, Yuxiong He. (2020) Accelerating Training of Transformer-Based Language Models with Progressive Layer Dropping. arXiv:2010.13369 and NeurIPS 2020.

  4. Jie Ren, Samyam Rajbhandari, Reza Yazdani Aminabadi, Olatunji Ruwase, Shuangyan Yang, Minjia Zhang, Dong Li, Yuxiong He. (2021) ZeRO-Offload: Democratizing Billion-Scale Model Training. arXiv:2101.06840 and USENIX ATC 2021. [论文] [幻灯片] [博客]

  5. Hanlin Tang, Shaoduo Gan, Ammar Ahmad Awan, Samyam Rajbhandari, Conglong Li, Xiangru Lian, Ji Liu, Ce Zhang, Yuxiong He. (2021) 1-bit Adam: Communication Efficient Large-Scale Training with Adam's Convergence Speed. arXiv:2102.02888 and ICML 2021.

  6. Samyam Rajbhandari, Olatunji Ruwase, Jeff Rasley, Shaden Smith, Yuxiong He. (2021) ZeRO-Infinity: Breaking the GPU Memory Wall for Extreme Scale Deep Learning. arXiv:2104.07857 and SC 2021. [论文] [幻灯片] [博客]

  7. Conglong Li, Ammar Ahmad Awan, Hanlin Tang, Samyam Rajbhandari, Yuxiong He. (2021) 1-bit LAMB: Communication Efficient Large-Scale Large-Batch Training with LAMB's Convergence Speed. arXiv:2104.06069 and HiPC 2022.

  8. Conglong Li, Minjia Zhang, Yuxiong He. (2021) The Stability-Efficiency Dilemma: Investigating Sequence Length Warmup for Training GPT Models. arXiv:2108.06084 and NeurIPS 2022.

  9. Yucheng Lu, Conglong Li, Minjia Zhang, Christopher De Sa, Yuxiong He. (2022) Maximizing Communication Efficiency for Large-scale Training via 0/1 Adam. arXiv:2202.06009.

  10. Samyam Rajbhandari, Conglong Li, Zhewei Yao, Minjia Zhang, Reza Yazdani Aminabadi, Ammar Ahmad Awan, Jeff Rasley, Yuxiong He. (2022) DeepSpeed-MoE: Advancing Mixture-of-Experts Inference and Training to Power Next-Generation AI Scale arXiv:2201.05596 and ICML 2022. [pdf] [幻灯片] [博客]

  11. Shaden Smith, Mostofa Patwary, Brandon Norick, Patrick LeGresley, Samyam Rajbhandari, Jared Casper, Zhun Liu, Shrimai Prabhumoye, George Zerveas, Vijay Korthikanti, Elton Zhang, Rewon Child, Reza Yazdani Aminabadi, Julie Bernauer, Xia Song, Mohammad Shoeybi, Yuxiong He, Michael Houston, Saurabh Tiwary, Bryan Catanzaro. (2022) Using DeepSpeed and Megatron to Train Megatron-Turing NLG 530B, A Large-Scale Generative Language Model arXiv:2201.11990.

  12. Xiaoxia Wu, Zhewei Yao, Minjia Zhang, Conglong Li, Yuxiong He. (2022) Extreme Compression for Pre-trained Transformers Made Simple and Efficient. arXiv:2206.01859 and NeurIPS 2022.

  13. Zhewei Yao, Reza Yazdani Aminabadi, Minjia Zhang, Xiaoxia Wu, Conglong Li, Yuxiong He. (2022) ZeroQuant: Efficient and Affordable Post-Training Quantization for Large-Scale Transformers. arXiv:2206.01861 and NeurIPS 2022 [幻灯片] [博客]

  14. Reza Yazdani Aminabadi, Samyam Rajbhandari, Minjia Zhang, Ammar Ahmad Awan, Cheng Li, Du Li, Elton Zheng, Jeff Rasley, Shaden Smith, Olatunji Ruwase, Yuxiong He. (2022) DeepSpeed Inference: Enabling Efficient Inference of Transformer Models at Unprecedented Scale. arXiv:2207.00032 and SC 2022. [论文] [幻灯片] [博客]

  15. Zhewei Yao, Xiaoxia Wu, Conglong Li, Connor Holmes, Minjia Zhang, Cheng Li, Yuxiong He. (2022) Random-LTD: Random and Layerwise Token Dropping Brings Efficient Training for Large-scale Transformers. arXiv:2211.11586.

  16. Conglong Li, Zhewei Yao, Xiaoxia Wu, Minjia Zhang, Yuxiong He. (2022) DeepSpeed Data Efficiency: Improving Deep Learning Model Quality and Training Efficiency via Efficient Data Sampling and Routing. arXiv:2212.03597 ENLSP2023 Workshop at NeurIPS2023

  17. Xiaoxia Wu, Cheng Li, Reza Yazdani Aminabadi, Zhewei Yao, Yuxiong He. (2023) Understanding INT4 Quantization for Transformer Models: Latency Speedup, Composability, and Failure Cases. arXiv:2301.12017 and ICML2023.

  18. Syed Zawad, Cheng Li, Zhewei Yao, Elton Zheng, Yuxiong He, Feng Yan. (2023) DySR: Adaptive Super-Resolution via Algorithm and System Co-design. ICLR:2023.

  19. Sheng Shen, Zhewei Yao, Chunyuan Li, Trevor Darrell, Kurt Keutzer, Yuxiong He. (2023) Scaling Vision-Language Models with Sparse Mixture of Experts. arXiv:2303.07226 and Finding at EMNLP2023.

  20. Quentin Anthony, Ammar Ahmad Awan, Jeff Rasley, Yuxiong He, Aamir Shafi, Mustafa Abduljabbar, Hari Subramoni, Dhabaleswar Panda. (2023) MCR-DL: Mix-and-Match Communication Runtime for Deep Learning arXiv:2303.08374 and will appear at IPDPS 2023.

  21. Siddharth Singh, Olatunji Ruwase, Ammar Ahmad Awan, Samyam Rajbhandari, Yuxiong He, Abhinav Bhatele. (2023) A Hybrid Tensor-Expert-Data Parallelism Approach to Optimize Mixture-of-Experts Training arXiv:2303.06318 and ICS 2023.

  22. Guanhua Wang, Heyang Qin, Sam Ade Jacobs, Xiaoxia Wu, Connor Holmes, Zhewei Yao, Samyam Rajbhandari, Olatunji Ruwase, Feng Yan, Lei Yang, Yuxiong He. (2023) ZeRO++: Extremely Efficient Collective Communication for Giant Model Training arXiv:2306.10209 and ML for Sys Workshop at NeurIPS2023 [博客]

  23. Zhewei Yao, Xiaoxia Wu, Cheng Li, Stephen Youn, Yuxiong He. (2023) ZeroQuant-V2: Exploring Post-training Quantization in LLMs from Comprehensive Study to Low Rank Compensation arXiv:2303.08302 and ENLSP2023 Workshop at NeurIPS2023 [幻灯片]

  24. Pareesa Ameneh Golnari, Zhewei Yao, Yuxiong He. (2023) Selective Guidance: Are All the Denoising Steps of Guided Diffusion Important? arXiv:2305.09847

  25. Zhewei Yao, Reza Yazdani Aminabadi, Olatunji Ruwase, Samyam Rajbhandari, Xiaoxia Wu, Ammar Ahmad Awan, Jeff Rasley, Minjia Zhang, Conglong Li, Connor Holmes, Zhongzhu Zhou, Michael Wyatt, Molly Smith, Lev Kurilenko, Heyang Qin, Masahiro Tanaka, Shuai Che, Shuaiwen Leon Song, Yuxiong He. (2023) DeepSpeed-Chat: Easy, Fast and Affordable RLHF Training of ChatGPT-like Models at All Scales arXiv:2308.01320.

  26. Xiaoxia Wu, Zhewei Yao, Yuxiong He. (2023) ZeroQuant-FP: A Leap Forward in LLMs Post-Training W4A8 Quantization Using Floating-Point Formats arXiv:2307.09782 and ENLSP2023 Workshop at NeurIPS2023 [幻灯片]

  27. Zhewei Yao, Xiaoxia Wu, Conglong Li, Minjia Zhang, Heyang Qin, Olatunji Ruwase, Ammar Ahmad Awan, Samyam Rajbhandari, Yuxiong He. (2023) DeepSpeed-VisualChat: Multi-Round Multi-Image Interleave Chat via Multi-Modal Causal Attention arXiv:2309.14327

  28. Shuaiwen Leon Song, Bonnie Kruft, Minjia Zhang, Conglong Li, Shiyang Chen, Chengming Zhang, Masahiro Tanaka, Xiaoxia Wu, Jeff Rasley, Ammar Ahmad Awan, Connor Holmes, Martin Cai, Adam Ghanem, Zhongzhu Zhou, Yuxiong He, et al. (2023) DeepSpeed4Science Initiative: Enabling Large-Scale Scientific Discovery through Sophisticated AI System Technologies arXiv:2310.04610 [博客]

  29. Zhewei Yao, Reza Yazdani Aminabadi, Stephen Youn, Xiaoxia Wu, Elton Zheng, Yuxiong He. (2023) ZeroQuant-HERO: Hardware-Enhanced Robust Optimized Post-Training Quantization Framework for W8A8 Transformers arXiv:2310.17723

  30. Xiaoxia Wu, Haojun Xia, Stephen Youn, Zhen Zheng, Shiyang Chen, Arash Bakhtiari, Michael Wyatt, Reza Yazdani Aminabadi, Yuxiong He, Olatunji Ruwase, Leon Song, Zhewei Yao (2023) ZeroQuant(4+2): Redefining LLMs Quantization with a New FP6-Centric Strategy for Diverse Generative Tasks arXiv:2312.08583

  31. Haojun Xia, Zhen Zheng, Xiaoxia Wu, Shiyang Chen, Zhewei Yao, Stephen Youn, Arash Bakhtiari, Michael Wyatt, Donglin Zhuang, Zhongzhu Zhou, Olatunji Ruwase, Yuxiong He, Shuaiwen Leon Song. (2024) FP6-LLM: Efficiently Serving Large Language Models Through FP6-Centric Algorithm-System Co-Design arXiv:2401.14112

  32. Sam Ade Jacobs, Masahiro Tanaka, Chengming Zhang, Minjia Zhang, Reza Yazdani Aminadabi, Shuaiwen Leon Song, Samyam Rajbhandari, Yuxiong He. (2024) System Optimizations for Enabling Training of Extreme Long Sequence Transformer Models

  33. Xinyu Lian, Sam Ade Jacobs, Lev Kurilenko, Masahiro Tanaka, Stas Bekman, Olatunji Ruwase, Minjia Zhang. (2024) Universal Checkpointing: Efficient and Flexible Checkpointing for Large Scale Distributed Training arXiv:2406.18820

  34. Stas Bekman, Samyam Rajbhandari, Michael Wyatt, Jeff Rasley, Tunji Ruwase, Zhewei Yao, Aurick Qiao, Yuxiong He. (2025) Arctic Long Sequence Training: Scalable And Efficient Training For Multi-Million Token Sequences arXiv:2506.13996

  35. Tingfeng Lan, Yusen Wu, Bin Ma, Zhaoyuan Su, Rui Yang, Tekin Bicer, Masahiro Tanaka, Olatunji Ruwase, Dong Li, Yue Cheng. (2025) ZenFlow: Enabling Stall-Free Offloading Training via Asynchronous Updates arXiv:2505.12242

  36. Kayhan Behdin, Ata Fatahibaarzi, Qingquan Song, Yun Dai, Aman Gupta, Zhipeng Wang, Hejian Sang, Shao Tang, Gregory Dexter, Sirou Zhu, Siyu Zhu, Tejas Dharamsi, Vignesh Kothapalli, Zhoutong Fu, Yihan Cao, Pin-Lun Hsu, Fedor Borisyuk, Natesh S. Pillai, Luke Simon, Rahul Mazumder.(2025) Scaling Down, Serving Fast: Compressing and Deploying Efficient LLMs for Recommendation Systems EMNLP 2025

  37. Xinyu Lian, Masahiro Tanaka, Olatunji Ruwase, Minjia Zhang. (2026) SuperOffload: Unleashing the Power of Large-Scale LLM Training on Superchips arxiv, ASPLOS 2026

视频

  1. DeepSpeed KDD 2020 教程
    1. 概述
    2. ZeRO + 大型模型训练
    3. 170亿参数 T-NLG 演示
    4. 最快 BERT 训练 + RScan 调优
    5. DeepSpeed 实践深入探究:第一部分第二部分第三部分
    6. 常见问题解答
  2. 微软研究院网络研讨会
  3. DeepSpeed 在 AzureML 上的应用
  4. 使用 DeepSpeed 进行大型模型训练与推理 // Samyam Rajbhandari // 生产环境中的大语言模型会议 [幻灯片]
  5. 社区教程

项目介绍

DeepSpeed 是一个深度学习优化库,它能使得分布式训练和推理变得简单、高效且有效。【此简介由AI生成】

定制我的领域
35942.68 K4.88 K访问 GitHub