Skip to main content
skill

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.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --skill ai-research/distributed-training-megatron-core
Open on GitHub

What 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 torchrun command 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-core

2Skills CLI (Vercel)

npx skills add davila7/claude-code-templates --skill distributed-training-megatron-core -a claude-code

3Manually: put the files in place

~/.claude/skills/distributed-training-megatron-core/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/distributed-training-megatron-core/

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.

Similar skills

All skills for AI and ML →

From the same set361

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor