Package: deepspeed-moee
Latest News[2022/03/21]Supporting efficient large model training on AMD Instinct GPUs with DeepSpeed[2022/03/07]Maximizing Communication Efficiency for Large-scale Training via 0/1 Adam[2022/01/19]DeepSpeed: Advancing MoE inference and training to power next-generation AI scaleMixture of Experts (MoE) for NLG tutorial.Mixture of Experts (MoE) Inference tutorial.[2021/11/15]Autotuning: Automatically discover the optimal DeepSpeed configuration that delivers good training speed[2021/10/11]Using DeepSpeed and Megatron to Train Megatron-Turing NLG 530B, the World’s Largest and Most Powerful Generative Language ModelRead more on how totrain large models with DeepSpeedDeepSpeed is hiring,come join us!DeepSpeedis a deep learning optimization
library that makes distributed training easy, efficient, and effective.10x Larger Models10x Faster TrainingMinimal Code ChangeDeepSpeed 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, 0/1 Adam and 1-bit LAMB reduce communication volume by up to 26x 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 calledTuring-NLG,
establishing a new SOTA in the LM category.DeepSpeed is an important part of Microsoft’s newAI at Scaleinitiative to enable next-generation AI capabilities at scale, where you can find more
informationhere.For further documentation, tutorials, and technical deep-dives please seedeepspeed.ai!Table of ContentsSectionDescriptionWhy DeepSpeed?DeepSpeed overviewInstallInstallation detailsFeaturesFeature list and overviewFurther ReadingDocumentation, tutorials, etc.ContributingInstructions for contributingPublicationsPublications related to DeepSpeedVideosVideos related to DeepSpeedWhy 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 developmentandtraining.InstallationThe 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) usingtorch's JIT C++ extension loader that relies on
ninjato build and
dynamically link them at runtime.Note:PyTorchmust be installedbeforeinstalling
DeepSpeed.pipinstalldeepspeedAfter installation, you can validate your install and see which extensions/ops
your machine is compatible with via the DeepSpeed environment report.ds_reportIf 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 ouradvanced
installation instructions.On Windows you can build wheel with following steps, currently only inference mode is supported.Install pytorch, such as pytorch 1.8 + cuda 11.1Install visual cpp build tools, such as VS2019 C++ x64/x86 build toolsLaunch cmd console with Administrator privilege for creating required symlink foldersRunpython setup.py bdist_wheelto build wheel indistfolderFeaturesBelow we provide a brief feature list, see our detailedfeature
overviewfor descriptions and usage.Distributed Training with Mixed Precision16-bit mixed precisionSingle-GPU/Multi-GPU/Multi-NodeModel ParallelismSupport for Custom Model ParallelismIntegration with Megatron-LMPipeline Parallelism3D ParallelismThe Zero Redundancy Optimizer (ZeRO)Optimizer State and Gradient PartitioningActivation PartitioningConstant Buffer OptimizationContiguous Memory OptimizationZeRO-OffloadLeverage both CPU/GPU memory for model trainingSupport 10B model training on a single GPUUltra-fast dense transformer kernelsSparse attentionMemory- and compute-efficient sparse kernelsSupport 10x longer sequences than denseFlexible support to different sparse structures1-bit Adam,0/1 Adamand1-bit LAMBCustom communication collectiveUp to 26x communication volume savingAdditional Memory and Bandwidth OptimizationsSmart Gradient AccumulationCommunication/Computation OverlapTraining FeaturesSimplified training APIGradient ClippingAutomatic loss scaling with mixed precisionTraining OptimizersFused Adam optimizer and arbitrarytorch.optim.OptimizerMemory bandwidth optimized FP16 OptimizerLarge Batch Training with LAMB OptimizerMemory efficient Training with ZeRO OptimizerCPU-AdamTraining Agnostic CheckpointingAdvanced Parameter SearchLearning Rate Range Test1Cycle Learning Rate ScheduleSimplified Data LoaderCurriculum LearningA curriculum learning-based data pipeline that presents easier or simpler examples earlier during trainingStable and 3.3x faster GPT-2 pre-training with 8x/4x larger batch size/learning rate while maintaining token-wise convergence speedComplementary to many other DeepSpeed featuresPerformance Analysis and DebuggingMixture of Experts (MoE)Further ReadingAll DeepSpeed documentation can be found on our website:deepspeed.aiArticleDescriptionDeepSpeed FeaturesDeepSpeed featuresGetting StartedFirst steps with DeepSpeedDeepSpeed JSON ConfigurationConfiguring DeepSpeedAPI DocumentationGenerated DeepSpeed API documentationCIFAR-10 TutorialGetting started with CIFAR-10 and DeepSpeedMegatron-LM TutorialTrain GPT2 with DeepSpeed and Megatron-LMBERT Pre-training TutorialPre-train BERT with DeepSpeedLearning Rate Range Test TutorialFaster training with large learning rates1Cycle TutorialSOTA learning schedule in DeepSpeedContributingDeepSpeed welcomes your contributions! Please see ourcontributingguide for more details on formatting, testing,
etc.Contributor License AgreementThis 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, visithttps://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 ConductThis project has adopted theMicrosoft Open Source Code of
Conduct. For more information see theCode of Conduct FAQor contactopencode@microsoft.comwith any additional questions or comments.PublicationsSamyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, Yuxiong He. (2019) ZeRO: memory optimizations toward training trillion parameter models.arXiv:1910.02054andIn 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.arXiv:2010.13369andNeurIPS 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.arXiv: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.arXiv:2102.02888andICML 2021.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.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.Conglong Li, Minjia Zhang, Yuxiong He. (2021) Curriculum Learning: A Regularization Method for Efficient and Stable Billion-Scale GPT Model Pre-Training.arXiv:2108.06084.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.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 ScalearXiv:2201.05596.VideosDeepSpeed KDD 2020 TutorialOverviewZeRO + large model training17B T-NLG demoFastest BERT training + RScan tuningDeepSpeed hands on deep dive:part 1,part 2,part 3FAQMicrosoft Research WebinarRegistration 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 AzureMLCommunity TutorialsDeepSpeed: All the tricks to scale to gigantic modelsTuring-NLG, DeepSpeed and the ZeRO optimizer