-
Notifications
You must be signed in to change notification settings - Fork 148
feat(mimo): phase 2 - model provider, DDP wrapping, process groups #2004
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
aroshanghias-nvd
wants to merge
6
commits into
NVIDIA-NeMo:main
Choose a base branch
from
aroshanghias-nvd:mimo/phase2-model
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
feat(mimo): phase 2 - model provider, DDP wrapping, process groups #2004
aroshanghias-nvd
wants to merge
6
commits into
NVIDIA-NeMo:main
from
aroshanghias-nvd:mimo/phase2-model
Conversation
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
Signed-off-by: Ali Roshan Ghias <[email protected]>
Remove EncoderProvider abstraction in favor of passing ModuleSpecs directly to MimoModelProvider. Rename MIMOConfig to MimoParallelismConfig for clarity. Key changes: - Add MimoModelProvider that accepts language_model_spec and modality_submodules_spec - Remove EncoderProvider, EncoderTransformerConfig, GenericVisionEncoderProvider - Rename MIMOConfig to MimoParallelismConfig (cfg.mimo field name unchanged) - Update build_hypercomm_grids and build_colocated_comm_config signatures - Fix ColocatedCommConfig logic to apply to both "colocated" and "homogeneous" modes - Fix import: ProcessGroupCollection is in megatron.core.process_groups_config - Add LlavaMimoProvider convenience subclass - Remove obsolete encoder_providers validation from ConfigContainer - Add comprehensive unit tests for MimoModelProvider - Update and fix test_mimo_config.py (remove encoder_provider tests) All MIMO tests passing (5/5 config tests, provider tests).
Move MIMO grid/topology helpers into the mimo package so model construction stays self-contained and remove unused MIMO convenience accessors while updating the config union.
8312d19 to
310869a
Compare
| from megatron.bridge.training.mimo_config import MimoParallelismConfig | ||
|
|
||
|
|
||
| def wrap_mimo_model_distributed( |
Contributor
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.
may be move to mimo folder?
- Remove unused get_module_data_parallel_size from ConfigContainer - Move mimo_config.py from training/ to models/mimo/ for better cohesion - Export MimoParallelismConfig and ModuleParallelismConfig from mimo __init__
Signed-off-by: Ali Roshan Ghias <[email protected]>
310869a to
6a23f05
Compare
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 does this PR do?
Implements Phase 2 of MIMO upstreaming: adds DDP wrapping utilities, embedding group support for PP > 1, and improved validation for heterogeneous deployment.
Changelog
wrap_mimo_model_distributed()for rank-aware DDP wrapping of MIMO submodulesmimo_builder.py:populate_embedding_and_position_groups()for PP > 1 supportis_pp_first_stage()/is_pp_last_stage()helpersis_current_rank_in_grid()for rank participation checksMimoParallelismConfig._validate_heterogeneous():_get_pg_collections_from_grids()to populatepos_embdandembdprocess groupsFiles Changed
models/mimo/mimo_builder.pymodels/mimo/mimo_provider.pytraining/mimo_config.pytraining/mimo_ddp.pytests/GitHub Actions CI
See the CI section in the Contributing doc for how to trigger the CI.
Before your PR is "Ready for review"
Pre checks:
Additional Information