Why simulator.num_nodes=4 still builds a 48-node data plane

NVIDIA-NeMo/RL #4914. All permalinks pin the PR head daee7636.

Before
No simulator existed. A training run sets its node count with cluster.num_nodes=…, and every value computed from it follows.
This PR
Adds simulator.num_nodes, which overwrites cluster.num_nodes after the config's ${…} values are already filled in.
Status
Open — not fixed in this PR. Raised in review comment C33.

Two pages on this PR — this one: the config-loading bug.

Recipes compute some values from the node count. The base recipe sets num_storage_units: ${mul:2, ${cluster.num_nodes}}: two data-plane storage units per node. _load_config fills in every ${…} first (to_container(resolve=True)). Only after that does apply_simulator_overrides write the simulator's node count, and nothing computes the derived values again.

Same recipe, three ways to ask for 4 nodes

Recipe: super-120B quick SC: cluster.num_nodes 48, vLLM nodes 32, num_storage_units ${mul:2, ${cluster.num_nodes}} A · this PR: simulator.num_nodes=4 B · training: cluster.num_nodes=4 C · proposed fix CLI overrides applied cluster.num_nodes = 48 CLI overrides applied cluster.num_nodes = 4 OmegaConf.update, before resolve cluster.num_nodes = 4 to_container(resolve=True) num_storage_units = 2×48 = 96 to_container(resolve=True) num_storage_units = 2×4 = 8 to_container(resolve=True) num_storage_units = 2×4 = 8 apply_simulator_overrides nodes 48 → 4, vLLM 32 → 4 (no simulator step) apply_simulator_overrides no longer touches num_nodes 4 nodes, 96 storage units (24 per node) 4 nodes, 8 storage units (2 per node) 4 nodes, 8 storage units (2 per node) data plane differs from the training run it should copy matches a 4-node training run

The same happens to every other key derived from the node count, such as Gym's num_processes: ${mul:64, ${cluster.num_nodes}}. The PR's smoke test and its usage example use 1-node recipes with num_nodes=1, so neither shows the problem.

The fix, as pseudocode (proposed, not run)

Where the fix lands: RL only. entrypoint_utils._load_config sets the node count before resolving, and apply_simulator_overrides drops its node-count branch. num_steps can stay where it is: no shipped recipe computes anything from max_num_steps.

Load the config, before

# driver process, once at startup
sim = _load_simulator_config(...)            # simulator.num_nodes = 4
config = load_config(recipe) + CLI overrides
raw = to_container(config, resolve=True)   # every ${…} filled in: storage units = 2×48
apply_simulator_overrides(raw, sim)               # cluster.num_nodes = 4, storage units still 96

Load the config, after (proposed)

# driver process, once at startup
config = load_config(recipe) + CLI overrides
sim = _load_simulator_config(...)                 # unchanged
if sim.num_nodes:
    OmegaConf.update(config, "cluster.num_nodes", sim.num_nodes)
    OmegaConf.update(config, "…colocated.resources.num_nodes", sim.num_nodes)  # vLLM nodes, non-colocated only
raw = to_container(config, resolve=True)          # storage units = 2×4 = 8
apply_simulator_overrides(raw, sim)               # steps, validation, load_format; no node count

Plus a unit test: a recipe key x: ${cluster.num_nodes} with simulator.num_nodes=4 must give x == 4.

🔴 review comment C33 — entrypoint_utils.py:140

So what. Fitting a big recipe onto a few nodes is the main reason to run this simulator. Today that run gets the big recipe's data-plane layout (96 storage units on 4 nodes, not 8), so the rollout timing it reports is not what a 4-node training run would see. Setting cluster.num_nodes directly on the command line avoids the problem until the order is fixed.