training-llms-megatron

Configure Megatron-Core distributed training for large language models.

Updated May 2, 2026
One-click install
npx skills add https://github.com/qcmuu/AI-Research-Skills --skill training-llms-megatron-qcmuu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: training-llms-megatron
Source: https://github.com/qcmuu/AI-Research-Skills/tree/main/08-distributed-training/megatron-core
Command: npx skills add https://github.com/qcmuu/AI-Research-Skills --skill training-llms-megatron-qcmuu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the challenge of training large language models at scale with high GPU efficiency by selecting and configuring Megatron-Core’s parallelism strategies.

Core Features & Use Cases

  • Large-Scale LLM Training: Guides setup and execution for training models from ~2B to hundreds of billions of parameters using Megatron-Core.
  • Advanced Parallelism Orchestration: Helps you choose and tune tensor, pipeline, sequence, context, and expert (MoE) parallelism to match your GPU topology and target throughput.
  • Performance & Stability Playbooks: Provides actionable troubleshooting for low MFU, OOM, divergence, and throughput regressions, plus benchmarks and production-oriented configuration patterns.
  • Use Case: If you are training a LLaMA-style 70B model on H100 with tight GPU memory limits, use this Skill to configure TP/PP/CP and FP8-related optimizations to sustain high Model FLOP Utilization and avoid out-of-memory failures.

Quick Start

Use the megatron-core skill to plan a distributed training configuration for a 70B LLaMA-style model and then run torchrun on your multi-GPU setup.

Frequently Asked Questions about training-llms-megatron

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

FAQPage Schema
How do I configure distributed parallelism for large language model training?

Configure distributed parallelism for large language model training by aligning tensor, pipeline, sequence, context, and expert parallelism degrees with your GPU topology. Matching these parallelism strategies to your hardware ensures high GPU utilization and stable convergence during pretraining or fine-tuning.

What is the best way to train a 70B LLM on H100 GPUs without running out of memory?

The best way to train a 70B LLM on H100 GPUs without out-of-memory failures is configuring tensor, pipeline, and context parallelism alongside FP8 optimizations. This approach sustains high Model FLOP Utilization while fitting large models within tight GPU memory limits.

How do I use FP8 and Flash-Attention to improve LLM training throughput?

Use FP8 and Flash-Attention to improve LLM training throughput by integrating transformer-engine and setting the corresponding batch and micro-batch parameters. These optimizations target sustained Model FLOP Utilization and stable convergence during large-scale distributed training.

Can I use mixture-of-experts parallelism across multiple nodes for LLM pretraining?

Yes, you can use mixture-of-experts parallelism across multiple nodes for LLM pretraining. This distributed parallelism strategy routes expert computations across your hardware topology, enabling scalable training for models up to hundreds of billions of parameters.

Why is my LLM training throughput regressing and how do I troubleshoot low MFU?

LLM training throughput regresses and low MFU occurs when parallelism degrees mismatch your hardware topology or batch parameters are suboptimal. Troubleshoot by realigning tensor and pipeline parallelism with NVLink or InfiniBand topology and adjusting micro-batch sizes.