DeepSpeed是微软开发的深度学习优化库,通过提供高效分布式训练技术(如ZeRO、3D并行、稀疏注意力等),实现10倍更大模型规模和10倍更快训练速度,支持从单GPU到超算集群的训练场景,最小化代码改动。
DeepSpeed+Megatron trained the world's most powerful language model: MT-530B
DeepSpeed is hiring, come join us!
https://www.deepspeed.ai/ is a deep learning optimization library that makes distributed training easy, efficient, and effective.
10x Larger Models
10x Faster Training
Minimal Code Change
DeepSpeed delivers extreme-scale model training for everyone, from data scientists training on massive supercomputers to those training on low-end clusters or even on a single GPU:
- Extreme scale: Using current generation of GPU clusters with hundreds of devices, 3D parallelism of DeepSpeed can efficiently train deep learning models with trillions of parameters.
- Extremely memory efficient: With just a single GPU, ZeRO-Offload of DeepSpeed can train models with over 10B parameters, 10x bigger than the state of arts, democratizing multi-billion-parameter model training such that many deep learning scientists can explore bigger and better models.
- Extremely long sequence length: Sparse attention of DeepSpeed powers an order-of-magnitude longer input sequence and obtains up to 6x faster execution comparing with dense transformers.
- Extremely communication efficient: 3D parallelism improves communication efficiency allows users to train multi-billion-parameter models 2–7x faster on clusters with limited network bandwidth. 1-bit Adam/1-bit LAMB reduce communication volume by up to 5x while achieving similar convergence efficiency to Adam/LAMB, allowing for scaling to different types of GPU clusters and networks.
Early adopters of DeepSpeed have already produced a language model (LM) with over 17B parameters called Turing-NLG, establishing a new SOTA in the LM category.
DeepSpeed is an important part of Microsoft’s new AI at Scale initiative to enable next-generation AI capabilities at scale, where you can find more information here.
For further documentation, tutorials, and technical deep-dives please see https://www.deepspeed.ai/!
News
- [2021/11/15] https://www.deepspeed.ai/news/2021/11/15/autotuning.html
- [2021/10/11] Using DeepSpeed and Megatron to Train Megatron-Turing NLG 530B, the World’s Largest and Most Powerful Generative Language Model
- Read more on how to https://www.deepspeed.ai/tutorials/large-models-w-deepspeed/
- [2021/08/18] DeepSpeed powers 8x larger MoE model training with high performance
- https://www.deepspeed.ai/tutorials/mixture-of-experts/.
- [2021/08/16] https://www.deepspeed.ai/tutorials/curriculum-learning/
- [2021/05/24] DeepSpeed: Accelerating large-scale model inference and training via system optimizations and compression
- [2021/04/20] https://www.deepspeed.ai/tutorials/onebit-lamb/
- [2021/04/19] ZeRO-Infinity unlocks unprecedented model scale for deep learning training
- https://www.deepspeed.ai/tutorials/zero/
- [2021/04/01] https://github.com/Azure/azureml-examples/tree/main/python-sdk/workflows/train/deepspeed
- [2021/03/30] [[PyTorch Lightning Blog] Accessible Multi-Billion Parameter Model Training with PyTorch Lightning + DeepSpeed]([***]
- [2021/03/16] https://www.deepspeed.ai/tutorials/onebit-adam/
Table of Contents
| Section | Description |
|---|---|
| Why DeepSpeed? | DeepSpeed overview |
| Install | Installation details |
| Features | Feature list and overview |
| Further Reading | Documentation, tutorials, etc. |
| Contributing | Instructions for contributing |
| Publications | Publications related to DeepSpeed |
| Videos | Videos related to DeepSpeed |
Why DeepSpeed?
Training advanced deep learning models is challenging. Beyond model design, model scientists also need to set up the state-of-the-art training techniques such as distributed training, mixed precision, gradient accumulation, and checkpointing. Yet still, scientists may not achieve the desired system performance and convergence rate. Large model sizes are even more challenging: a large model easily runs out of memory with pure data parallelism and it is difficult to use model parallelism. DeepSpeed addresses these challenges to accelerate model development and training.
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 https://pytorch.org/docs/stable/cpp_extension.html to build and dynamically link them at runtime.
Note: https://pytorch.org/ must be installed before installing DeepSpeed.
bashpip install deepspeed
After installation, you can validate your install and see which extensions/ops your machine is compatible with via the DeepSpeed environment report.
bashds_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 https://www.deepspeed.ai/tutorials/advanced-install/.
On Windows you can build wheel with following steps, currently only inference mode is supported.
- Install pytorch, such as pytorch 1.8 + cuda 11.1
- Install visual cpp build tools, such as VS2019 C++ x64/x86 build tools
- Launch cmd console with Administrator privilege for creating required symlink folders
- Run
python setup.py bdist_wheelto build wheel indistfolder
Features
Below we provide a brief feature list, see our detailed https://www.deepspeed.ai/features/ for descriptions and usage.
- https://www.deepspeed.ai/features/#distributed-training-with-mixed-precision
- 16-bit mixed precision
- Single-GPU/Multi-GPU/Multi-Node
- https://www.deepspeed.ai/features/#model-parallelism
- Support for Custom Model Parallelism
- Integration with Megatron-LM
- https://www.deepspeed.ai/tutorials/pipeline/
- 3D Parallelism
- https://www.deepspeed.ai/tutorials/zero/
- Optimizer State and Gradient Partitioning
- Activation Partitioning
- Constant Buffer Optimization
- Contiguous Memory Optimization
- https://www.deepspeed.ai/tutorials/zero-offload/
- Leverage both CPU/GPU memory for model training
- Support 10B model training on a single GPU
- https://www.deepspeed.ai/news/2020/05/18/bert-record.html
- https://www.deepspeed.ai/news/2020/09/08/sparse-attention.html
- Memory- and compute-efficient sparse kernels
- Support 10x longer sequences than dense
- Flexible support to different sparse structures
- https://www.deepspeed.ai/news/2020/09/08/onebit-adam-blog-post.html and https://www.deepspeed.ai/tutorials/onebit-lamb/
- Custom communication collective
- Up to 5x communication volume saving
- https://www.deepspeed.ai/features/#additional-memory-and-bandwidth-optimizations
- Smart Gradient Accumulation
- Communication/Computation Overlap
- https://www.deepspeed.ai/features/#training-features
- Simplified training API
- Gradient Clipping
- Automatic loss scaling with mixed precision
- https://www.deepspeed.ai/features/#training-optimizers
- Fused Adam optimizer and arbitrary
torch.optim.Optimizer - Memory bandwidth optimized FP16 Optimizer
- Large Batch Training with LAMB Optimizer
- Memory efficient Training with ZeRO Optimizer
- CPU-Adam
- Fused Adam optimizer and arbitrary
- https://www.deepspeed.ai/features/#training-agnostic-checkpointing
- https://www.deepspeed.ai/features/#advanced-parameter-search
- Learning Rate Range Test
- 1Cycle Learning Rate Schedule
- https://www.deepspeed.ai/features/#simplified-data-loader
- https://www.deepspeed.ai/tutorials/curriculum-learning/
- A curriculum learning-based data pipeline that presents easier or simpler examples earlier during training
- Stable and 3.3x faster GPT-2 pre-training with 8x/4x larger batch size/learning rate while maintaining token-wise convergence speed
- Complementary to many other DeepSpeed features
- https://www.deepspeed.ai/features/#performance-analysis-and-debugging
- https://www.deepspeed.ai/tutorials/mixture-of-experts/
Further Reading
All DeepSpeed documentation can be found on our website: https://www.deepspeed.ai/
| Article | Description |
|---|---|
| https://www.deepspeed.ai/features/ | DeepSpeed features |
| https://www.deepspeed.ai/getting-started/ | First steps with DeepSpeed |
| https://www.deepspeed.ai/docs/config-json/ | Configuring DeepSpeed |
| https://deepspeed.readthedocs.io/en/latest/ | Generated DeepSpeed API documentation |
| https://www.deepspeed.ai/tutorials/cifar-10 | Getting started with CIFAR-10 and DeepSpeed |
| https://www.deepspeed.ai/tutorials/megatron/ | Train GPT2 with DeepSpeed and Megatron-LM |
| https://www.deepspeed.ai/tutorials/bert-pretraining/ | Pre-train BERT with DeepSpeed |
| https://www.deepspeed.ai/tutorials/lrrt/ | Faster training with large learning rates |
| https://www.deepspeed.ai/tutorials/one-cycle/ | SOTA learning schedule in DeepSpeed |
Contributing
DeepSpeed welcomes your contributions! Please see our contributing guide for more details on formatting, testing, etc.
Contributor License Agreement
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [***]
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
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 *** with any additional questions or comments.
Publications
- Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, Yuxiong He. (2019) ZeRO: memory optimizations toward training trillion parameter models. https://arxiv.org/abs/1910.02054 and In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (SC '20).
- 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).
- Minjia Zhang, Yuxiong He. (2020) Accelerating Training of Transformer-Based Language Models with Progressive Layer Dropping. https://arxiv.org/abs/2010.*** and NeurIPS 2020.
- 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. https://arxiv.org/abs/2101.06840.
- 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. https://arxiv.org/abs/2102.02888 and ICML 2021.
- Samyam Rajbhandari, Olatunji Ruwase, Jeff Rasley, Shaden Smith, Yuxiong He. (2021) ZeRO-Infinity: Breaking the GPU Memory Wall for Extreme Scale Deep Learning. https://arxiv.org/abs/2104.07857.
- 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. https://arxiv.org/abs/2104.06069.
- Conglong Li, Minjia Zhang, Yuxiong He. (2021) Curriculum Learning: A Regularization Method for Efficient and Stable Billion-Scale GPT Model Pre-Training. https://arxiv.org/abs/2108.06084.
Videos
- DeepSpeed KDD 2020 Tutorial
- Overview
- ZeRO + large model training
- 17B T-NLG demo
- Fastest BERT training + RScan tuning
- DeepSpeed hands on deep dive: part 1, part 2, part 3
- FAQ
- Microsoft Research Webinar
- Registration is free and all videos are available on-demand.
- ZeRO & Fastest BERT: Increasing the scale and speed of deep learning training in DeepSpeed.
- DeepSpeed on AzureML
- Community Tutorials
- DeepSpeed: All the tricks to scale to gigantic models
- Turing-NLG, DeepSpeed and the ZeRO optimizer
rocm 命名空间的其他可用镜像:
rocm/vllm
rocm/pytorch
rocm/vllm-dev
rocm/vllm-ci
rocm/sgl-dev
rocm/k8s-device-plugin
更多相关 Docker 镜像与资源
以下是 rocm/deepspeed 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:
镜像拉取方式
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
DockerHub 原生拉取命令
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务