DeepSpeed README

The project's README from github.com/deepspeedai/DeepSpeed. As one markdown file: README.md.

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

Office Hours

DeepSpeed hosts regular office hours on the last Tuesday of each month at 12:00 America/New_York to discuss development plans, features, etc. This meeting is public for anyone to join and ask questions. The meeting is hosted on Zoom and can be joined here.

Latest News

More news

Extreme Speed and Scale for DL Training

DeepSpeed enabled the world's most powerful language models (at the time of this writing) such as MT-530B and BLOOM. DeepSpeed offers a confluence of system innovations, that has made large scale DL training effective, and efficient, greatly improved ease of use, and redefined the DL training landscape in terms of scale that is possible. These innovations include ZeRO, ZeRO-Infinity, 3D-Parallelism, Ulysses Sequence Parallelism, DeepSpeed-MoE, etc.


DeepSpeed Adoption

DeepSpeed was an important part of Microsoft’s AI at Scale initiative to enable next-generation AI capabilities at scale, where you can find more information here.

DeepSpeed has been used to train many different large-scale models, below is a list of several examples that we are aware of (if you'd like to include your model please submit a PR):

DeepSpeed has been integrated with several different popular open-source DL frameworks such as:

Documentation
Transformers with DeepSpeed
Accelerate with DeepSpeed
Lightning with DeepSpeed
MosaicML with DeepSpeed
Determined with DeepSpeed
MMEngine with DeepSpeed

Build Pipeline Status

Description Status
NVIDIA nv-pre-compile-ops modal-torch-latest
AMD amd-mi200
CPU torch-latest-cpu
Intel Gaudi hpu-gaudi2
Intel XPU xpu-max1100
Integrations aws-accelerate
Misc Formatting pages-build-deployment Documentation Statuspython
Huawei Ascend NPU Huawei Ascend NPU

Installation

The quickest way to get started with DeepSpeed is via pip, this will install the latest release of DeepSpeed which is not tied to specific PyTorch or CUDA versions. DeepSpeed includes several C++/CUDA extensions that we commonly refer to as our 'ops'. By default, all of these extensions/ops will be built just-in-time (JIT) using torch's JIT C++ extension loader that relies on ninja to build and dynamically link them at runtime.

Requirements

Contributed HW support

Contributor Hardware Accelerator Name Contributor validated Upstream validated
Huawei Huawei Ascend NPU npu Yes No
Intel Intel(R) Gaudi(R) 2 AI accelerator hpu Yes Yes
Intel Intel(R) Xeon(R) Processors cpu Yes Yes
Intel Intel(R) Data Center GPU Max series xpu Yes Yes
Tecorigin Scalable Data Analytics Accelerator sdaa Yes No

PyPI

We regularly push releases to PyPI and encourage users to install from there in most cases.

pip install deepspeed

After installation, you can validate your install and see which extensions/ops your machine is compatible with via the DeepSpeed environment report.

ds_report

If you would like to pre-install any of the DeepSpeed extensions/ops (instead of JIT compiling) or install pre-compiled ops via PyPI please see our advanced installation instructions.

Windows

Many DeepSpeed features are supported on Windows for both training and inference. You can read more about this in the original blog post here. Among features that are currently not supported are async io (AIO) and GDS (which does not support Windows).

  1. Install PyTorch, such as pytorch 2.3+cu121.
  2. Install Visual C++ build tools, such as VS2022 C++ x64/x86 build tools.
  3. Launch Cmd console with Administrator permissions for creating required symlink folders and ensure MSVC tools are added to your PATH or launch the Developer Command Prompt for Visual Studio 2022 with administrator permissions.
  4. Run build_win.bat to build wheel in dist folder.

Further Reading

All DeepSpeed documentation, tutorials, and blogs can be found on our website: deepspeed.ai

Description
Getting Started First steps with DeepSpeed
DeepSpeed JSON Configuration Configuring DeepSpeed
API Documentation Generated DeepSpeed API documentation
Tutorials Tutorials
Blogs Blogs

CI funding

This being an open source project we rely on others to provide us resources for CI hardware. At this moment Modal is kindly supporting our GPU CI runs by funding the hardware for us. Modal is an AI infrastructure platform for inference, fine-tuning, batch jobs and more. Get started with $30/mo in free credits today at https://modal.com. We have been getting an amazing support from Modal's team and will surely recommend them to your business.

Contributing

DeepSpeed welcomes your contributions! Please see our contributing guide for more details on formatting, testing, etc.
Thanks so much to all of our amazing contributors!

Developer Certificate of Origin

This project welcomes contributions and suggestions. Most contributions require you to agree to a Developer Certificate of Origin DCO stating that they agree to the terms published at https://developercertificate.org for that particular contribution.

DCOs are per-commit, so each commit needs to be signed off. These can be signed in the commit by adding the -s flag. DCO enforcement can also be signed off in the PR itself by clicking on the DCO enforcement check.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Publications

  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. [paper] [slides] [blog]
  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](https:/

DeepSpeed (deepspeedai/DeepSpeed)

Searching Database…

43.2K ·GitHub
这是做什么用的?DeepSpeed 是一个深度学习优化库,让超大规模模型的分布式训练和推理变得简单、高效、有效——MT-530B 和 BLOOM 等模型就是靠它训练出来的。
它是一个接入我 PyTorch 代码的库,还是一个需要单独部署的平台?它是一个 Python 库,安装在 PyTorch 之上,在你自己的训练代码里调用——既不是服务,也不是独立应用。
安装之前我的电脑需要准备什么?必须先装好 PyTorch(建议 2.0 及以上),另外还需要一个 CUDA 或 ROCm 编译器,比如 nvcc 或 hipcc,用来编译 C++/CUDA/HIP 扩展。
在 Windows 上是不是所有功能都能用,还是有缺口?很多训练和推理功能在 Windows 上都能用,但异步 IO(AIO)和 GDS 不支持,而且在 Windows 上编译需要 Visual C++ 生成工具,还要在管理员控制台里运行 buildwin.bat。
我需要一大片 GPU 集群才行,还是单机也有帮助?它面向的是极限规模——ZeRO-Infinity 的目标就是突破 GPU 显存的墙——不过 ZeRO-Offload 这一系列工作专注于让更普通的硬件也能做十亿参数级别的训练。
我的 GPU 能用吗——AMD、Intel 都行,还是只支持 NVIDIA?在 NVIDIA Pascal、Volta、Ampere、Hopper 以及 AMD MI100/MI200 上测试得最多;华为昇腾 NPU、Intel Gaudi 2、至强 CPU、Intel GPU Max 和 Tecorigin SDAA 由社区贡献者提供支持。
ZeRO 是什么?它是 DeepSpeed 主打的显存优化技术;和 ZeRO-Infinity、3D-Parallelism、Ulysses 序列并行以及 DeepSpeed-MoE 一起,构成了极限规模训练背后的核心创新组合。
大家用它训练的模型一般有多大?参数量达到几千亿:Megatron-Turing NLG 530B、Jurassic-1 178B、BLOOM 176B、GLM 130B、YaLM 100B——而且 DeepSpeed 的目标瞄准了万亿参数级别。
它和 Hugging Face Transformers 兼容吗?兼容——它能和 Transformers、Accelerate 集成,还支持 Lightning、MosaicML、Determined 和 MMEngine,所以你通常可以直接加到现有的技术栈里。
它能处理很长的输入序列吗?能——该项目的 Arctic Long Sequence Training(ALST)工作配合 DeepSpeed,目标是让数百万 token 的长序列训练可扩展、高效率。
What are similar projects?ColossalAI, verl, mamba, ktransformers, LMCache, petals, DeepGEMM, vllm
Size
245.1 MB
Stars
43.2K
Age
6y
Commits · 90 Days