NVIDIA-NeMo/RL #5158 ยท all links pinned to head 824c116
environment_server_routes. Every prompt group of that taskset runs on the same agent harness.env.nemo_gym.multi_harness: a taskset lists several servers, and each prompt group picks one of them by hashing its group ID onto the weights.Three pages on this PR, one question each. This one: what the new route does next to the old one.
Both paths end the same way: RL writes the chosen server name into the row as
row["_ng_environment_server"],
and Gym sends the row to that server. The only new step is how the name is chosen.
get_nemo_gym_route_name
now checks multi_harness first. For a listed taskset it calls
select(taskset, group_id).
That hashes the group ID to a number in [0, 1) and finds which harness's slice of the weights it lands in.
The hash needs no saved state, so the driver, every Gym actor and every retry pick the same server.
Green border = new in this PR. Blue dashed = where the two paths become one. The hash values are real outputs of select()'s formula for these group IDs. The bar shows each harness's share of the weights; a group goes to the slice its hash lands in.
Pick a server for one row โ after (the before is the last two lines alone)
# driver, and again on each Gym actor before the row is sent def route(row): taskset = row.task_id.taskset if multi_harness.covers(taskset): u = sha256("v1" + row.group_id)[:8] / 2**64 # same group โ same u everywhere return slice_of(u, weights_of(taskset)).server # weights keyed by agent TYPE return environment_server_routes[taskset] # the old path, unchanged
Real code: get_nemo_gym_route_name, MultiHarnessRoutes.select.
Startup โ new
# driver, once, after the Gym actors are up infos = actor.describe_environment_servers(listed) # each actor reads its own Gym config routes = resolve_multi_harness(cfg, infos) # one agent type per server; types must differ for a in actors: a.set_multi_harness_routes(routes) # driver and actors share one table
Real code: _install_multi_harness_routes.
environment_server_routes | multi_harness.routes | |
|---|---|---|
| Servers per taskset | one | several, one per harness |
| Who picks | the config | hash of the group ID, weighted by agent type |
| Metric names | swe/reward/mean | swe/<agent>/reward/mean; no swe/reward/โฆ key |
| Startup checks | route exists | each server runs one agent; servers of a taskset run different agent types, one server type, one verifier |
| Resume | nothing new | with token capture, a restored group must land on the same agent type, or the run stops |
Both stay: a taskset with one harness keeps the simple route, and a taskset goes in exactly one of the two (setup refuses both).