Skip to content

[BREAKING][megatron] chore: deprecate vanilla mBridge and make Megatron Bridge default#6951

Open
HollowMan6 wants to merge 5 commits into
verl-project:mainfrom
HollowMan6:vanilla_mbridge
Open

[BREAKING][megatron] chore: deprecate vanilla mBridge and make Megatron Bridge default#6951
HollowMan6 wants to merge 5 commits into
verl-project:mainfrom
HollowMan6:vanilla_mbridge

Conversation

@HollowMan6

Copy link
Copy Markdown
Collaborator

What does this PR do?

Add vanilla mBridge deprecation warning and make Megatron Bridge default.

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, megatron, veomni, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data, cfg, reward, fully_async, one_step_off
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][fsdp, megatron] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request transitions the default Megatron checkpointing backend from the legacy mbridge to the official Megatron-Bridge (v0.5.0). It updates various Dockerfiles, documentation, and configuration files to set vanilla_mbridge to False by default, while raising a deprecation warning when the legacy backend is explicitly enabled. The review feedback suggests pinning the megatron-bridge dependency to ==0.5.0 in the stable SGLang and vLLM Dockerfiles to ensure build reproducibility, and recommends using FutureWarning instead of DeprecationWarning so that end-users are properly alerted to the deprecation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docker/Dockerfile.stable.sglang Outdated
Comment thread docker/Dockerfile.stable.vllm Outdated
Comment thread verl/workers/config/engine.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes Megatron-Bridge the default backend for Megatron “bridge” weight conversion/checkpoint flows, while marking the legacy mbridge backend as deprecated and updating configs/docs/CI and container images accordingly.

Changes:

  • Flip vanilla_mbridge defaults to False for Megatron configs and generated trainer config; add a deprecation warning when opting into legacy mbridge.
  • Keep MindSpeed on legacy mbridge explicitly and document the behavior in config files and docs.
  • Add megatron-bridge to the mcore extra and install it in relevant Docker images; update CI/e2e workflow env defaults.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
verl/workers/config/engine.py Change default vanilla_mbridge to False; emit a warning when legacy backend is selected; keep MindSpeed on legacy backend.
verl/trainer/config/ref/megatron_ref.yaml Update ref default for vanilla_mbridge to False.
verl/trainer/config/engine/mindspeed.yaml Explicitly set vanilla_mbridge: True for MindSpeed.
verl/trainer/config/engine/megatron.yaml Update default vanilla_mbridge to False and document deprecation.
verl/trainer/config/_generated_ppo_megatron_trainer.yaml Regenerate config to reflect new vanilla_mbridge defaults (false).
verl/models/mcore/readme.md Update integration notes to reflect Megatron-Bridge as default and mbridge as deprecated.
setup.py Add megatron-bridge alongside mbridge in the mcore extra.
docs/perf/best_practices.rst Update parameter reference to describe Megatron-Bridge as default and mbridge as deprecated.
docs/ascend_tutorial/dev_guide/model_dev/parameter_and_metrics.md Update Chinese parameter table defaults/wording to match new defaults.
docker/rocm/README.md Document Megatron-Bridge in ROCm image contents.
docker/rocm/Dockerfile.rocm Install megatron-bridge==0.5.0 in ROCm build.
docker/Dockerfile.stable.vllm Install Megatron-Bridge in stable vLLM image.
docker/Dockerfile.stable.trtllm Bump Megatron-Bridge pin to 0.5.0 in TRTLLM image.
docker/Dockerfile.stable.sglang Install Megatron-Bridge in stable SGLang image.
.github/workflows/e2e_ppo_trainer_megatron_vllm_rocm.yml Switch e2e runs to VANILLA_MBRIDGE=False / VALUE_VANILLA_MBRIDGE=False.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread verl/workers/config/engine.py
Comment thread setup.py
Comment thread docker/Dockerfile.stable.vllm Outdated
Comment thread docker/Dockerfile.stable.sglang Outdated
@HollowMan6 HollowMan6 force-pushed the vanilla_mbridge branch 2 times, most recently from 9a27291 to b71ccdf Compare July 6, 2026 21:33
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the default model-weight backend for Megatron-Core from the legacy, deprecated mbridge to the official Megatron-Bridge (version 0.5.0). It updates Dockerfiles, documentation, configuration files, and adds deprecation warnings when the legacy backend is selected. Feedback on this PR suggests specifying a minimum version constraint of >=0.5.0 for megatron-bridge in setup.py to prevent users from installing older, incompatible versions.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread setup.py
@HollowMan6

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request transitions the default model-weight backend for Megatron from the legacy mbridge to the official Megatron-Bridge (version 0.5.0). It updates Dockerfiles, documentation, configuration files, and setup.py to reflect this change, setting vanilla_mbridge to False by default while deprecating the legacy mbridge backend with a warning. The review feedback suggests two key improvements: first, the deprecation warning for vanilla_mbridge should only be triggered when use_mbridge is enabled to avoid confusing warnings; second, a minimum version constraint (>=0.5.0) for megatron-bridge should be specified in setup.py to guarantee compatibility.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread verl/workers/config/engine.py
Comment thread setup.py
@HollowMan6 HollowMan6 force-pushed the vanilla_mbridge branch 11 times, most recently from 0cf03a1 to a4e1537 Compare July 8, 2026 01:59
Signed-off-by: Hollow Man <hollowman@opensuse.org>
Signed-off-by: Hollow Man <hollowman@opensuse.org>
Signed-off-by: Hollow Man <hollowman@opensuse.org>
Signed-off-by: Hollow Man <hollowman@opensuse.org>
@wuxibin89 wuxibin89 changed the title [megatron] chore: deprecate vanilla mBridge and make Megatron Bridge default [BREAKING][megatron] chore: deprecate vanilla mBridge and make Megatron Bridge default Jul 8, 2026
Signed-off-by: Hollow Man <hollowman@opensuse.org>
@wuxibin89 wuxibin89 mentioned this pull request Jul 9, 2026
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants