training-llms-megatron

training-llms-megatron is a skill for Claude Code from Orchestra-Research/AI-Research-SKILLs. It costs 82 tokens per session (2,874 once invoked), scanned A, a copy of training-llms-megatron, MIT.

A framework for training very large language models across many GPUs. It divides model work in several ways so models that do not fit on one device can be trained across a cluster.

In plain words
What is it for?
Use it to train LLaMA-style and other large language models from about 2 billion to 462 billion parameters. It is aimed at multi-GPU setups that need different ways to split computation and model data.
Why use it?
It provides the distributed-training machinery needed for models with billions of parameters. This avoids having to design tensor, pipeline, sequence, context, and expert parallelism yourself.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the distributed-training plugin — 6 skills shipped together

Good fit Use it to train LLaMA-style and other large language models from about 2 billion to 462 billion parameters. It is aimed at multi-GPU setups that need different ways to split computation and model data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/orchestra-research/ai-research-skills/megatron-core
About the project

AI Research Skills Library is a collection of reusable instructions that guide AI agents through research and machine-learning engineering tasks, from finding ideas and writing papers to training, evaluation, and deployment. It is for configuring agents such as Claude Code, Codex, and Gemini to perform research workflows.

Orchestra-Research/AI-Research-SKILLs · 12,567 stars · on GitHub · orchestra-research.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Orchestra-Research/AI-Research-SKILLs --skill megatron-core
Clone the repo
git clone --depth 1 https://github.com/Orchestra-Research/AI-Research-SKILLs

Made for: Claude Code.

Or install distributed-training, the plugin that ships this one along with the rest of its 6 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for training-llms-megatron

README.md
[![agentmods](https://agentmods.dev/badge/skills/orchestra-research/ai-research-skills/megatron-core/github.svg)](https://agentmods.dev/skills/orchestra-research/ai-research-skills/megatron-core)
Your own site
<a href="https://agentmods.dev/skills/orchestra-research/ai-research-skills/megatron-core"><img src="https://agentmods.dev/badge/skills/orchestra-research/ai-research-skills/megatron-core/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for training-llms-megatron

Your own site · 80×15
<a href="https://agentmods.dev/skills/orchestra-research/ai-research-skills/megatron-core"><img src="https://agentmods.dev/badge/skills/orchestra-research/ai-research-skills/megatron-core.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,874 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00082 $0.02874
Opus 5 $0.00041 $0.01437
Sonnet 5 $0.00016 $0.00575
Haiku 4.5 $0.00008 $0.00287

Measured 12d ago against content hash 6e69257341b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

training-llms-megatron scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to training-llms-megatron — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

08-distributed-training/megatron-core/SKILL.md · 367 lines

How it starts

The opening of the file, as written. The whole thing — 367 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Megatron-Core - Large-Scale LLM Training

Quick start

Megatron-Core trains LLMs from 2B to 462B parameters with up to 47% Model FLOP Utilization on H100 GPUs through advanced parallelism strategies.

Installation:

# Docker (recommended)
docker run --gpus all -it --rm nvcr.io/nvidia/pytorch:25.04-py3

# Or pip
pip install megatron-core

Simple distributed training:

# Train with 2 GPUs using data parallelism
torchrun --nproc_per_node=2 examples/run_simple_mcore_train_loop.py

# Or LLaMA-3 8B training
./examples/llama/train_llama3_8b_fp8.sh

Common workflows

Workflow 1: Train LLaMA-style model with 3D parallelism

Copy this checklist:

LLaMA Training Setup:
- [ ] Step 1: Choose parallelism configuration
- [ ] Step 2: Configure training hyperparameters
- [ ] Step 3: Launch distributed training
- [ ] Step 4: Monitor performance metrics

Step 1: Choose parallelism configuration

Model size determines parallelism strategy:

Model Size GPUs Tensor Parallel Pipeline Parallel Data Parallel Context Parallel
7B 8 1 1 8 1
13B 8 2 1 4 1
70B 64 4 4 4 1
405B 128 8 8 2 2

Step 2: Configure training hyperparameters

#!/bin/bash
# train_llama_70b.sh

GPUS_PER_NODE=8
NNODES=8  # 64 GPUs total
TP=4      # Tensor parallel
PP=4      # Pipeline parallel
CP=1      # Context parallel

# LLaMA 70B configuration
MODEL_SIZE=70  # Billion parameters
HIDDEN_SIZE=8192
NUM_LAYERS=80
NUM_HEADS=64
SEQ_LENGTH=4096

# Training hyperparameters
MICRO_BATCH=1
GLOBAL_BATCH=1024
LR=3e-4

torchrun \
  --nproc_per_node=$GPUS_PER_NODE \
  --nnodes=$NNODES \
  pretrain_gpt.py \
  --tensor-model-parallel-size $TP \
  --pipeline-model-parallel-size $PP \
  --context-parallel-size $CP \
  --sequence-parallel \
  --num-layers $NUM_LAYERS \
  --hidden-size $HIDDEN_SIZE \
  --num-attention-heads $NUM_HEADS \
  --seq-length $SEQ_LENGTH \
  --max-position-embeddings $SEQ_LENGTH \
  --micro-batch-size $MICRO_BATCH \
  --global-batch-size $GLOBAL_BATCH \
  --lr $LR \
  --train-iters 100000 \
  --lr-decay-style cosine \
  --lr-warmup-iters 2000 \
  --weight-decay 0.1 \
  --clip-grad 1.0 \
  --bf16 \
  --use-mcore-models \
  --transformer-impl transformer_engine \
  --data-path /path/to/data \
  --vocab-file /path/to/vocab.json \
  --merge-file /path/to/merges.txt

Read the full file on GitHub · 367 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 367 lines · 82 tokens per session scan A 6e69257341b9

Subscribe to this mod's changes

training-llms-megatron is a skill published in the GitHub repository Orchestra-Research/AI-Research-SKILLs (12,567 stars, last pushed 2mo ago), licensed MIT. It adds 82 tokens to every session and 2,874 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to training-llms-megatron, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

training-llms-megatron

Trains large language models (2B-462B parameters) using NVIDIA Megatron-Core with advanced parallelism strategies. Use when training models >1B parameters, need maximum GPU efficiency (47% MFU on H100), or require tensor/pipeline/sequence/context/expert parallelism. Production-ready framework used for Nemotron, LLaMA…

ihatesea69/HieuNghi-AI-Skills · 82 tokens

training-llms-megatron

Trains large language models (2B-462B parameters) using NVIDIA Megatron-Core with advanced parallelism strategies. Use when training models >1B parameters, need maximum GPU efficiency (47% MFU on H100), or require tensor/pipeline/sequence/context/expert parallelism. Production-ready framework used for Nemotron, LLaMA…

davila7/claude-code-templates · 82 tokens

training-llms-megatron

Trains large language models (2B-462B parameters) using NVIDIA Megatron-Core with advanced parallelism strategies. Use when training models >1B parameters, need maximum GPU efficiency (47% MFU on H100), or require tensor/pipeline/sequence/context/expert parallelism. Production-ready framework used for Nemotron, LLaMA…

OpenLAIR/dr-claw · 82 tokens

training-llms-megatron

Trains large language models (2B-462B parameters) using NVIDIA Megatron-Core with advanced parallelism strategies. Use when training models >1B parameters, need maximum GPU efficiency (47% MFU on H100), or require tensor/pipeline/sequence/context/expert parallelism. Production-ready framework used for Nemotron, LLaMA…

liortesta/ClawdAgent · 82 tokens

training-llms-megatron

Trains large language models (2B-462B parameters) using NVIDIA Megatron-Core with advanced parallelism strategies. Use when training models >1B parameters, need maximum GPU efficiency (47% MFU on H100), or require tensor/pipeline/sequence/context/expert parallelism. Production-ready framework used for Nemotron, LLaMA…

OpenLAIR/dr-claw-plugin-cc · 82 tokens

deepspeed

Expert guidance for distributed training with DeepSpeed - ZeRO optimization stages, pipeline parallelism, FP16/BF16/FP8, 1-bit Adam, sparse attention.

davila7/claude-code-templates · 38 tokens