Megatron Bridge is a library for training Megatron-based models and converting their checkpoints between Hugging Face and Megatron formats. Model developers use it for pretraining, supervised fine-tuning, long-context work, LoRA, inference, and image-and-text workflows supported by its examples and model configurations. The catalogue entries provide agent workflows and instructions for using the library.
Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/NVIDIA-NeMo/Megatron-Bridgenpx agentmods add skills/nvidia-nemo/megatron-bridge/nemo-mbridge-mlm-bridge-trainingWrote 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.
[](https://agentmods.dev/skills/nvidia-nemo/megatron-bridge/nemo-mbridge-mlm-bridge-training)<a href="https://agentmods.dev/skills/nvidia-nemo/megatron-bridge/nemo-mbridge-mlm-bridge-training"><img src="https://agentmods.dev/badge/skills/nvidia-nemo/megatron-bridge/nemo-mbridge-mlm-bridge-training/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.
<a href="https://agentmods.dev/skills/nvidia-nemo/megatron-bridge/nemo-mbridge-mlm-bridge-training"><img src="https://agentmods.dev/badge/skills/nvidia-nemo/megatron-bridge/nemo-mbridge-mlm-bridge-training.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00044 | $0.01756 |
| Opus 5.5 | $0.00018 | $0.00702 |
| Sonnet 5.5 | $0.00009 | $0.00351 |
| Haiku 4.5 | $0.00004 | $0.00176 |
Grade C, and why
nemo-mbridge-mlm-bridge-training scanned grade C with 1 finding 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 1mo 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
5. Fresh-run cleanup: `rm -rf nemo_experiments` before the Bridge run. This is a copy
100% identical to nemo-mbridge-mlm-bridge-training — 1 line 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.
How it starts
The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.
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)
PYTHONPATH=3rdparty/Megatron-LM:$PYTHONPATH \
uv run python -m torch.distributed.run --nproc_per_node=1 \
3rdparty/Megatron-LM/pretrain_gpt.py \
--num-layers 2 --hidden-size 256 --num-attention-heads 4 \
--ffn-hidden-size 1024 --seq-length 512 --max-position-embeddings 512 \
--micro-batch-size 4 --global-batch-size 32 \
--train-iters 10 --eval-iters 2 --eval-interval 10 \
--mock-data --bf16 --use-mcore-models \
--tokenizer-type NullTokenizer --vocab-size 32000 \
--lr 3e-4 --min-lr 3e-5 --seed 1234 --log-interval 1
Bridge Correlation Run (same config, 1 GPU)
rm -rf nemo_experiments && \
uv run python -m torch.distributed.run --nproc_per_node=1 \
scripts/training/run_recipe.py \
--recipe vanilla_gpt_pretrain_config \
model.num_layers=2 model.hidden_size=256 \
model.num_attention_heads=4 model.ffn_hidden_size=1024 \
model.seq_length=512 dataset.seq_length=512 \
train.train_iters=10 train.global_batch_size=32 train.micro_batch_size=4 \
validation.eval_interval=10 validation.eval_iters=2 \
optimizer.lr=3e-4 optimizer.min_lr=3e-5 \
scheduler.lr_warmup_iters=1 scheduler.lr_decay_iters=10 \
rng.seed=1234 logger.log_interval=1
What ships with it
5 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.
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.
- 1mo ago Changed · -1 lines 68ba03543675
- 3mo ago First seen · 179 lines · 44 tokens per session scan C 7eae976eb49a
nemo-mbridge-mlm-bridge-training is a skill published in the GitHub repository NVIDIA-NeMo/Megatron-Bridge (1,012 stars, last pushed today), licensed Apache-2.0. It adds 44 tokens to every session and 1,756 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). It is 100% identical to nemo-mbridge-mlm-bridge-training, differing in 1 line, and is treated as a copy.
nemo-mbridge-mlm-bridge-training compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| nemo-mbridge-mlm-bridge-trainingNVIDIA-NeMo/Megatron-Bridge | Skill | 1.0k | today | Apache-2.0 | C | 44 | Claude Code |
| fs-notebook-tabsnexu-io/open-design | Skill | 110k | today | Apache-2.0 | A | 47 | Claude Code, Codex |
| model-architecture-litgptdavila7/claude-code-templates | Skill | 34k | today | MIT | A | 75 | Claude Code, Codex |
| model-architecture-nanogptdavila7/claude-code-templates | Skill | 34k | today | MIT | A | 69 | Claude Code, Codex |
| model-architecture-rwkvdavila7/claude-code-templates | Skill | 34k | today | MIT | A | 74 | Claude Code, Codex |
| kaggle-learnerGalaxy-Dawn/claude-scholar | Skill | 6.1k | 3d ago | MIT | A | 69 | Claude Code |
| data-science-engineering-foundationmicrosoft/hve-core | Skill | 1.6k | 4d ago | MIT | A | 43 | Claude Code |