Skip to content

PoR: align Megatron-LM and Megatron-Bridge checkpoints #4595

Closed

Description

@cuichenx

Summary

Track checkpoint alignment between Megatron-LM (MLM) and Megatron-Bridge. The goal is for each project to load and resume from checkpoints produced by the other without unifying their training loops.

Both projects already use the torch distributed checkpoint format for sharded model weights. The remaining work is to align configuration metadata, mutable training state, tokenizer assets, and compatibility behavior.

Active scope

  • Save Bridge-compatible run_config.yaml metadata from MLM checkpoints.
  • Translate checkpoint configuration between Bridge ConfigContainer fields and MLM argparse.Namespace fields, including explicit handling for differently named settings such as RoPE and YARN options.
  • Align train_state.pt contents for iteration, consumed samples, and other mutable resume state.
  • Define the required tokenizer assets and loading behavior.
  • Preserve legacy MLM checkpoint loading.
  • Add bidirectional interoperability tests:
    • MLM save -> Bridge load and resume.
    • Bridge save -> MLM load and resume.
    • Legacy MLM checkpoint fallback.

Acceptance criteria

  • Model weights load successfully in both directions.
  • Configuration and mutable training state are restored without silent defaults or dropped fields.
  • A short resumed run advances from the expected iteration and consumed-sample state in both frameworks.
  • Legacy MLM checkpoints remain supported.

Out of scope

  • Unifying the MLM and Bridge training loops.
  • Replacing both implementations with shared save_checkpoint() or load_checkpoint() APIs.
  • Broad removal of MLM global args or training-loop global state.

Background

Earlier work upstreamed shared builders and removed corresponding Bridge duplication: NVIDIA/Megatron-LM#4550, NVIDIA/Megatron-LM#4741, and #3988. Remaining general training refactors are tracked separately and are not the active focus of this issue.

Tracking

Activity

  1. added
    featureNew capabilities, enhancements, or enablement work
    area:trainingTraining loop, callbacks, and runtime integration
    trackingTracking issue for an ongoing project with smaller steps
    mlm-syncRequires API/behavior sync with upstream Megatron-LM changes
    PoRPlan of record item for roadmap and release tracking
    on Jun 30, 2026
  2. yaoyu-33 commented on Jun 30, 2026

    @yaoyu-33
    Contributor

    Training Loop in MB will not be upstreamed; it's very different from MLM training loop.

    Need to resolve MB vs. MCore:

    1. Rope and Yarn Configs.

    Will MLM/MB Checkpoint be fully compatible with each other?

    1. Save yaml file in the checkpoint should serve the purpose.
  3. added
    area:ckptCheckpoint conversion, loading, export, and save paths
    on Aug 24, 2026
  4. changed the title [-][tracking] Training loop upstreaming from Megatron-Bridge to Megatron Core[/-] [+]PoR: align Megatron-LM and Megatron-Bridge checkpoints[/+] on Aug 24, 2026
  5. removed
    area:trainingTraining loop, callbacks, and runtime integration
    on Aug 24, 2026
  6. cuichenx commented on Sep 21, 2026

    @cuichenx
    ContributorAuthor

    Training loop will be upstreamed. Closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

PoRPlan of record item for roadmap and release trackingarea:ckptCheckpoint conversion, loading, export, and save pathsfeatureNew capabilities, enhancements, or enablement workmlm-syncRequires API/behavior sync with upstream Megatron-LM changestrackingTracking issue for an ongoing project with smaller steps

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions