nvidia-nemo/megatron-bridge/nemo-mbridge-mlm-bridge-training
Claude Code and agent skill by nvidia-nemo/megatron-bridge
- community
Checking that the SKILL.md file is still in the repository.
Run Megatron-LM (MLM) and Megatron Bridge training with mock or real data. Covers correlation testing, available recipes, and multi-GPU examples.
Install
npx vskill@latest install nvidia-nemo/megatron-bridge/nemo-mbridge-mlm-bridge-trainingSKILL.md
The same SKILL.md was published earlier as nvidia/skills/nemo-mbridge-mlm-bridge-training.
MLM vs Bridge Training
For how they differ, the arg mapping tables, gotchas, and translation script, see:
- @docs/megatron-lm-to-megatron-bridge.md
First Answer Checklist
For MLM-vs-Bridge correlation questions, always name these items up front:
- Bridge recipe:
vanilla_gpt_pretrain_config. - Bridge entry point:
scripts/training/run_recipe.py. - MLM entry point:
3rdparty/Megatron-LM/pretrain_gpt.py. - Launch wrapper for both:
uv run python -m torch.distributed.run. - Fresh-run cleanup:
rm -rf nemo_experimentsbefore the Bridge run.
Also state that MLM needs PYTHONPATH=3rdparty/Megatron-LM:$PYTHONPATH, matched Bridge and MLM losses should agree within BF16 rounding, and files under 3rdparty/Megatron-LM/ should not be modified from this repo.
Correlation Testing
Use vanilla_gpt_pretrain_config for loss-correlation testing. This recipe uses bare GPTModelProvider defaults (LayerNorm, GeLU, learned_absolute position embeddings, vocab_size inherited from tokenizer) — matching MLM pretrain_gpt.py defaults with no args.
MLM Correlation Run (2L/256H, 1 GPU)
Bridge Correlation Run (same config, 1 GPU)
Verification
With matched parameters the LM losses should be nearly identical at each iteration. Compare lm loss values from both logs — they should agree to within BF16 rounding.
Multi-GPU Examples
MLM 2-GPU with TP=2
Bridge 2-GPU with TP=2
Available Recipes
Common recipes (use with --recipe):
vanilla_gpt_pretrain_config— Minimal GPT (bare GPTModelProvider defaults,
ideal for correlation testing and custom configs)
llama32_1b_pretrain_config— Llama 3.2 1B (16L, 2048H, GBS=512, seq=8192)llama3_8b_pretrain_config— Llama 3 8Bqwen3_8b_pretrain_config— Qwen3 8B
SFT/PEFT variants use _sft_config / _peft_config suffix.
Megatron-Core Submodule
For what the submodule is and why two versions exist, see @docs/megatron-lm-to-megatron-bridge.md.
Check current version
Switch to dev for testing newer MCore features
Switch back to main
After pulling latest main
When you pull the latest Bridge main branch, the submodule pointer may have been updated. Re-sync the submodule:
Pitfalls
- Always `rm -rf nemo_experiments` before a fresh correlation run. Bridge
auto-resumes from stale checkpoints silently.
- `uv run` required: Always use
uv run python -m torch.distributed.run
(not bare torchrun or python).
- MLM PYTHONPATH: Must include
3rdparty/Megatron-LMsogpt_builders.py
is importable.
- Scheduler overrides: When overriding
train.train_itersto a small
value, also set scheduler.lr_warmup_iters and scheduler.lr_decay_iters or you get an assertion error.
- Use `dataset.seq_length` in CLI overrides for both pretraining and fine-tuning datasets.
- MoE OOM: Large MoE models require full activation recomputation and
typically multi-node EP. TP does NOT reduce per-GPU expert memory.
- `uv sync --locked` fails after switching to dev: The lockfile is generated
against the main MCore commit. Use uv sync (without --locked) when on dev.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/nemo-mbridge-mlm-bridge-training/SKILL.md
Popularity
- Repository stars
- 775
- Repository forks
- 401
- 7-day trend score
- 33
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nvidia-nemo/megatron-bridge/nemo-mbridge-mlm-bridge-training)