-
Notifications
You must be signed in to change notification settings - Fork 558
feat: colocated Megatron reshard #3490
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
caafe62
feat: colocated Megatron reshard
tdene e78254c
colocated-reshard nightly (nanov3)
tdene f7d1ef4
colocated reshard functional test
tdene 84412d3
Fix issues uncovered by tests
tdene 6e650b5
Single source of truth for config merge
tdene 4a2dfaf
lint
tdene fecd2e3
Unify Megatron refit behind a WeightSynchronizer
tdene 75b1c81
Add offload_optimizer_for_refit config
tdene 6d0a720
Adopt setup_timing_metrics in the synchronizer init block
tdene 356d25f
lint
tdene ea559a4
Fix the non-colocated refit test to dispatch via the synchronizer
tdene 9ffe449
Fix inference-optimized incompatibility
tdene 844e964
Properly fix inference config mismatch
tdene 0cd9e5e
Use a QKV-bias-free model in the reshard test
tdene 7cf972a
Add refit test that doesn't need TMS
tdene 6fa85ca
Minimize the 4n4g reshard recipe config
tdene c7d9592
Fix segment-size on nightlies
tdene 7695ba5
Address reviewer comments
tdene 5d7f2c4
Address review-pr-team comments
tdene 4c3e03c
Import torch_memory_saver correctly
tdene 3ad74f7
lint rebase conflict
tdene 3ca38b7
Address reviewer comments
tdene 6f63120
Address reviewer comment
tdene 4a21615
Fix default value of argument
tdene 5f1f294
Fix extra issues
tdene 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
47 changes: 47 additions & 0 deletions
47
examples/configs/recipes/llm/grpo-nanov3-30BA3B-4n4g-megatron_colocated_reshard.yaml
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,47 @@ | ||
| defaults: ../../grpo_math_1B.yaml | ||
| grpo: | ||
| num_prompts_per_step: 2 | ||
| num_generations_per_prompt: 8 | ||
| max_num_steps: 500 | ||
| checkpointing: | ||
| enabled: false | ||
| checkpoint_dir: results/grpo-nanov3-30BA3B-4n4g-megatron_colocated_reshard | ||
| save_period: 100 | ||
| policy: | ||
| model_name: nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16 | ||
| tokenizer: | ||
| name: nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16 | ||
| train_global_batch_size: 16 | ||
| train_micro_batch_size: 1 | ||
| logprob_batch_size: 1 | ||
| max_total_sequence_length: 2048 | ||
| megatron_cfg: | ||
| enabled: true | ||
| bias_activation_fusion: false | ||
| tensor_model_parallel_size: 2 | ||
| expert_model_parallel_size: 8 | ||
| sequence_parallel: true | ||
| dtensor_cfg: | ||
| enabled: false | ||
| sequence_packing: | ||
| enabled: false | ||
| generation: | ||
| backend: megatron | ||
| mcore_generation_config: | ||
| transformer_impl: inference_optimized | ||
| moe_router_dtype: fp32 | ||
| activation_checkpointing: false | ||
| tensor_model_parallel_size: 4 | ||
| expert_model_parallel_size: 4 | ||
| sequence_parallel: true | ||
| logger: | ||
| log_dir: logs/grpo-nanov3-30BA3B-4n4g-megatron_colocated_reshard | ||
| wandb_enabled: true | ||
| tensorboard_enabled: true | ||
| wandb: | ||
| project: nemo-rl | ||
| name: grpo-nanov3-30BA3B-4n4g-megatron_colocated_reshard | ||
| cluster: | ||
| gpus_per_node: 4 | ||
| num_nodes: 4 | ||
| segment_size: 2 |
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.