DeepSpeed library
Project description
DeepSpeed 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 reduces communication volume by up to 5x while achieving similar convergence efficiency to Adam, 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 deepspeed.ai!
News
- [2020/11/12] Simplified install, JIT compiled ops, PyPI releases, and reduced dependencies
- [2020/11/10] Efficient and robust compressed training through progressive layer dropping
- [2020/09/10] DeepSpeed v0.3: Extreme-scale model training for everyone
- [2020/08/07] DeepSpeed Microsoft Research Webinar is now available on-demand
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 |
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 torch's JIT C++ extension loader that relies on ninja to build and dynamically link them at runtime.
Note: PyTorch must be installed before installing DeepSpeed.
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.
Features
Below we provide a brief feature list, see our detailed feature overview for descriptions and usage.
- Distributed Training with Mixed Precision
- 16-bit mixed precision
- Single-GPU/Multi-GPU/Multi-Node
- Model Parallelism
- Support for Custom Model Parallelism
- Integration with Megatron-LM
- Pipeline Parallelism
- 3D Parallelism
- The Zero Redundancy Optimizer (ZeRO)
- Optimizer State and Gradient Partitioning
- Activation Partitioning
- Constant Buffer Optimization
- Contiguous Memory Optimization
- ZeRO-Offload
- Leverage both CPU/GPU memory for model training
- Support 10B model training on a single GPU
- Ultra-fast dense transformer kernels
- Sparse attention
- Memory- and compute-efficient sparse kernels
- Support 10x long sequences than dense
- Flexible support to different sparse structures
- 1-bit Adam
- Custom communication collective
- Up to 5x communication volume saving
- Additional Memory and Bandwidth Optimizations
- Smart Gradient Accumulation
- Communication/Computation Overlap
- Training Features
- Simplified training API
- Gradient Clipping
- Automatic loss scaling with mixed precision
- 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
- Training Agnostic Checkpointing
- Advanced Parameter Search
- Learning Rate Range Test
- 1Cycle Learning Rate Schedule
- Simplified Data Loader
- Performance Analysis and Debugging
Further Reading
All DeepSpeed documentation can be found on our website: deepspeed.ai
Article | Description |
---|---|
DeepSpeed Features | DeepSpeed features |
Getting Started | First steps with DeepSpeed |
DeepSpeed JSON Configuration | Configuring DeepSpeed |
API Documentation | Generated DeepSpeed API documentation |
CIFAR-10 Tutorial | Getting started with CIFAR-10 and DeepSpeed |
Megatron-LM Tutorial | Train GPT2 with DeepSpeed and Megatron-LM |
BERT Pre-training Tutorial | Pre-train BERT with DeepSpeed |
Learning Rate Range Test Tutorial | Faster training with large learning rates |
1Cycle Tutorial | 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 https://cla.opensource.microsoft.com.
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 opencode@microsoft.com with any additional questions or comments.
Publications
- Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, Yuxiong He. (2019) ZeRO: Memory Optimization Towards Training A Trillion Parameter Models. ArXiv:1910.02054
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file deepspeed-0.3.7.tar.gz
.
File metadata
- Download URL: deepspeed-0.3.7.tar.gz
- Upload date:
- Size: 258.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 920a26b28156eeb371cc2a5af0323d7581bb4956fd4ab1b17f955c0d560658ca |
|
MD5 | bd9bcba8473e9f04be59b13b83a9439e |
|
BLAKE2b-256 | 1ff64de24b5790621e9eb787b7e4d90a57075ebbb85e81100a0dc8c50fdba8ba |