SuperAPIAI Directory

Megatron-DeepSpeed

github.com · AI developer platforms

DeepSpeed version of NVIDIA's Megatron-LM that adds additional support for several features such as MoE model training, Curriculum Learning, 3D Parallelism, and others.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

Megatron-DeepSpeed is a DeepSpeed version developed by Microsoft based on a fork of NVIDIA Megatron-LM, used for continued research and training of large-scale Transformer language models. It inherits Megatron's efficient model parallelism (tensor parallelism, sequence parallelism, pipeline parallelism) and multi-node mixed-precision pretraining capabilities, and additionally integrates multiple DeepSpeed technologies.

Main capabilities and features:

  • Supports MoE (Mixture of Experts) model training, Curriculum Learning, 3D parallelism, and other features.
  • Can train Transformer architectures such as BERT, GPT, and T5, supporting models ranging from 1 billion to 1 trillion parameters.
  • Uses the NVIDIA Selene supercomputer for scalability research; the largest model uses 3072 A100 GPUs, achieving MFU 56.3% and HFU 57.0% on a trillion-parameter model.
  • The examples_deepspeed/ directory contains example scripts for DeepSpeed integration features.

Usage:

  • The NGC PyTorch container and DGX nodes are recommended. The latest pytorch, cuda, nccl, and NVIDIA APEX can also be used. Data preprocessing requires NLTK.
  • Provides pretrained BERT-345M and GPT-345M checkpoints, which can be used to evaluate or fine-tune downstream tasks.
  • Provides auxiliary scripts to download checkpoints and vocabularies: bash dataset/download_ckpt.sh, bash dataset/download_vocab.sh, then you can run bash examples/generate_text.sh to generate text examples.
  • Typical workflow: data preprocessing (convert loose json to mmap format), fine-tuning (optional for zero-shot tasks), downstream task evaluation, or text generation.
  • Data preprocessing uses preprocess_data.py, supporting BERT, GPT, and T5. Example scripts include examples/pretrain_bert.sh, examples/pretrain_gpt.sh, examples/pretrain_t5.sh, and the corresponding distributed versions examples/pretrain_{bert,gpt,t5}_distributed.sh.
  • Distributed training uses the PyTorch distributed launcher (torchrun); multi-node training is implemented by setting environment variables, and the nccl backend is used by default.

Applicable scenarios:

  • Research on large-scale language model pretraining and fine-tuning.
  • Scenarios requiring advanced training features such as MoE, Curriculum Learning, and 3D parallelism.
  • Running on infrastructure such as Azure, AzureML, or HPC clusters.

Limitations:

  • In July 2023, 1100+ commits were synchronized with upstream, and there may be untested bugs.
  • The original Megatron-LM README examples do not include DeepSpeed integration, and some may not work in this repository. It is recommended to use the tested scripts in the examples_deepspeed/ directory.
  • Data preprocessing requires NLTK; training, evaluation, or downstream tasks do not.
  • For specific installation commands, dependency versions, configuration details, etc., please refer to the official repository documentation.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools