Repository navigation
feat: Update Megatron Inference #2355
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
55 commits
Select commit
Hold shift + click to select a range
20776f2
Update Megatron Inference
tdene adcd0e9
Fix issues from the rebase
tdene 835cb43
Address reviewer comments
tdene 229cecd
Address reviewer comments
tdene 3bb2a52
Address reviewer comments
tdene 74b2a64
Address reviewer comments
tdene e54f42e
Address reviewer comments
tdene f2971c2
Address reviewer comments
tdene 64664bc
Address reviewer comments
tdene 841e593
Self-review
tdene 6e2e528
Update for latest Megatron-LM
tdene fd2d580
lint
tdene 3c48917
Apply suggestions from code review
tdene 77e7a65
Address reviewer comments
tdene d27c1bd
Unfactor MegatronRefitController
tdene d64a81f
Address reviewer comments
tdene cc5f5e4
Address reviewer comments
tdene 0867638
Fix NVLink behavior
tdene 20acfea
lint
tdene 278f8c8
lint
tdene 52c7397
Fix non-Gym and colocated paths
tdene f7658b9
Fix stop words and sampling params
tdene f5e0497
Add more functional test coverage
tdene 89208b5
Add MInf unit tests
tdene 4a9a43b
lint
tdene 892dd87
Merge remote-tracking branch 'origin/main' into tde/megatron_inference
tdene a116ccc
lint
tdene c1e8086
lint
tdene c7301d6
lint
tdene 7337fbb
lint
tdene 359eced
Merge remote-tracking branch 'origin/main' into tde/megatron_inference
tdene 42d8c85
Fix merge issues
tdene 0fbe5c9
Fix old unit tests
tdene 41b317b
Merge remote-tracking branch 'origin/main' into tde/megatron_inference
tdene 4d504a0
Fix tests
tdene 7d1e2ca
Fix unit tests
tdene c71e3b5
Fix merge
tdene 6d3233a
Merge remote-tracking branch 'origin/main' into tde/megatron_inference
tdene 1caf9b8
Fix NeMo Gym merge
tdene e7949e2
Fix CI
tdene a5057f8
Fix CI
tdene 4c717df
Merge remote-tracking branch 'origin/main' into tde/megatron_inference
tdene a44233b
Fix fp32 test issue
tdene 27d320f
Fix CI
tdene 155f7e8
Fix CI
tdene df4f663
Merge remote-tracking branch 'origin/main' into tde/megatron_inference
tdene e1b5f85
Update value worker
tdene 2ba8f0b
Add an early preview of #2612 to fix CI
tdene 0984e27
Fix functional test configs
tdene f14d5cb
Skip MInf functional tests on Blackwell
tdene dce23c4
Merge remote-tracking branch 'origin/main' into tde/megatron_inference
tdene ae64407
Hotfix; see NVIDIA-NeMo/Megatron-Bridge#4375
tdene a84cfba
Address reviewer comments
tdene 2162b37
Merge remote-tracking branch 'origin/main' into tde/megatron_inference
tdene 71da32a
Disable top_p / top_k test for Megatron Inference
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
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
41 changes: 41 additions & 0 deletions
41
.../configs/recipes/llm/grpo-llama3.2-1b-instruct-2n8g-megatron_generation-noncolocated.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,41 @@ | ||
| defaults: ../../grpo_math_1B.yaml | ||
| grpo: | ||
| max_num_steps: 30 | ||
| checkpointing: | ||
| enabled: false | ||
| checkpoint_dir: results/grpo-llama3.2-1b-instruct-2n8g-megatron_generation-noncolocated | ||
| save_period: 100 | ||
| policy: | ||
| model_name: meta-llama/Llama-3.2-1B-Instruct | ||
| tokenizer: | ||
| name: meta-llama/Llama-3.2-1B-Instruct | ||
| optimizer: null | ||
| megatron_cfg: | ||
| enabled: true | ||
| scheduler: | ||
| lr_warmup_iters: 50 | ||
| dtensor_cfg: | ||
| enabled: false | ||
| make_sequence_length_divisible_by: 1 | ||
| generation: | ||
| backend: megatron | ||
| max_new_tokens: 512 | ||
| vllm_cfg: | ||
| max_model_len: 512 | ||
| colocated: | ||
| enabled: false | ||
| resources: | ||
| gpus_per_node: 8 | ||
| num_nodes: 1 | ||
| data: | ||
| max_input_seq_length: 512 | ||
| logger: | ||
| log_dir: logs/grpo-llama3.2-1b-instruct-2n8g-megatron_generation-noncolocated | ||
| wandb_enabled: true | ||
| tensorboard_enabled: true | ||
| wandb: | ||
| project: nemo-rl | ||
| name: grpo-llama3.2-1b-instruct-2n8g-megatron_generation-noncolocated | ||
| cluster: | ||
| gpus_per_node: 8 | ||
| num_nodes: 2 |
30 changes: 30 additions & 0 deletions
30
examples/configs/recipes/llm/grpo-nanov3-30BA3B-2n8g-megatron_generation-async-gym.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,30 @@ | ||
| defaults: ../../../nemo_gym/grpo_nanov3.yaml | ||
| grpo: | ||
| async_grpo: | ||
| enabled: true | ||
| in_flight_weight_updates: true | ||
| checkpointing: | ||
| checkpoint_dir: results/grpo-nanov3-30BA3B-2n8g-megatron_generation-async-gym | ||
| 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 | ||
| max_total_sequence_length: 2048 | ||
| sequence_packing: | ||
| enabled: false | ||
| generation: | ||
| backend: megatron | ||
| colocated: | ||
| enabled: false | ||
| resources: | ||
| gpus_per_node: 8 | ||
| num_nodes: 1 | ||
| logger: | ||
| wandb_enabled: true | ||
| tensorboard_enabled: true | ||
| wandb: | ||
| project: nemo-rl | ||
| name: grpo-nanov3-30BA3B-2n8g-megatron_generation-async-gym | ||
| cluster: | ||
| num_nodes: 2 |
47 changes: 47 additions & 0 deletions
47
examples/configs/recipes/llm/grpo-nanov3-30BA3B-2n8g-megatron_generation.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 | ||
| checkpointing: | ||
| checkpoint_dir: results/grpo-nanov3-30BA3B-2n8g-megatron_generation | ||
| 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 | ||
| dtensor_cfg: | ||
| enabled: false | ||
| megatron_cfg: | ||
| enabled: true | ||
| bias_activation_fusion: false | ||
| tensor_model_parallel_size: 2 | ||
| expert_model_parallel_size: 8 | ||
| sequence_parallel: true | ||
| sequence_packing: | ||
| enabled: false | ||
| generation: | ||
| backend: megatron | ||
| mcore_generation_config: | ||
| transformer_impl: inference_optimized | ||
| activation_checkpointing: false | ||
| tensor_model_parallel_size: 2 | ||
| expert_model_parallel_size: 8 | ||
| sequence_parallel: true | ||
| async_engine: true | ||
| colocated: | ||
| enabled: false | ||
| resources: | ||
| gpus_per_node: 8 | ||
| num_nodes: 1 | ||
| logger: | ||
| wandb_enabled: true | ||
| tensorboard_enabled: true | ||
| wandb: | ||
| project: nemo-rl | ||
| name: grpo-nanov3-30BA3B-2n8g-megatron_generation | ||
| cluster: | ||
| gpus_per_node: 8 | ||
| num_nodes: 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.