-
Notifications
You must be signed in to change notification settings - Fork 558
feat(recipes): add optimized 32-GPU Nano-Omni GRPO recipes #3737
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
youngeunkwon0405
wants to merge
5
commits into
main
Choose a base branch
from
codex/nano-omni-32gpu-recipes
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6ec0df5
feat(recipes): add 32-GPU Nano-Omni GRPO recipes
youngeunkwon0405 dd5c5ef
chore(recipes): remove benchmark-only overrides
youngeunkwon0405 58def7e
fix(vlm): dispatch async GRPO recipes correctly
youngeunkwon0405 b00fb48
chore(recipes): keep async dispatch out of scope
youngeunkwon0405 f6091f6
chore(recipes): remove Gym-only serving overrides
youngeunkwon0405 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
28 changes: 28 additions & 0 deletions
28
...onfigs/recipes/vlm/vlm_grpo-nemotron-omni-30ba3b-clevr-8n4g-megatron-tp1ep8-async.v1.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,28 @@ | ||
| defaults: ./vlm_grpo-nemotron-omni-30ba3b-clevr-8n4g-megatron-tp1ep8.v1.yaml | ||
|
|
||
| grpo: | ||
| async_grpo: | ||
| enabled: true | ||
|
youngeunkwon0405 marked this conversation as resolved.
|
||
| in_flight_weight_updates: true | ||
|
|
||
| checkpointing: | ||
| checkpoint_dir: results/vlm_grpo_nemotron_omni_8n4g_megatron_async | ||
|
|
||
| policy: | ||
| generation: | ||
| colocated: | ||
| enabled: false | ||
| resources: | ||
| gpus_per_node: 4 | ||
| num_nodes: 4 | ||
| vllm_cfg: | ||
| gpu_memory_utilization: 0.8 | ||
| vllm_kwargs: | ||
| max_num_seqs: 128 | ||
|
|
||
| logger: | ||
| wandb: | ||
| name: nemotron-omni-8n4g-async-1-off | ||
|
|
||
| cluster: | ||
| segment_size: 4 | ||
54 changes: 54 additions & 0 deletions
54
...ples/configs/recipes/vlm/vlm_grpo-nemotron-omni-30ba3b-clevr-8n4g-megatron-tp1ep8.v1.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,54 @@ | ||
| defaults: ./vlm_grpo-nemotron-omni-30ba3b-clevr-1n8g-megatron-tp8ep8.v1.yaml | ||
|
youngeunkwon0405 marked this conversation as resolved.
|
||
|
|
||
| grpo: | ||
| num_prompts_per_step: 64 | ||
|
|
||
| loss_fn: | ||
| use_importance_sampling_correction: true | ||
| force_on_policy_ratio: true | ||
|
|
||
| checkpointing: | ||
| checkpoint_dir: results/vlm_grpo_nemotron_omni_8n4g_megatron | ||
|
|
||
| policy: | ||
| is_vlm: true | ||
| train_global_batch_size: 1024 | ||
| generation_batch_size: 1024 | ||
| logprob_chunk_size: 1024 | ||
| make_sequence_length_divisible_by: 256 | ||
| tokenizer: | ||
| chat_template_kwargs: | ||
| enable_thinking: true | ||
| truncate_history_thinking: false | ||
| sequence_packing: | ||
| train_mb_tokens: 10240 | ||
| megatron_cfg: | ||
| empty_unused_memory_level: 2 | ||
| tensor_model_parallel_size: 1 | ||
|
youngeunkwon0405 marked this conversation as resolved.
|
||
| activation_checkpointing: false | ||
| defer_fp32_logits: true | ||
| use_fused_weighted_squared_relu: true | ||
| generation: | ||
| vllm_cfg: | ||
| async_engine: true | ||
| tensor_parallel_size: 2 | ||
| expert_parallel_size: 2 | ||
| enforce_eager: false | ||
| vllm_kwargs: | ||
| max_num_batched_tokens: 32768 | ||
| max_num_seqs: 64 | ||
| all2all_backend: flashinfer_nvlink_one_sided | ||
| kernel_config: | ||
| moe_backend: flashinfer_cutlass | ||
| enable_flashinfer_autotune: true | ||
|
|
||
| logger: | ||
| wandb_enabled: true | ||
| tensorboard_enabled: false | ||
| wandb: | ||
| name: nemotron-omni-8n4g-sync | ||
|
|
||
| cluster: | ||
| num_nodes: 8 | ||
| gpus_per_node: 4 | ||
| segment_size: 8 | ||
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
42 changes: 42 additions & 0 deletions
42
tests/test_suites/vlm/vlm_grpo-nemotron-omni-30ba3b-clevr-8n4g-megatron-tp1ep8-async.v1.sh
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,42 @@ | ||
| #!/bin/bash | ||
| SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd) | ||
| source $SCRIPT_DIR/common.env | ||
|
|
||
| # ===== BEGIN CONFIG ===== | ||
| NUM_NODES=8 | ||
| GPUS_PER_NODE=4 | ||
| STEPS_PER_RUN=10 | ||
| MAX_STEPS=10 | ||
| NUM_RUNS=$(( (MAX_STEPS + STEPS_PER_RUN - 1) / STEPS_PER_RUN )) # Round up | ||
| NUM_MINUTES=120 | ||
| # ===== END CONFIG ===== | ||
|
|
||
| exit_if_max_steps_reached | ||
|
|
||
| # Run the experiment | ||
| cd $PROJECT_ROOT | ||
| uv run examples/run_vlm_grpo.py \ | ||
| --config $CONFIG_PATH \ | ||
| grpo.max_num_steps=$MAX_STEPS \ | ||
| logger.log_dir=$LOG_DIR \ | ||
| logger.wandb_enabled=True \ | ||
| logger.wandb.project=nemo-rl \ | ||
| logger.wandb.name=$EXP_NAME \ | ||
| logger.monitor_gpus=True \ | ||
| logger.tensorboard_enabled=True \ | ||
| checkpointing.enabled=True \ | ||
| checkpointing.checkpoint_dir=$CKPT_DIR \ | ||
| $@ \ | ||
| 2>&1 | tee $RUN_LOG | ||
|
|
||
| # Convert tensorboard logs to json | ||
| uv run tests/json_dump_tb_logs.py $LOG_DIR --output_path $JSON_METRICS | ||
|
|
||
| # Only run metrics if the target step is reached | ||
| if [[ $(jq 'to_entries | .[] | select(.key == "train/loss") | .value | keys | map(tonumber) | max' $JSON_METRICS) -ge $MAX_STEPS ]]; then | ||
| uv run tests/check_metrics.py $JSON_METRICS \ | ||
| 'max(data["train/reward"]) > 0.5' | ||
|
|
||
| # Clean up checkpoint directory after successful run to save space. | ||
| rm -rf "$CKPT_DIR" | ||
| fi |
42 changes: 42 additions & 0 deletions
42
tests/test_suites/vlm/vlm_grpo-nemotron-omni-30ba3b-clevr-8n4g-megatron-tp1ep8.v1.sh
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,42 @@ | ||
| #!/bin/bash | ||
| SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd) | ||
| source $SCRIPT_DIR/common.env | ||
|
|
||
| # ===== BEGIN CONFIG ===== | ||
| NUM_NODES=8 | ||
| GPUS_PER_NODE=4 | ||
| STEPS_PER_RUN=10 | ||
| MAX_STEPS=10 | ||
| NUM_RUNS=$(( (MAX_STEPS + STEPS_PER_RUN - 1) / STEPS_PER_RUN )) # Round up | ||
| NUM_MINUTES=120 | ||
| # ===== END CONFIG ===== | ||
|
|
||
| exit_if_max_steps_reached | ||
|
|
||
| # Run the experiment | ||
| cd $PROJECT_ROOT | ||
| uv run examples/run_vlm_grpo.py \ | ||
| --config $CONFIG_PATH \ | ||
| grpo.max_num_steps=$MAX_STEPS \ | ||
| logger.log_dir=$LOG_DIR \ | ||
| logger.wandb_enabled=True \ | ||
| logger.wandb.project=nemo-rl \ | ||
| logger.wandb.name=$EXP_NAME \ | ||
| logger.monitor_gpus=True \ | ||
| logger.tensorboard_enabled=True \ | ||
| checkpointing.enabled=True \ | ||
| checkpointing.checkpoint_dir=$CKPT_DIR \ | ||
| $@ \ | ||
| 2>&1 | tee $RUN_LOG | ||
|
|
||
| # Convert tensorboard logs to json | ||
| uv run tests/json_dump_tb_logs.py $LOG_DIR --output_path $JSON_METRICS | ||
|
|
||
| # Only run metrics if the target step is reached | ||
| if [[ $(jq 'to_entries | .[] | select(.key == "train/loss") | .value | keys | map(tonumber) | max' $JSON_METRICS) -ge $MAX_STEPS ]]; then | ||
| uv run tests/check_metrics.py $JSON_METRICS \ | ||
| 'max(data["train/reward"]) > 0.5' | ||
|
|
||
| # Clean up checkpoint directory after successful run to save space. | ||
| rm -rf "$CKPT_DIR" | ||
| fi |
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.