-
Notifications
You must be signed in to change notification settings - Fork 137
add nemo_bridge #1050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chai-xiaonan
wants to merge
7
commits into
flagos-ai:main
Choose a base branch
from
chai-xiaonan:add_nemo_bridge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
add nemo_bridge #1050
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d82146d
add nemo_bridge
chai-xiaonan a358436
Merge branch 'main' into add_nemo_bridge
chai-xiaonan 90c2ed0
Reconstruct the code, and some functions use pip megatron-bridge
chai-xiaonan 224f8e1
Merge branch 'main' into add_nemo_bridge
chai-xiaonan c0b0f37
Merge branch 'flagos-ai:main' into add_nemo_bridge
chai-xiaonan 2900956
delete readme and swp file
chai-xiaonan 0dd3b6b
Merge branch 'add_nemo_bridge' of https://github.com/chai-xiaonan/Fla…
chai-xiaonan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Copyright (c) 2025, BAAI. All rights reserved. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rename flagscale/train/megatron/nemo_bridge to flagscale/train/megatron/bridge so that it matches the import pattern from megatron.bridge |
||
| # | ||
| # Mainly adapted from: https://github.com/NVIDIA-NeMo/Megatron-Bridge | ||
| """Megatron Bridge - A component of the Megatron ecosystem.""" | ||
|
|
||
| from megatron.nemo_bridge.models.conversion.auto_bridge import AutoBridge | ||
|
|
||
| __all__ = ["AutoBridge"] | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # Copyright (c) 2025, BAAI. All rights reserved. | ||
| # | ||
| # Copied from: https://github.com/NVIDIA-NeMo/Megatron-Bridge | ||
|
|
||
| from megatron.nemo_bridge.models.conversion.auto_bridge import AutoBridge | ||
| from megatron.nemo_bridge.models.conversion.mapping_registry import MegatronMappingRegistry | ||
| from megatron.nemo_bridge.models.conversion.model_bridge import MegatronModelBridge | ||
| from megatron.nemo_bridge.models.conversion.param_mapping import ( | ||
| AutoMapping, | ||
| ColumnParallelMapping, | ||
| GatedMLPMapping, | ||
| MegatronParamMapping, | ||
| QKVMapping, | ||
| ReplicatedMapping, | ||
| RowParallelMapping, | ||
| ) | ||
| from megatron.nemo_bridge.models.deepseek import ( | ||
| DeepSeekModelProvider, | ||
| DeepSeekProvider, | ||
| DeepSeekV2LiteModelProvider, | ||
| DeepSeekV2LiteProvider, | ||
| DeepSeekV2ModelProvider, | ||
| DeepSeekV2Provider, | ||
| DeepSeekV3ModelProvider, | ||
| DeepSeekV3Provider, | ||
| MoonlightModelProvider16B, | ||
| MoonlightProvider, | ||
| ) | ||
| from megatron.nemo_bridge.models.gpt_provider import GPTModelProvider | ||
| from megatron.nemo_bridge.models.qwen import ( | ||
| Qwen2ModelProvider, | ||
| Qwen2ModelProvider1P5B, | ||
| Qwen2ModelProvider7B, | ||
| Qwen2ModelProvider72B, | ||
| Qwen2ModelProvider500M, | ||
| Qwen3ModelProvider, | ||
| Qwen3ModelProvider1P7B, | ||
| Qwen3ModelProvider4B, | ||
| Qwen3ModelProvider8B, | ||
| Qwen3ModelProvider14B, | ||
| Qwen3ModelProvider32B, | ||
| Qwen3ModelProvider600M, | ||
| Qwen3MoEModelProvider, | ||
| Qwen3MoEModelProvider30B_A3B, | ||
| Qwen3MoEModelProvider235B_A22B, | ||
| Qwen25ModelProvider1P5B, | ||
| Qwen25ModelProvider3B, | ||
| Qwen25ModelProvider7B, | ||
| Qwen25ModelProvider14B, | ||
| Qwen25ModelProvider32B, | ||
| Qwen25ModelProvider72B, | ||
| Qwen25ModelProvider500M, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "AutoBridge", | ||
| "MegatronMappingRegistry", | ||
| "MegatronModelBridge", | ||
| "ColumnParallelMapping", | ||
| "GatedMLPMapping", | ||
| "MegatronParamMapping", | ||
| "QKVMapping", | ||
| "ReplicatedMapping", | ||
| "RowParallelMapping", | ||
| "AutoMapping", | ||
| "GPTModelProvider", | ||
| "Qwen2ModelProvider", | ||
| "Qwen2ModelProvider500M", | ||
| "Qwen2ModelProvider1P5B", | ||
| "Qwen2ModelProvider7B", | ||
| "Qwen2ModelProvider72B", | ||
| "Qwen25ModelProvider500M", | ||
| "Qwen25ModelProvider1P5B", | ||
| "Qwen25ModelProvider3B", | ||
| "Qwen25ModelProvider7B", | ||
| "Qwen25ModelProvider14B", | ||
| "Qwen25ModelProvider32B", | ||
| "Qwen25ModelProvider72B", | ||
| "Qwen3ModelProvider", | ||
| "Qwen3ModelProvider600M", | ||
| "Qwen3ModelProvider1P7B", | ||
| "Qwen3ModelProvider4B", | ||
| "Qwen3ModelProvider8B", | ||
| "Qwen3ModelProvider14B", | ||
| "Qwen3ModelProvider32B", | ||
| "Qwen3MoEModelProvider", | ||
| "Qwen3MoEModelProvider30B_A3B", | ||
| "Qwen3MoEModelProvider235B_A22B", | ||
| "DeepSeekModelProvider", | ||
| "DeepSeekProvider", | ||
| "DeepSeekV2LiteModelProvider", | ||
| "DeepSeekV2LiteProvider", | ||
| "DeepSeekV2ModelProvider", | ||
| "DeepSeekV2Provider", | ||
| "DeepSeekV3ModelProvider", | ||
| "DeepSeekV3Provider", | ||
| "MoonlightModelProvider16B", | ||
| "MoonlightProvider", | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nemo megatron-bridge supports pip install for usage, ref https://pypi.org/project/megatron-bridge/
please remove source codes