Megatron-LM
FreeOngoing research training transformer models at scale.
About Megatron-LM
Megatron-LM is an open-source, GPU-optimized library from NVIDIA for training large transformer models at scale. It includes two components: Megatron-LM (a reference example with pre-configured training scripts for rapid experimentation) and Megatron Core (a composable library providing building blocks for custom training frameworks). It supports advanced parallelism strategies (tensor, pipeline, data, expert, and context parallelism), mixed precision training (FP16, BF16, FP8, FP4), and a variety of model architectures. The Megatron Bridge enables bidirectional checkpoint conversion between Hugging Face and Megatron. The library is designed for research teams, ML engineers, and framework developers building and scaling transformer models.
Key Features
Pros & Cons
- GPU-optimized with state-of-the-art parallelism for scaling to thousands of GPUs
- Comprehensive support for multiple parallelism strategies in a single library
- Actively maintained by NVIDIA with regular updates and community contributions
- Open source with permissive license and extensive documentation
- Includes reference training scripts and examples for fast onboarding
- Building from source can require significant memory; may need to limit parallel compilation jobs
- Steep learning curve for configuring advanced parallelism strategies
- Primarily focused on GPU training; not designed for CPU inference or deployment