Repository navigation
Conversation
…0.18.x Bridge only worked against the exact Megatron-Core commit pinned in 3rdparty/Megatron-LM. On the released 0.18.x line, 64 of the 806 megatron.bridge modules failed to import because megatron.training.models.gpt (GPTModelConfig / GPTModelBuilder / mtp_block_spec) was added upstream after 0.18.x was cut, which broke every checkpoint save/load path — including AutoBridge.import_ckpt and export_ckpt. Declare the supported window as a rule relative to the pin (previous minor release N-1 through the next minor, i.e. >=0.18.0,<0.20 for the 0.19.0 pin), bound the megatron-core dependency to it so installing Bridge no longer replaces a compatible preinstalled Megatron-Core, and fall back to a vendored copy of megatron/training/models/gpt.py when the upstream module is absent. Verified on 8xH100 against megatron-core 0.18.0 installed from PyPI with the Qwen3-30B-A3B model card flow: HF -> Megatron load and generation, AutoBridge.import_ckpt, generation from the Megatron checkpoint with EP=8, and export_ckpt back to HF. All 806 bridge modules import on both 0.18.0 and the 0.19.0 pin. Refs #5148 Signed-off-by: Yu Yao <yuya@nvidia.com>
6 tasks
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test 84c98ed |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test 4dd6ae2 |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test 11605ee |
Contributor
Author
|
/ok to test 5a21fa5 |
Signed-off-by: Yu Yao <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test 386a429 |
Signed-off-by: Yu Yao <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test 2f4b050 |
Contributor
Author
|
/ok to test 74cb7d3 |
Contributor
Author
|
/ok to test 2510618 |
Contributor
|
Automatic Claude reviews have been retired. To request a pull-request review, post a comment containing: Add |
Contributor
Author
|
/ok to test 7f9e9c6 |
Contributor
Contributor
Author
|
/ok to test 9dff99c |
Contributor
Author
|
/ok to test 0f6afa6 |
Signed-off-by: Yu Yao <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test 76c54d1 |
Contributor
Author
|
/ok to test a4ba423 |
Contributor
Author
|
/ok to test 5cee906 |
Contributor
Author
|
/ok to test 5451d2e |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes a pip-installed Megatron Bridge work against the released Megatron-Core 0.18.x line, not just the exact source pin. This is a concrete step toward #5148.
Current main pins Megatron-Core commit
24bad8e677(0.20.0), while the public PyPI index currently ends at0.18.2: there is no public0.19.xor0.20.xpackage to install. The supported pip range is therefore declared explicitly as>=0.18.0,<0.21and tested against both the current source pin and the actual public 0.18.x line.On 0.18.x,
megatron.training.models.gptdoes not exist. Without this change, that missing module breaksmegatron.bridge.trainingand every checkpoint import/export path that depends on it.How
megatron.bridge.compat.mcore_versiondeclares the public compatibility floor (0.18.0), current source pin (0.20.0), and exclusive next-minor ceiling (0.21). Tests keep the source gitlink, code declaration, and package metadata aligned.megatron.bridge.compat.mcore_gptis the stable facade for GPT builder/config symbols and serialized targets. It prefers the upstream implementation when present and uses the vendored fallback only when the whole upstream module is absent; unrelated transitive import errors still propagate.megatron-core[dev,mlm]>=0.18.0,<0.21.No file under
3rdparty/Megatron-LMis modified, no dependency is added, and no public conversion API signature changes.Validation
Standard project container with
uv:0.20.0)0.18.00.18.2megatron-core[dev,mlm]<0.21,>=0.18.0The focused matrix covers support boundaries, facade/fallback selection, upstream API parity, old-builder argument projection, stable and legacy config targets, checkpoint load/save, CPU conversion launcher paths, and a tiny exact HF→MCore→HF tied/untied-logit roundtrip.
Authoritative Qwen3-30B-A3B verification card, on one 8-GPU node with exact public MCore
0.18.0and model revisionad44e777bcd18fa416d9da3bd8f70d33ebb85d39:" Paris") on both paths; cosine similarity was0.999317(card gate>0.99), with the card-recorded max/mean logit diagnostics0.593750/0.130064.Qwen3MoeForCausalLM, andnorm_topk_probremainedtrue.uv run pre-commit run --all-filespassed before every new DCO-signed merge/conflict-resolution commit.Main integration
Latest main was merged normally into this branch without rebasing or force-pushing. Conflicts were resolved by retaining current main's optional ModelOpt behavior and tests while routing its new GPT model-config consumer through the compatibility facade.
Refs #5148