AIAny
AI Train2019
Icon for item

Megatron-LM

Trains transformer models from 2B to 462B parameters across thousands of GPUs by combining tensor, pipeline, context, and expert parallelism. Ships composable building blocks (Megatron Core) plus reference scripts, with FP8/FP4 and ~47% MFU on H100s.

Introduction

Before Megatron-LM, scaling a transformer past a single GPU's memory meant hand-rolling the math of splitting attention and MLP layers across devices. Its real contribution was packaging that splitting into a few lines of code change, turning model parallelism from a research stunt into a reusable primitive that the rest of the field now builds on.

Key Capabilities
  • Stacks five parallelism axes — tensor, pipeline, data, context, and expert — so the same codebase trains anything from a 2B model on a few cards to a 462B model on thousands of GPUs.
  • Hits roughly 47% Model FLOP Utilization on H100 clusters and demonstrates superlinear scaling past 6,000 GPUs, which is the difference between a training run costing weeks versus months.
  • Splits into two layers: Megatron Core gives composable building blocks for teams writing their own framework, while Megatron-LM ships opinionated reference scripts for those who just want to train.
  • Adds the production glue large runs actually need — FP8/FP4 mixed precision, activation checkpointing, distributed optimizers, and fault-tolerant distributed checkpointing with automatic restart.
Who It's For

Great fit if you are pre-training or heavily fine-tuning models too large for a single node and want battle-tested parallelism rather than reinventing it; NVIDIA itself and most large-model labs lean on these kernels. Look elsewhere if you are working at the scale of one or two GPUs, fine-tuning with LoRA, or want a high-level trainer — the abstractions and NVIDIA-GPU assumptions are overhead you will not recoup.

Information

Categories

More Items

GitHub
AI Train2019

Train and experiment with multi-billion to trillion-parameter transformer models on large GPU clusters using GPU-optimized building blocks and reference training scripts; offers advanced parallelism and mixed-precision support for research teams and ML engineers.

GitHub
AI Train2026

Provides a one-command CLI to fine-tune and post-train LLMs, with layer streaming that lets an 8B model be fine-tuned on a 4 GB laptop GPU. Auto-configures quantization, LoRA adapters, batching and evaluation gates, and supports export and serving workflows.

GitHub
AI Train2025

A PyTorch DTensor-native SPMD library for training and fine-tuning LLMs, VLMs, diffusion and retrieval models. Integrates with Hugging Face for day-0 model support, provides YAML-driven recipes, DTensor/FSDP2 parallelism and NVIDIA-optimized kernels (Transformer Engine, DeepEP, FlexAttn).