-
Notifications
You must be signed in to change notification settings - Fork 546
feat(sc): support non-colocated MInf #3727
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
6b0cdca
feat(sc): support non-colocated MInf
tdene 28c0593
Address PR team review
tdene c9c667a
Cleanup
tdene 6e49356
Address reviewer comments
tdene a3c94e9
Merge branch 'main' into tde/sc_megatron_generation
tdene 28218a6
Refactor recompute logic
tdene d3602a3
Address reviewer comments
tdene f2b9a30
Merge branch 'main' into tde/sc_megatron_generation
tdene e322324
Use example as part of CI
tdene a032e95
Add nightly test
tdene 3460091
Merge branch 'main' into tde/sc_megatron_generation
tdene 0661efd
lint
tdene a5e2d67
fix(megatron): hotfix disable offending tests
tdene ae5c741
run the megatron async-gym functional during LFast
tdene c81afd6
test: temporarily run the SC sync math nightlies on GB200
tdene 0d3bf0c
Merge branch 'main' into tde/sc_megatron_generation
tdene 61f1e2a
Address reviewer comments
tdene 44c13e6
Topology fix
tdene 898964c
Merge branch 'main' into tde/sc_megatron_generation
tdene 0cc133c
Replace _build_trainer_then_megatron_generation
tdene 83889d5
Fix tests
tdene c3837b7
Fix NCCL refit TP=1 issue
tdene df3df79
Revert temporary test changes
tdene f2fc2e8
Expand comment
tdene 399a162
Merge remote-tracking branch 'origin/main' into tde/sc_megatron_gener…
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
12 changes: 12 additions & 0 deletions
12
...n2.5-math-1.5b-instruct-1n8g-megatron_generation-noncolocated-single-controller-sync.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,12 @@ | ||
| defaults: ./grpo-qwen2.5-math-1.5b-instruct-1n8g-megatron-single-controller-sync.yaml | ||
| logger: | ||
| log_dir: logs/grpo-qwen2.5-math-1.5b-instruct-1n8g-megatron_generation-noncolocated-single-controller-sync | ||
| wandb: | ||
| name: grpo-qwen2.5-math-1.5b-instruct-1n8g-megatron_generation-noncolocated-single-controller-sync | ||
| checkpointing: | ||
| checkpoint_dir: results/grpo-qwen2.5-math-1.5b-instruct-1n8g-megatron_generation-noncolocated-single-controller-sync | ||
| policy: | ||
| generation: | ||
| backend: megatron | ||
| mcore_generation_config: | ||
| kv_cache_management_mode: recompute |
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
78 changes: 78 additions & 0 deletions
78
examples/nemo_gym/grpo_qwen3_0_6b_megatron_generation_single_controller.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,78 @@ | ||
| # GRPO on the NeMo-Gym workplace-assistant environment via the SingleController path, | ||
| # using non-colocated Megatron Inference. | ||
| # Gym rollouts go through the persistent Megatron engine's OpenAI-compatible server, | ||
| # Smoke-test scale; Qwen3-0.6B on one node with 2 GPUs (1 training + 1 generation). | ||
| # The CI-run variant, tests/functional/grpo_megatron_generation_gym_single_controller.sh, | ||
| # loads this file and overrides only test scale, data paths, and logging; the resolved | ||
| # config stays value-equal to the vLLM SC test (grpo_async_gym_single_controller.sh) | ||
| # everywhere but the generation backend. | ||
| defaults: "grpo_qwen3_30ba3b_instruct.yaml" | ||
|
yuki-97 marked this conversation as resolved.
|
||
|
|
||
| grpo: | ||
| # SC requires one optimizer step per RL step: | ||
| # num_prompts_per_step * num_generations_per_prompt == policy.train_global_batch_size | ||
| num_prompts_per_step: 4 | ||
| num_generations_per_prompt: 2 | ||
| max_num_steps: 10 # short demo; raise for a real run | ||
| # SC does not support validation yet (setup raises when it is enabled). | ||
| val_period: 0 | ||
| val_at_start: false | ||
| # The KL term below needs reference logprobs; the base skips them. | ||
| skip_reference_policy_logprobs_calculation: false | ||
| # SC replaces the legacy async-GRPO path. | ||
| async_grpo: null | ||
|
|
||
| loss_fn: | ||
| # A small KL term (the base uses 0) exercises the reference-model path end to end. | ||
| reference_policy_kl_penalty: 0.01 | ||
| use_importance_sampling_correction: true | ||
|
|
||
| policy: | ||
| model_name: Qwen/Qwen3-0.6B | ||
| train_global_batch_size: 8 | ||
| # Full workplace-assistant prompts (all tools attached) run past 4k tokens. | ||
| max_total_sequence_length: 8192 | ||
|
|
||
| megatron_cfg: | ||
| tensor_model_parallel_size: 1 | ||
| expert_model_parallel_size: 1 | ||
| context_parallel_size: 1 | ||
| sequence_parallel: false | ||
|
|
||
| generation: | ||
| backend: "megatron" | ||
| mcore_generation_config: | ||
| # NeMo-Gym drives rollouts through the engine's OpenAI server. | ||
| expose_http_server: true | ||
| colocated: | ||
| enabled: false | ||
| resources: | ||
| num_nodes: 1 | ||
| gpus_per_node: 1 | ||
|
|
||
| # The gym family sets no data_plane block. Only keys without a schema default | ||
| # are set here; see nemo_rl/data_plane/interfaces.py, and the fully documented | ||
| # block in examples/configs/grpo_math_1B.yaml. | ||
| data_plane: | ||
| enabled: true | ||
| impl: transfer_queue | ||
| backend: "simple" | ||
| claim_meta_poll_interval_s: 0.5 | ||
| simple: | ||
| num_storage_units: ${mul:2, ${cluster.num_nodes}} # TQ wants >= 2 per node | ||
|
|
||
| async_rl: | ||
| sampler: | ||
| name: in_order | ||
| # 0 = fully synchronous, so the importance sampling correction above is an | ||
| # inert no-op (all ratios are 1); it is enabled to match the vLLM SC test. | ||
| max_lookahead_versions: 0 | ||
| min_groups_for_streaming_train: ${grpo.num_prompts_per_step} | ||
| max_inflight_prompts: ${grpo.num_prompts_per_step} | ||
| max_buffered_rollouts: ${grpo.num_prompts_per_step} | ||
|
|
||
| checkpointing: | ||
| enabled: false | ||
|
|
||
| cluster: | ||
| gpus_per_node: 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
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.