Repository navigation
feat(nemo-gym): define shard configuration - #3369
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
ffc2c2c to
301cbcc
Compare
301cbcc to
9ef1e54
Compare
9ef1e54 to
b6f7775
Compare
b6f7775 to
487f9d5
Compare
487f9d5 to
5c010da
Compare
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
5c010da to
931fe8f
Compare
|
/ok to test 931fe8f |
931fe8f to
f85f21b
Compare
|
/ok to test f85f21b |
f85f21b to
b6bdd33
Compare
|
/ok to test b6bdd33 |
1 similar comment
|
/ok to test b6bdd33 |
0cf7db7 to
2354403
Compare
|
/ok to test 2354403 |
2354403 to
44371c5
Compare
|
/ok to test 44371c5 |
44371c5 to
56dbaad
Compare
|
/ok to test 56dbaad |
terrykong
left a comment
There was a problem hiding this comment.
All nine comments are addressed. I checked each one against the current head (56dbaad) rather than going by the replies:
- The per-shard port range now reaches the actor —
build_nemo_gym_configpops the range off the Gym dict and passes it as aNemoGymConfigfield, so_spinupreads a populated field instead of falling back to 5000-5999. parse_shard_planraises when sharding keys appear with noshardsblock, naming the stray keys.SHARD_SPEC_KEYSandSHARDING_CONFIG_KEYSboth derive from their dataclasses, so neither can drift again.allowed_duplicate_entriesgoes through_as_string_setlike its sibling lists.- Both override layers reject
config_pathsand reject entries another shard claims. - The
find_gym_config_entriesdocstring and the stripped-keys comment now describe what the code actually does. - The module is in
pyrefly.tomland passes — pyrefly 0.24.2 reports 0 errors on it. total_instancesis gone.
I also ran it: 50 unit tests pass, up from 40. Since the new guards exist because I asked for them, I checked they do not reject anything legitimate — tuning a commonly-inherited entry through common_overrides, a shard tuning the entry it claims, defining a brand-new shared entry, a plain setting, the single-shard auto-claim, and the unsharded path are all still accepted. The four mistake shapes are rejected with messages that name the fix.
Two notes, neither blocking. CI was triggered at this head a few minutes ago and has not finished, so the approval is on the code, not on a green run. And this is stacked on #3633, so it cannot reach main until the PRs below it land.
Generated by Claude Code
Pull Request is not mergeable
Pull Request is not mergeable
56dbaad to
5ba4a41
Compare
5ba4a41 to
c00cba1
Compare
|
/ok to test c00cba1 |
c00cba1 to
e1949da
Compare
|
/ok to test e1949da |
Add env.nemo_gym.shards, common_overrides, and allowed_duplicate_entries, with validation and per-shard config composition. Actor creation remains in a later layer; sharded configs fail during setup until that factory is present. Reject top-level config paths and Gym entry overlays when shards are declared because their owning shard is ambiguous. Remove NeMo-RL-only sharding keys before forwarding the merged config to Gym. Add per-instance log-directory suffixing alongside the schema so actors that host the same server names do not append to the same files. Signed-off-by: Ananth Subramaniam <[email protected]>
Keep inherited Gym entry values in their parent recipe while assigning each entry to a shard explicitly. Single-shard plans claim all remaining entries automatically because their scope is unambiguous. Signed-off-by: Ananth Subramaniam <[email protected]>
Keep dict-shaped rollout and tokenizer settings out of the Gym server-entry inventory because NeMo RL consumes them separately. Signed-off-by: Ananth Subramaniam <[email protected]>
e1949da to
cd2a29d
Compare
|
/ok to test cd2a29d |
Summary
Defines the configuration used to split one NeMo-Gym stack across several Ray actors. This PR validates and composes shard configurations but does not create multiple actors yet.
nemo_rl/environments/nemo_gym_shards.pyadds:ShardSpec, which describes one named configuration slice, its inherited entries, explicit overrides, replicas, CPU allocation, and optional port range.ShardPlan, which describes shared entries, shared overrides, duplicate-entry allowances, and placement settings for the complete stack.parse_shard_plan(), which validates shard ownership and preserves the unchanged unsharded fallback.apply_shard_overlay(), which composes the Gym configuration for one shard.apply_shard_log_dir(), which gives each shard instance a separate log directory.A one-shard plan automatically owns unclaimed entries. A multi-shard plan must assign each Gym entry exactly once through
inherited_overlaysorcommon_inherited_overlays. Missing, duplicate, and unknown claims fail with the resolved entry inventory. NeMo RL integration settings such aseffort_levelsandtokenizer_configare excluded from that inventory.Configuration precedence is deterministic: inherited values, then
common_overrides, then shard-specificoverrides. A non-null top-levelconfig_pathsvalue is rejected because each path must belong to a specific shard. Explicit port ranges use Gym's inclusive bounds and must stay within ports 1 through 65535.Example
Stack
This PR depends on #3633. Multi-actor creation follows in #3371.