Skip to content

NemoRL multinode training example - #89

Merged
kailash109 merged 1 commit into
mainfrom
nemorl_example
Jun 24, 2026
Merged

kailash109 merged 1 commit into
mainfrom
nemorl_example

Conversation

@kailash109

@kailash109 kailash109 commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

This adds a self-contained launcher for running multinode training using NemoRL on Modal, covering both single-node and multi-node (RDMA/EFA) clusters.

The organization is taken from the Slime example, with a small config system (configs/base.py) where each experiment is a Python module exposing a modal object and nemo_rl object (which run script to use, which base YAML from NemoRL, and a dict of overrides). Similar to the Slime example, modal_train.py turns that into a Modal app with download_model, download_data, and train entry points, starting a Ray cluster across the allocated nodes and running the NemoRL driver on the head node w/ the HF cache and checkpoints mounted as volumes.

Tested examples: GRPO on OpenMathInstruct-2 math task: Qwen2.5-1.5B (single and 2-node DP), Llama-3.1-8B two-node, Qwen3-8B, and a Nemotron-Nano-v3-30B-A3B MoE FSDP + EP two-node config. README contains setup + launch instructions


Open in Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread nemo-rl/modal_train.py
volumes=modal_volumes,
secrets=[
modal.Secret.from_name("huggingface-secret"),
modal.Secret.from_name("wandb-secret"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 STYLE_GUIDE violation: wandb-secret is required but should be optional

The STYLE_GUIDE.md states: "wandb-secret should be used for Weights & Biases. This secret should always be optional i.e. the script should work without it." The train function at nemo-rl/modal_train.py:151-152 includes modal.Secret.from_name("wandb-secret") as a required secret (the default for from_name is required=True). This means running modal run modal_train.py::train will fail at deploy time if the user hasn't configured a wandb-secret Modal secret, even though wandb logging is conceptually optional in NeMo-RL (it's just an override in each config).

Suggested change
modal.Secret.from_name("wandb-secret"),
modal.Secret.from_name("wandb-secret", required=False),
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +51 to +55
try:
table = placement_group_table(placement_group)
return table.get("bundles_to_node_id", {}).get(bundle_index)
except Exception:
return None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 _bundle_node_id dict key type may not match bundle_index int

In _bundle_node_id at nemo-rl/modal_helpers/run_grpo_multinode.py:53, table.get("bundles_to_node_id", {}).get(bundle_index) uses bundle_index as an int. Depending on the Ray version, placement_group_table may return bundles_to_node_id with string keys (from protobuf/JSON serialization). If the keys are strings like "0", "1", the int lookup would always return None, causing the NCCL_HOSTID patch to silently never apply. The function is wrapped in a broad try/except returning None, so it would fail silently. This is hard to verify without the exact Ray version in the container image, but if this lookup fails, multinode training could hit 'Duplicate GPU detected' NCCL errors.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@kailash109
kailash109 merged commit d31816c into main Jun 24, 2026
1 check passed
@kailash109
kailash109 deleted the nemorl_example branch June 24, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants