mlm-bridge-training

Correlate Megatron-LM and Megatron Bridge training runs by matching configs and diagnosing loss divergence.

Updated May 23, 2026
One-click install
npx skills add https://github.com/yo-steven/skills-exploration-20260522 --skill mlm-bridge-training-yo-steven
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mlm-bridge-training
Source: https://github.com/yo-steven/skills-exploration-20260522/tree/main/skills/Megatron-Bridge/mlm-bridge-training
Command: npx skills add https://github.com/yo-steven/skills-exploration-20260522 --skill mlm-bridge-training-yo-steven

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

You need a reliable way to run Megatron-LM (MLM) and Megatron Bridge training side by side and understand why their loss curves do or do not match across commits, model configs, and distributed settings.

Core Features & Use Cases

  • MLM vs Bridge correlation testing: Run the same underlying GPT pretraining setup using a minimal vanilla_gpt_pretrain_config and compare lm loss iteration-by-iteration (expecting agreement within BF16 rounding).
  • MLM-to-Bridge argument translation: Use the documented translation tables and recipes to map common MLM CLI intent into Bridge overrides/config fields.
  • Multi-GPU training examples: Provide TP/sequence-parallel style examples for both MLM and Bridge to reproduce distributed behavior and scaling artifacts.

Quick Start

Run a correlation test by launching MLM with the pretrain_gpt.py command shown in this Skill, then launch Bridge using the same parameters via scripts/training/run_recipe.py --recipe vanilla_gpt_pretrain_config, and compare the lm loss values in the logs.

Frequently Asked Questions about mlm-bridge-training

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I match Megatron-LM and Megatron Bridge loss curves during distributed training?

Match Megatron-LM and Megatron Bridge loss curves by running the same GPT pretraining setup in both frameworks, then comparing iteration-level lm loss logs to verify agreement within BF16 rounding.

What causes loss divergence between Megatron-LM and Megatron Bridge training runs?

Loss divergence between Megatron-LM and Megatron Bridge training runs is typically caused by mismatched distributed settings, incorrect CLI parameter mapping, or inconsistent scheduler settings and checkpoint cleanup.

How do I map Megatron-LM CLI arguments into Megatron Bridge overrides?

Map Megatron-LM CLI arguments into Megatron Bridge overrides by using documented translation tables and YAML recipe workflows to translate common MLM intent into the correct Bridge config fields.

Can I reproduce multi-GPU tensor parallel and sequence parallel behavior across MLM and Bridge?

You can reproduce multi-GPU tensor parallel and sequence parallel behavior by running the provided TP and SP examples in both MLM and Bridge to validate distributed scaling artifacts and loss correlation.

Do I need a YAML recipe workflow to correlate Megatron-LM and Bridge training runs?

You need a YAML-described recipe workflow to launch Bridge training via run_recipe.py and ensure correct parameter mapping against the Megatron-LM pretrain_gpt.py command for accurate loss correlation.

What guardrails prevent loss mismatch when comparing Megatron-LM and Bridge pretraining?

Guardrails to prevent loss mismatch include enforcing fresh checkpoint cleanup, maintaining consistent scheduler settings, and applying correct parameter mapping across both training configurations.