distributed-training-megatron-core — Claude Code skill
A Claude skill that plans large-scale LLM training on NVIDIA Megatron-Core: picks a parallelism layout and builds the launch command.
npx claude-code-templates@latest --skill ai-research/distributed-training-megatron-coreWhat distributed-training-megatron-core does
The skill walks an agent through training runs from 2B to 462B parameters on NVIDIA GPUs. Three workflows ship with it: 3D parallelism for LLaMA-style models, mixture-of-experts setups like Mixtral, and a throughput pass that targets 47% MFU on H100. The agent maps model size and GPU count onto tensor, pipeline, context and expert parallel degrees, then writes the torchrun invocation.
For a 70B run there is a four-step checklist and a train_llama_70b.sh script with hyperparameters already filled in: 80 layers, hidden size 8192, 64 attention heads, sequence length 4096. You launch it with torchrun on one node or hand it to SLURM with sbatch across several. The MoE workflow shows how to spread 8 experts over 4 GPUs and cut memory per GPU.
Expect to install megatron-core, torch, apex and transformer-engine first — the examples will not run without them. FP8 is H100-only. Tensor parallel is best kept at 8 or below because NVLink inside a node sets the ceiling, and context parallel only earns its keep past 8K tokens.
What it helps with
- pick parallel degrees that match model size and GPU count
- build a
torchruncommand with tensor, pipeline and context parallel - spread MoE experts across GPUs to cut memory use
- turn on FP8 on H100 and push MFU past 40%
- find the largest micro-batch that still fits in memory
Example prompts for the agent
- Write a training config for LLaMA 70B on 64 GPUs
- How do I split 8 Mixtral experts across 4 GPUs?
- Pick a micro-batch size for a 70B model on H100
How to install distributed-training-megatron-core
1claude-code-templates
npx claude-code-templates@latest --skill ai-research/distributed-training-megatron-core2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill distributed-training-megatron-core -a claude-code3Manually: put the files in place
~/.claude/skills/distributed-training-megatron-core/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/distributed-training-megatron-core/
Manually: put the files in place
.agents/skills/distributed-training-megatron-core/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/distributed-training-megatron-core/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates distributed-training-megatron-core2Manually: put the files in place
.github/skills/distributed-training-megatron-core/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/ai-research/distributed-training-megatron-coreManually: put the files in place
.devin/skills/distributed-training-megatron-core/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about distributed-training-megatron-core
How do I install distributed-training-megatron-core in Claude Code?
Run npx claude-code-templates@latest --skill ai-research/distributed-training-megatron-core. Alternatively use npx skills add davila7/claude-code-templates --skill distributed-training-megatron-core -a claude-code. The skill lands at ~/.claude/skills/distributed-training-megatron-core/SKILL.md.
What does distributed-training-megatron-core do?
It guides an agent through setting up Megatron-Core training: choosing a parallelism strategy, filling in hyperparameters and launching the distributed run.
What does the skill need to work?
The megatron-core, torch, apex and transformer-engine packages. FP8 training is limited to H100 GPUs.