Megatron-LM

Train and deploy large transformer models with tensor, pipeline, and expert parallelism.

4|Updated May 6, 2026
One-click install
npx skills add https://github.com/jstzwj/ai-infra-plugins --skill megatron-lm-jstzwj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Megatron-LM
Source: https://github.com/jstzwj/ai-infra-plugins/tree/main/plugins/Megatron-LM/skills/Megatron-LM
Command: npx skills add https://github.com/jstzwj/ai-infra-plugins --skill megatron-lm-jstzwj

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, transformer-engine, nvidia-apex, nccl, cuda, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables the training, fine-tuning, and inference of large-scale transformer models such as GPT and MoE architectures efficiently across multiple GPUs.

Core Features & Use Cases

  • High-Scale Model Training: Supports models up to 462B parameters using tensor, pipeline, and expert parallelism.
  • Flexible Architecture Composition: Facilitates custom transformer configurations, modular layer specs, and heterogeneous model structures.
  • Use Case: Deploy a 175B GPT model with 8-way tensor parallelism and 4-way pipeline parallelism for training on a multi-node GPU cluster, achieving high throughput and MFU.

Quick Start

Add the Megatron-LM plugin to your environment, prepare a supported GPU cluster, and run the pretraining scripts to initialize the model and start training.

Frequently Asked Questions about Megatron-LM

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scale GPT model training across multiple GPUs?

To scale GPT model training across multiple GPUs, you can use tensor, pipeline, and expert parallelism strategies. This approach supports training large transformer models up to 462B parameters efficiently on multi-node GPU clusters.

What is the best way to train large Mixture of Experts models?

Training large Mixture of Experts (MoE) models is best handled using expert parallelism combined with custom transformer configurations. This allows modular layer specs and heterogeneous model structures for efficient pretraining and inference.

Do I need a specific GPU cluster to run massively scalable transformer pretraining?

Yes, massively scalable transformer pretraining requires a supported multi-node GPU cluster with dependencies like CUDA, NCCL, and NVIDIA Apex. You also need PyTorch and Transformer-Engine installed in your environment.

How does pipeline and tensor parallelism work for 175B parameter models?

Pipeline and tensor parallelism for 175B parameter models distribute network layers and tensor operations across multiple GPUs. For example, an 8-way tensor parallel and 4-way pipeline parallel configuration achieves high training throughput and high Model FLOPs Utilization.

Can I customize transformer architectures for heterogeneous model structures?

Yes, you can customize transformer architectures for heterogeneous model structures using modular layer specs. This flexible architecture composition supports custom transformer configurations tailored for specific advanced AI research and production workflows.

What are the limitations when configuring multi-node inference for large transformers?

Limitations when configuring multi-node inference for large transformers include strict dependency requirements on CUDA, NCCL, and NVIDIA Apex. You must ensure your GPU cluster hardware fully aligns with these specific parallelism and transformer-engine dependencies.