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, но async io (AIO) и GDS не поддерживаются, а для сборки там нужны инструменты сборки Visual C++ и консоль с правами администратора, чтобы запустить buildwin.bat.
Мне нужен большой GPU-кластер, или это полезно и на одной машине?Проект нацелен на экстремальные масштабы — ZeRO-Infinity буквально создан, чтобы пробить барьер памяти GPU, — хотя линейка работ ZeRO-Offload сосредоточена на том, чтобы сделать обучение масштаба миллиардов параметров доступным и на более скромном железе.
Будет ли работать с моей видеокартой — AMD, Intel или только NVIDIA?Лучше всего протестировано на NVIDIA Pascal, Volta, Ampere и Hopper, а также AMD MI100/MI200; Huawei Ascend NPU, Intel Gaudi 2, процессоры Xeon, Intel GPU Max и Tecorigin SDAA поддерживаются усилиями сообщества.
Что такое ZeRO?Это ключевая оптимизация памяти в DeepSpeed; вместе с ZeRO-Infinity, 3D-Parallelism, Ulysses Sequence Parallelism и 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 нацелена на масштабируемое и эффективное обучение на последовательностях в миллионы токенов.
What are similar projects?ColossalAI, verl, mamba, ktransformers, LMCache, petals, DeepGEMM, vllm
Size
245.1 MB
Stars
43.2K
Age
6y
Commits · 90 Days