Skip to content

[rl] Spread rollout workers over the job's hosts - #5925

Closed
felipemello1 wants to merge 1 commit into
felipemello1/tb-oss/2-rollouter-configfrom
felipemello1/rollout-placement/2-spread-workers
Closed

felipemello1 wants to merge 1 commit into
felipemello1/tb-oss/2-rollouter-configfrom
felipemello1/rollout-placement/2-spread-workers

Conversation

@felipemello1

@felipemello1 felipemello1 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary (human-written)

Agent details

TLDR: In a multi-host job, rollout workers can now run on every host except the controller's, instead of all on the controller's host. This is opt-in for now: Rollouter.Config.workers_on_controller_host=False turns it on. The default, True, keeps today's placement until a matched multi-node run passes.

With workers_on_controller_host=False the rollout workers spread over the job's hosts other than trainer host 0; True keeps them all on host 0.

True (default), as before:  controller host: controller, router, batcher, W rollout workers (envs, agents, HTTP servers)
False:                      controller host: controller, router, batcher
                            every other host: about W / (hosts - 1) rollout workers
Either way, the workers see no GPU.

Problem

  1. Every rollout worker is a CPU process on the controller's host (spawn_cpu_procs).
  2. With the stack below, a worker holds its Verifiers env, its agents and the HTTP server they call.
  3. So all agent work of a job lands on one host, whatever the job's size.
  4. On main, the Verifiers env of DAPO Math with 2 generators already uses 10.6 cores and 28 GiB (RSS P50) on that host: one agent subprocess per running rollout, ~238 MiB each.

Solution

  1. rollout_worker_hosts lists every job host but trainer host 0, where the Slurm launcher runs the controller.
  2. spawn_rollout_workers spawns one proc mesh per host, splits the workers evenly (5 workers on 3 hosts: 2, 2, 1) and starts them with CUDA_VISIBLE_DEVICES="".
  3. workers_on_controller_host picks the placement. True, the default for now, keeps every worker on the controller's host. TODO at the field: default to False once a matched multi-node run (workers home vs spread) passes.
  4. The Search-R1 recipes set True (their retriever listens on 127.0.0.1 of the controller's host), and so do the Terminal-Bench recipes (their containers run on the controller's Docker). So they stay home after the flip.
  5. One-node runs keep every worker on this host either way. The router, the controller loops and the batcher don't change.
  6. Docs: the Verifiers README's "Hosts" bullet says that workers see no GPU, and which calls cross hosts when they spread. The Terminal-Bench README says what each worker host then needs: Docker, the task images and outbound network while grading.
  7. The CPU check counts the hosts that run workers. Controller.__init__ checks only workers on the controller's host. Spread workers are checked in spawn_rollout_workers, before any worker spawns (the GPU meshes are already up): the busiest host gets ceil(workers / hosts), against this host's CPUs (a job's hosts are one machine type).
  8. stop_rollout_workers stops every host's workers: a host whose stop fails is logged with its traceback, and the other hosts still stop.
# torchtitan/rl/actors/monarch/system.py, spawn_rollout_workers
hosts = rollout_worker_hosts(None if on_controller_host else self._host_meshes)
max_workers_per_host = math.ceil(num_workers / len(hosts))
if not on_controller_host and max_workers_per_host > num_cpus:
    raise ValueError(...)  # before any worker spawns: raise rollouter.rollouts_per_worker
for host_index, host in enumerate(hosts):
    num_host_workers = num_workers // len(hosts) + (host_index < num_workers % len(hosts))
    procs = host.spawn_procs(per_host={"cpus": num_host_workers},
                             bootstrap_command=default_bootstrap_cmd().with_env(ROLLOUT_WORKER_ENV))

NOTE:

  • To turn spreading on, set workers_on_controller_host=False in the recipe's Rollouter.Config.
  • Not run on a real multi-node job yet, so spreading is opt-in. Tested with simulated hosts (ProcessJob); a local 50-step run is below.
  • With spreading on and fewer workers than hosts, only the first hosts after trainer host 0 get workers (trainer hosts first): 4 workers on a 9-host job use hosts 1-4. TODO at rollout_worker_hosts: consider generator hosts first.
  • One dead worker process still ends the job (Monarch's default fault hook), as today. TODO in spawn_rollout_workers.
  • TODO at the pick in run_group_rollouts: before groups of tens of GB (1M-token rollouts, 128 per group), reserve each group's bytes per worker host, or pick the worker by bytes.
  • A worker's own log lines stay on its host. The controller logs how many workers run on each host.
  • Workers get their host's environment: export the secrets an env reads in the submit shell, which every job host inherits (launcher.env is logged with the config).
  • An image dataset needs its files on every worker host: TokenEnv reads each image by path in the rollout worker, and Geometry3K writes its images on the controller's host. So it spreads only with a shared image_dir. SLAKE reads its images from data_dir the same way, so it spreads only if every worker host has that folder. The workers_on_controller_host docstring names image files.

Results

Local 50-step DAPO Math run: Qwen3-4B-Base, trainer TP2 + 2 generators on one 4-GPU host, 4 rollout
workers. Steps 3-50, the stack below vs this PR with spreading on (workers_on_controller_host=False),
the workers on 2 simulated hosts (ProcessJob):
                                  stack below (home)   this PR (spread)
  step time P50                       15.9 s              17.6 s     (responses 10% longer)
  trainer tokens/s per GPU P50        6,110               5,933
  worker CPU per rollout              1.50 CPU-s          1.51 CPU-s (agents included)
  router + Monarch hop P50            6.3 ms              7.2 ms
  Both arms ran before look-aside routing reached main, when the router forwarded each generate call.
  50 steps, no errors; 2 workers per simulated host, log ranks 0-3, no GPU visible in workers or agents.
  Both arms' worker CPU includes ~0.53 CPU-s per rollout from a local test setup (an older openai reached
  the agents through PYTHONPATH); upstream main's agents cost 0.92. The step-1 delta (+0.01) is unaffected.
NOTE: the run above was measured on this PR's earlier base; it was not re-run on this one.
CPU suites at this commit (tests/rl/unit_tests/cpu, the renderer and config tests; Verifiers 0.4.1):
  986 passed, 1 skipped

Test plan

pytest tests/rl/unit_tests/cpu/test_shutdown.py tests/rl/unit_tests/cpu/test_rollouter_pool.py
pytest tests/rl/unit_tests/cpu tests/unit_tests/cpu/components/test_renderer.py tests/unit_tests/cpu/config   # 986 passed, 1 skipped
  • test_too_many_spread_workers_for_one_host_raise_before_any_worker_spawns: spreading on, more workers than one host's CPUs. The controller's check skips them; the spawn raises before any worker starts.
  • test_the_controller_checks_host_cpus_only_for_workers_on_its_host[True|False]: 24 workers on 8 CPUs raise when the workers run on the controller's host (True), and build when they are spread (False).
  • test_rollout_workers_spread_over_the_hosts_of_a_job[False|True] (real Monarch): 4 simulated hosts started with CUDA_VISIBLE_DEVICES=99, 5 workers. With on_controller_host=False they go 2-2-1 to the 3 hosts that are not trainer host 0, with log ranks 0-4, and none sees a GPU. With True all 5 stay on this host. With ROLLOUT_WORKER_ENV = {} both cases fail. Both cases also check that stop_rollout_workers closes all 5 workers.
  • test_the_other_hosts_stop_when_one_worker_mesh_fails_to_stop: 3 worker meshes, the second one's stop raises. The other 2 still stop, and "Rollout worker mesh 1 stop failed" is logged.
  • test_setup_sets_up_every_worker_and_close_closes_each_before_the_stop: the Rollouter passes workers_on_controller_host to the actor system. Its config sets False, so the test fails if setup_async hardcodes True.
  • test_rollout_worker_hosts_are_every_host_but_trainer_host_0 (4 cases) and test_rollout_worker_hosts_takes_this_host_meshes.
  • test_rollout_worker_actor_builds_its_worker_and_inits_its_logger: mesh rank 2 on a host whose first worker is worker 4 logs as rank 6.

Stack (15 PRs, bottom first; merging a PR also merges every PR below it; this PR in bold)

# PR What
1 Run Verifiers groups in rollout workers Verifiers groups run in rollout workers; the env server stays
2 Rollouts that fail outside the policy are recorded, not trained a failed rollout no longer drops its group
3 Rollouter: least-loaded placement; the controller sizes the pool from rollouts_per_worker least-loaded placement; the pool size follows the rollouts in flight
4 Rollout workers get generate_fn and release_session_fn once, at setup; the rollouter closes each worker before it stops them generator functions at setup; workers close before they stop
5 Verifiers: each example is an installed package; its name is the taskset id taskset ids are package names
6 Verifiers: each rollout worker runs its Verifiers envs; the env server is gone the env runs in the worker (Verifiers 0.4.0)
7 Verifiers: the generation server keeps one session per trace sessions; 1 GiB requests; the renderer refuses overlong prompts
8 Verifiers 0.4.1 and renderers 0.2.0 both pins move
9 Verifiers: only a rollout that Verifiers finished cleanly trains the failure rule
10 Verifiers README: terms, concurrency and sandboxes README only: terms, concurrency, sandboxes
11 Verifiers: time each rollout's sandbox start, setup, agent, model, finalize and scoring per-phase time metrics
12 Terminal-Bench: terminal_bench_env_config takes the package that exports the taskset a package argument for launchers outside the repo
13 Spread rollout workers over the job's hosts opt-in: rollout workers on the other hosts
14 Terminal-Bench: run each task in its image's WORKDIR and grade with task.toml timeouts Terminal-Bench task fixes
15 Rollout workers, the router and the controller report their CPU and memory each step per-role CPU and memory metrics

Alone on main, not in this stack: "Validation reads each prompt at most once; ValidationConfig.steps defaults to -1" and "Terminal-Bench 35B-A3B recipe: Dist-MoE in both roles, FULL CUDA graph generators, DAPO loss".

@pytorch-bot pytorch-bot Bot added the ciflow/rl label Nov 7, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 7, 2026
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude review

@claude

claude Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 3m 4s —— View job


Needs discussion: this changes where rollout workers run in every multi-host job by default, and it hasn't been run on a real multi-node job yet. See the review.

@claude claude 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.

Verdict: Needs discussion -- This changes where rollout workers run in every multi-host launcher job by default. It hasn't run on a real multi-node job, and nothing shows the controller host is a bottleneck today. Maintainers should decide whether it lands default-on before that evidence exists.

What this PR does. With a launcher's host_meshes, spawn_rollout_workers spreads the pool over every job host except trainer host 0. It spawns one CPU proc mesh per host, assigns workers to the first hosts first, and starts them with CUDA_VISIBLE_DEVICES="". Rollouter.Config.workers_on_controller_host=True keeps the old placement. The Search-R1 and Terminal-Bench recipes set it. Log ranks are offset per host.

Example.

Slurm: trainer 16 GPUs (hosts t0,t1), generators 2 x 8 GPUs (g0, g1), 8 GPUs/node
                                      t0 (controller)          t1   g0   g1
worker_pool_size=4, before            ctrl+router+batcher+4    -    -    -
worker_pool_size=4, after             ctrl+router+batcher      2    1    1
worker_pool_size=2, after             ctrl+router+batcher      1    1    0
workers_on_controller_host=True       ctrl+router+batcher+4    -    -    -
(every worker in every row after the change: CUDA_VISIBLE_DEVICES="")

Must fix

  1. The "Summary (human-written)" section is empty.
  2. torchtitan/rl/actors/monarch/README.md:26 -- says to put secrets in launcher.env, which is logged and saved with the config (inline).

Should consider

  • torchtitan/rl/actors/monarch/system.py:199 -- workers now see no GPU in one-node runs too, so "One-node runs don't change" is inaccurate (inline).
  • torchtitan/rl/controller/controller.py:1067 -- a TODO for a frame cap that already applies on the base branch: drive-by in core (inline).
  • torchtitan/rl/actors/monarch/rollout_worker.py:46, provisioning.py:298 -- speculative TODOs (os.nice, MALLOC_ARENA_MAX) with no observed problem; drop them (inline).

Questions

  • Default. The motivation is resource use (10.6 cores and 28 GiB on the controller host for DAPO Math with 2 generators), not a measured slowdown. A typical 8-GPU node has well over 10 cores. The simulated run doesn't settle it either: step time went from 15.9 s to 17.6 s with responses 10% longer, and tokens/s per GPU dropped about 3%. Can you show one real multi-node run where spreading helps? Until then, could the default stay on the controller host, with spreading as the opt-in?
  • provisioning.py:312 -- "the controller is on trainer host 0" depends on SlurmJob giving the first mesh in Layout.mesh_nodes the allocation's first node, which runs the batch script. Does Monarch guarantee that ordering? If it doesn't, the controller's host also gets workers and one job host gets none. Placement would be suboptimal but the job would still run.
Details
  • Checked, no problems found: dedup of shared meshes by id; the hosts[1:] or [this_host()] fallback when every role is on host 0; this_host() meshes passed by a Controller subclass (flatten("hosts")); the uneven split, including hosts that get 0 workers; first_worker_index keeping log ranks unique; stop_rollout_workers stopping every mesh.
  • MonarchActorSystem is the only ActorSystem implementation, and the fake in test_rollouter_pool.py is updated, so the new required on_controller_host argument has no other callsite to update.
  • Recipes that spread by default: dapo_math, alphabet_sort, verifiers_dapo_math. The Verifiers container watchdog exits cleanly on hosts without Docker, so DAPO Math doesn't need Docker on worker hosts.

Not verified: Monarch SlurmJob node-to-mesh ordering; whether same-host channels have the same 10 GiB frame cap; any real multi-node behavior.

Comment thread torchtitan/rl/actors/monarch/README.md Outdated
| `rdma_microbatch.py` | `MonarchRDMAMicrobatch`, the `RDMAMicrobatch` (`rl/trainer/rdma_microbatch.py`) on Monarch RDMA buffers: the batcher keeps a microbatch's large tensors and each trainer rank reads its column. |
| `rollout_worker.py` | `RolloutWorkerActor`, a rollout worker in the controller-host CPU pool. |
| `provisioning.py` | Proc meshes: the trainer and generator GPU meshes (`spawn_proc_mesh`, `PerHostProvisioner`), CPU procs on the controller host (`spawn_cpu_procs`), and the Monarch client's `shutdown`. |
| `rollout_worker.py` | `RolloutWorkerActor`, one rollout worker process. With a launcher, the workers spread over every job host but trainer host 0, the controller's (`rollout_worker_hosts`), with no GPU visible; `Rollouter.Config.workers_on_controller_host` keeps them on the controller host. A worker gets its host's environment, not the controller's runtime changes, so set the secrets its env reads in `launcher.env`. |

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.

"set the secrets its env reads in launcher.env" contradicts MonarchLauncher.Config.env (launcher/base.py:136-138): that field is part of the config the controller may log and save, so secrets must stay out of it and go in the submit shell. Under SlurmLauncher, every node gets the submit environment (--export=ALL). Users who follow this README line will write API keys into saved configs. Point at the submit shell instead, e.g. "...so export the secrets its env reads in the submit shell (every job host inherits it), not in launcher.env, which is logged with the config."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reply from claude: This PR is replaced by the fresh draft "[rl] Spread rollout workers over the job's hosts (opt-in)". The comments here were read when planning it. Closing this one.

Comment thread torchtitan/rl/controller/controller.py Outdated
Comment on lines +1067 to +1069
# TODO: a group crosses here, and in the worker's `run_group` reply, as one Monarch
# message, which torchmonarch caps at 10 GiB (`codec_max_frame_length`). Send larger
# groups per rollout, or as RDMA handles to their arrays.

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.

This TODO describes a limit this PR doesn't change. On the base branch, groups already cross from worker processes to the controller and the batcher as Monarch messages, so the frame cap applies there too (unverified that same-host and cross-host channels share the same codec_max_frame_length). If the cap is already there, this is a drive-by TODO in core controller.py. Either move it to its own PR, or show what changes when the message crosses hosts.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reply from claude: This PR is replaced by the fresh draft "[rl] Spread rollout workers over the job's hosts (opt-in)". The comments here were read when planning it. Closing this one.

Comment on lines +46 to +47
# TODO: os.nice(10), inherited by agent subprocesses, so ranks on a shared host win CPU
# fights; decide from a multi-node run.

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.

This is an idea to evaluate later, not a known limitation or a workaround ("decide from a multi-node run"). The same goes for the MALLOC_ARENA_MAX TODO at provisioning.py:298-299 ("Not measured on a long run yet"). Speculative TODOs build up and won't be revisited. Drop both, and add them back with the measurement that shows they're needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reply from claude: This PR is replaced by the fresh draft "[rl] Spread rollout workers over the job's hosts (opt-in)". The comments here were read when planning it. Closing this one.

procs = host.spawn_procs(
per_host={"cpus": num_host_workers},
bootstrap_command=default_bootstrap_cmd().with_env(ROLLOUT_WORKER_ENV),
)

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.

Now every rollout worker gets CUDA_VISIBLE_DEVICES="", including on the controller's host and in one-node runs. On the base branch, spawn_cpu_procs workers inherit the host's GPUs. So the description's "One-node runs don't change" isn't accurate: a RolloutWorker whose env uses a GPU (e.g. a local reward model) now fails on a single node too. The change is probably what you want. Say so in the description, and in the ROLLOUT_WORKER_ENV comment, which currently only argues for trainer and generator hosts.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reply from claude: This PR is replaced by the fresh draft "[rl] Spread rollout workers over the job's hosts (opt-in)". The comments here were read when planning it. Closing this one.

@felipemello1
felipemello1 added this pull request to stack #5878 November 7, 2026 06:02
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: round 1 is in 0a82ba8e4 (after 87c2aa5ef, which merges 1/3's fixes).

  • README: a worker env's secrets go in the submit shell, which every job host inherits; launcher.env is logged with the config.
  • ROLLOUT_WORKER_ENV's comment now says workers see no GPU on a one-node run too, and what that costs (an env that needs a GPU in the worker can't run there). The description's "One-node runs don't change" is corrected.
  • Dropped the os.nice and MALLOC_ARENA_MAX TODOs and the frame-cap TODO at add_group (the cap applies before this PR too). 2/3 no longer touches controller.py.
  • Slurm host order: Monarch's SlurmJob._state gives the meshes the allocation's hostnames in order (monarch/_src/job/slurm.py:450-469, torchmonarch 0.7.0), and SLURM runs the batch script, the controller, on the allocation's first node. Monarch doesn't promise this in an API, so the TODO at rollout_worker_hosts (let a launcher name the controller's host) stays. If the order ever differs, the controller's host gets workers and one host gets none; the job still runs.
  • Default-on vs opt-in: the next push makes spreading opt-in (workers_on_controller_host=True by default) until a matched multi-node run passes; flipping the default later is one line. I'll re-tag after that push.
  • The human-written summary is the author's to write.

RL CPU suite at 0a82ba8e4: 564 passed, 8 skipped; with Verifiers 0.4.1 installed: 641 passed, 2 skipped. pyrefly: 0 errors.

@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: round 2 is in 50140f370 (opt-in), then 411fa4214, which merges 1/3's round-2 fixes.

  • Spreading is opt-in, as you suggested: workers_on_controller_host defaults to True, so workers stay on the controller's host. TODO at the field: default to False once a matched multi-node run (workers home vs spread) passes.
  • The Search-R1 and Terminal-Bench recipes still set True. It is redundant today, but it keeps them home after the flip, and their comments say why.
  • No test pins the default. The Rollouter test's config now sets False, so test_setup_spawns_and_sets_up_every_worker_and_close_stops_them fails if setup_async hardcodes True (checked: 1 failed with the hardcoded value).
  • The Monarch README, the Search-R1 README and the Terminal-Bench README say how to turn spreading on.
  • The local A/B in the description ran with spreading on (the flag set False).
  • The human-written summary is Felipe's to write.

RL CPU suite at 411fa4214: 565 passed, 8 skipped; with Verifiers 0.4.1: 642 passed, 2 skipped. pyrefly: 0 errors.

@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude review

@claude

claude Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 1m 28s —— View job


Approve: the only thing left is to fill in the human-written summary. See the review.

@claude claude 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.

Verdict: Approve -- please address the item below before merging. Spreading is now opt-in, so the default placement is the same as before. The only remaining item is the author's summary. A maintainer still needs to review.

What this PR does. It adds Rollouter.Config.workers_on_controller_host, which defaults to True. When it is False and a launcher passes host_meshes, spawn_rollout_workers splits the pool over every job host except trainer host 0, as one CPU proc mesh per host. Log ranks are offset per host. Every worker now starts with CUDA_VISIBLE_DEVICES="", whichever placement is used.

Example.

Slurm: trainer on t0,t1; generators on g0, g1; worker_pool_size=4
                                    t0 (controller)          t1  g0  g1
default (True), before and after    ctrl+router+batcher+4    -   -   -
workers_on_controller_host=False    ctrl+router+batcher      2   1   1
(all workers, either way: CUDA_VISIBLE_DEVICES="")

Must fix

  1. The "Summary (human-written)" section is still empty, and only the author can write it.

Earlier review, at HEAD

  • README secrets: fixed. It now points to the submit shell, not launcher.env.
  • One-node GPU visibility: the ROLLOUT_WORKER_ENV comment and the description now say workers see no GPU on one node too. I found no worker-side GPU use under rl/rollout, rl/envs or rl/examples.
  • Frame-cap TODO in controller.py, plus the os.nice and MALLOC_ARENA_MAX TODOs: removed.
  • Default: spreading is opt-in, and the TODO at the field says to flip it after a matched multi-node run.
  • Slurm host order: answered (SlurmJob._state order, plus the TODO at rollout_worker_hosts).
Details
  • Checked, no problems found: Layout.host_meshes gives roles that share a mesh the same object, so the id dedup in rollout_worker_hosts is correct. Trainer hosts come first because of dict insertion order, so hosts[1:] drops trainer host 0. The fallback when every role is on host 0, the split that skips hosts with 0 workers, first_worker_index and stop_rollout_workers over all meshes also check out.
  • MonarchActorSystem is the only ActorSystem implementation, and the test fake is updated, so the new required on_controller_host argument has no other callsite.
  • No in-repo recipe sets False yet. The knob is temporary by design: the next step is to flip the default after a multi-node run. The explicit True in the Search-R1 and Terminal-Bench recipes is redundant today. It is kept so those recipes stay on the controller host after the flip.

Not verified: real multi-node behavior, and Monarch's guarantee about Slurm node-to-mesh order.

@felipemello1
felipemello1 removed this pull request from stack #5878 November 8, 2026 19:07
@felipemello1
felipemello1 changed the base branch from felipemello1/rollout-placement/1-worker-handles to main November 8, 2026 19:08
@felipemello1
felipemello1 force-pushed the felipemello1/rollout-placement/2-spread-workers branch from 411fa42 to 4b1323c Compare November 8, 2026 19:08
@felipemello1
felipemello1 changed the base branch from main to felipemello1/rollout-placement/1-worker-handles November 8, 2026 19:09
@felipemello1
felipemello1 added this pull request to stack #5950 November 8, 2026 19:09
@felipemello1
felipemello1 force-pushed the felipemello1/rollout-placement/1-worker-handles branch from fd61570 to 555bfd8 Compare November 9, 2026 07:22
@felipemello1
felipemello1 force-pushed the felipemello1/rollout-placement/2-spread-workers branch from 4b1323c to 166f944 Compare November 9, 2026 07:22
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review. This push is a code-style pass over every file (docstrings, comments, names, tests), rebased on main 98bbfe1. No behavior change.

@claude

claude Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 1m 37s —— View job


Approve: the only thing left is to fill in the human-written summary. See the review.

@claude claude 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.

Verdict: Approve -- please address the item below before merging. I re-reviewed the diff at 166f944 and found no new problems. The default placement is unchanged (workers_on_controller_host=True), and the only blocker left is the author's summary. The code touches rl/actors/system.py and rl/rollout/rollouter.py, so a maintainer still needs to review.

What this PR does. It adds Rollouter.Config.workers_on_controller_host, which defaults to True. When it is False and a launcher passes host_meshes, spawn_rollout_workers splits the pool over every job host except trainer host 0, as one CPU proc mesh per host. Log ranks are offset per host by first_worker_index. Every worker starts with CUDA_VISIBLE_DEVICES="" under either placement. The controller logs how many workers run on each host, using a new hostname endpoint.

Example.

Slurm: trainer on t0,t1; generators on g0, g1; worker_pool_size=4
                                    t0 (controller)          t1  g0  g1
default (True), before and after    ctrl+router+batcher+4    -   -   -
workers_on_controller_host=False    ctrl+router+batcher      2   1   1
(all workers, either way: CUDA_VISIBLE_DEVICES="")

Must fix

  1. The "Summary (human-written)" section is still empty, and only the author can write it.

Should consider

  • torchtitan/rl/actors/monarch/provisioning.py:321 -- this comment, and one test docstring, say "dimension" for the mesh's "hosts" axis (inline).
Details
  • I couldn't fetch the previously reviewed commit (411fa4214) in this checkout, so I re-read the whole diff at HEAD instead of only the delta. It matches the round-2 design: opt-in default, TODO at the field, Search-R1 and Terminal-Bench recipes pinned to True through their shared _search_r1_rollouter_config / _terminal_bench_rollouter_config helpers, secrets kept in the submit shell rather than launcher.env, and the speculative TODOs gone.
  • Checked again, no problems found: the id dedup and insertion order in rollout_worker_hosts, and the hosts[1:] or [this_host()] fallback. The 4 parametrized cases in test_rollout_worker_hosts_are_every_host_but_trainer_host_0 match the docstring table. The ProcessJob test expects 2-2-1 onto trainer_1, generator_0_0 and generator_1_0. stop_rollout_workers gathers every mesh. spawn_cpu_procs is still used by the router and the batcher.
  • The new hostname endpoint is @concurrent_endpoint, as rl/README.md requires, and its only consumer is the startup log line. It costs one round trip per worker at setup.

Not verified: real multi-node behavior, and the Slurm node-to-mesh order (TODO at rollout_worker_hosts).

meshes = {
id(mesh): mesh for mesh in (host_meshes.trainer, *host_meshes.generators)
}.values()
# flatten: a launcher's mesh has a "hosts" dimension, but `this_host()` has 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.

Nit, since this push is a style pass: CLAUDE.md asks for "axis" when a comment means a specific DeviceMesh axis, and "dimension" only for tensors and mesh shape. The same applies to the test_rollout_worker_hosts_takes_this_host_meshes docstring ("no "hosts" dimension") in tests/rl/unit_tests/cpu/test_shutdown.py.

Suggested change
# flatten: a launcher's mesh has a "hosts" dimension, but `this_host()` has none.
# flatten: a launcher's mesh has a "hosts" axis, but `this_host()` has none.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reply from claude: Fixed in 1a68345: "axis" in this comment and in the test_rollout_worker_hosts_takes_this_host_meshes docstring.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reply from claude: This PR is replaced by the fresh draft "[rl] Spread rollout workers over the job's hosts (opt-in)". The comments here were read when planning it. Closing this one.

@felipemello1
felipemello1 force-pushed the felipemello1/rollout-placement/1-worker-handles branch from 555bfd8 to 17e4a94 Compare November 9, 2026 09:11
@felipemello1
felipemello1 force-pushed the felipemello1/rollout-placement/2-spread-workers branch from 166f944 to 1a68345 Compare November 9, 2026 09:11
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review. 1a68345: "dimension" -> "axis" in the comment and the test docstring.

@claude

claude Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 32s —— View job


Approve: the "dimension" -> "axis" fix is in. The only thing left is to fill in the human-written summary. See the review.

@claude claude 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.

Verdict: Approve -- please address the item below before merging. The earlier nit is fixed at 1a68345, and the rest of the diff has no new problems. The PR touches rl/actors/system.py and rl/rollout/rollouter.py, so a maintainer still needs to review it.

Since the last review

  • provisioning.py:321 and the test_rollout_worker_hosts_takes_this_host_meshes docstring now say "axis" for the mesh's "hosts" axis. Fixed.

Example (unchanged)

Slurm: trainer on t0,t1; generators on g0, g1; worker_pool_size=4
                                    t0 (controller)          t1  g0  g1
default (True), before and after    ctrl+router+batcher+4    -   -   -
workers_on_controller_host=False    ctrl+router+batcher      2   1   1
(all workers, either way: CUDA_VISIBLE_DEVICES="")

Must fix

  1. The "Summary (human-written)" section is still empty. Only the author can write it.
Details
  • The commit is a squash, so I re-read every changed line at HEAD rather than only the delta. The changes match the version reviewed last time, and the only difference I found is the two wording fixes.
  • The fake _FakeHostMesh.flatten(self, dim) in test_shutdown.py keeps upstream's parameter shape. It is a test double, and the rename rule doesn't apply to it.

Not verified: real multi-node behavior, and the order in which Slurm nodes map to meshes (TODO at rollout_worker_hosts).

@felipemello1
felipemello1 force-pushed the felipemello1/rollout-placement/1-worker-handles branch from 17e4a94 to d6f247a Compare November 9, 2026 12:18
@felipemello1
felipemello1 force-pushed the felipemello1/rollout-placement/2-spread-workers branch from 1a68345 to b0eeefa Compare November 9, 2026 12:18
@felipemello1
felipemello1 removed this pull request from stack #5950 November 9, 2026 17:31

@claude claude 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.

Verdict: Approve -- please address the item below before merging. The leftover _Worker.setup_async fake is gone at d2c5419, and the spread test still checks that all 5 workers close. Nothing else changed. The PR touches rl/actors/system.py and rl/rollout/rollouter.py, so a maintainer still needs to review it.

Since the last review

  • tests/rl/unit_tests/cpu/test_shutdown.py: _Worker now has only __init__ and close, the same as on the base branch. Fixed.
  • test_rollout_workers_spread_over_the_hosts_of_a_job still asserts len(closed-*) == 5 after stop_rollout_workers, under both placements. So it still guards the per-host mesh.stop() gather, and close is the only method RolloutWorkerActor.__cleanup__ calls on the fake.

Example (unchanged)

Slurm: trainer on t0,t1; generators on g0, g1; worker_pool_size=4
                                    t0 (controller)          t1  g0  g1
default (True), before and after    ctrl+router+batcher+4    -   -   -
workers_on_controller_host=False    ctrl+router+batcher      2   1   1
(all workers, either way: CUDA_VISIBLE_DEVICES="")

Must fix

  1. The "Summary (human-written)" section is still empty. Only the author can write it.
Details
  • I re-read every changed line at d2c5419. Apart from the deleted fake, it matches the version approved at 4d27c22. That covers rollout_worker_hosts (the id dedup and hosts[1:] or [this_host()]), the even split that skips hosts with 0 workers, first_worker_index, the hostname log line, stop_rollout_workers over every mesh, the __supervise__ TODO, and the TODO at the worker pick in run_group_rollouts.
  • Callsites of Rollouter.Config: Search-R1 and Terminal-Bench set True explicitly, the other recipes use the default (True), and no in-repo recipe sets False.

Not verified: real multi-node behavior, and the order in which Slurm nodes map to meshes (TODO at rollout_worker_hosts).

@felipemello1
felipemello1 removed this pull request from stack #6034 November 12, 2026 00:33
@felipemello1
felipemello1 changed the base branch from felipemello1/tb-oss/4-dist-moe-recipe to main November 12, 2026 00:34
@felipemello1
felipemello1 force-pushed the felipemello1/rollout-placement/2-spread-workers branch from d2c5419 to 903bb3a Compare November 12, 2026 00:35
@felipemello1
felipemello1 changed the base branch from main to felipemello1/tb-oss/4-dist-moe-recipe November 12, 2026 00:35
@felipemello1
felipemello1 added this pull request to stack #6040 November 12, 2026 00:36
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review. This push puts the stack on a draft copy of the look-aside router PR, rebased onto main (row 0, DO NOT REVIEW; it closes when the original lands). The generate answer now comes from the generator, so the docs and bodies say so; each body says not to merge while row 0 is under the stack.

@claude

claude Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 53s —— View job


Approve: the rebase onto row 0 left this PR's code unchanged. The only thing left is to fill in the human-written summary. See the review.

@claude claude 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.

Verdict: Approve -- please address the item below before merging. Rebasing the stack onto the look-aside router copy (row 0) didn't change this PR's code. The diff at 903bb3a matches the version approved at d2c5419. The PR touches rl/actors/system.py and rl/rollout/rollouter.py, so a maintainer still needs to review it.

Since the last review

  • The 12 changed files and their contents are the same as at d2c5419. That includes the _Worker fake, which still has only __init__ and close.
  • run_group_rollouts (rollouter.py:298-317) now hands each worker row 0's release_session_fn along with generate_fn. This PR doesn't touch that code. Its own TODO about reserving each group's bytes per worker host sits right above random.choice. With spreading on, a worker on another host calls generate_fn across hosts. That path is row 0's design, not this PR's.
  • The description now says its router-hop numbers come from before row 0, when the router still forwarded every generate call. It also says not to merge while row 0 is under the stack. Both statements are accurate.

Example (unchanged)

Slurm: trainer on t0,t1; generators on g0, g1; worker_pool_size=4
                                    t0 (controller)          t1  g0  g1
default (True), before and after    ctrl+router+batcher+4    -   -   -
workers_on_controller_host=False    ctrl+router+batcher      2   1   1
(all workers, either way: CUDA_VISIBLE_DEVICES="")

Must fix

  1. The "Summary (human-written)" section is still empty. Only the author can write it.
Details
  • Callsites at HEAD: MonarchActorSystem is still the only ActorSystem implementation. The test_rollouter_pool.py fake takes **kwargs. Search-R1 and Terminal-Bench set workers_on_controller_host=True explicitly, the other recipes use the default (True), and no in-repo recipe sets False.
  • Re-checked at HEAD, no problems: rollout_worker_hosts (the id dedup and hosts[1:] or [this_host()]), the even split that skips hosts with 0 workers, first_worker_index, the hostname log line, stop_rollout_workers over every mesh, and the __supervise__ TODO.

Not verified: real multi-node behavior (including cross-host generate_fn calls under look-aside routing), and the order in which Slurm nodes map to meshes (TODO at rollout_worker_hosts).

@felipemello1
felipemello1 force-pushed the felipemello1/tb-oss/4-dist-moe-recipe branch from 899817a to a3a1b86 Compare November 12, 2026 00:44
@felipemello1
felipemello1 force-pushed the felipemello1/rollout-placement/2-spread-workers branch from 903bb3a to b1380fa Compare November 12, 2026 00:44
@felipemello1
felipemello1 force-pushed the felipemello1/tb-oss/4-dist-moe-recipe branch from a3a1b86 to fbd67d7 Compare November 12, 2026 03:07
@felipemello1
felipemello1 force-pushed the felipemello1/rollout-placement/2-spread-workers branch from b1380fa to d90adad Compare November 12, 2026 03:07
@felipemello1
felipemello1 removed this pull request from stack #6040 November 12, 2026 07:00
@felipemello1
felipemello1 changed the base branch from felipemello1/tb-oss/4-dist-moe-recipe to main November 12, 2026 07:01
@felipemello1
felipemello1 force-pushed the felipemello1/rollout-placement/2-spread-workers branch from d90adad to d1a9e9c Compare November 12, 2026 07:02
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review. The stack is reordered: Verifiers groups in workers, then Verifiers 0.4.1, then worker placement come first (the stack table shows the new rows). It is also rebuilt with three reviewed passes: a code-style pass over every changed file, the rewritten placement docs (the VerifiersRollouter docstring and the two Verifiers READMEs; the old SVG is deleted), and the 3 newest main commits. No behavior change from the passes.

@claude

claude Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 1m 8s —— View job


Approve: the reorder and the three passes change no behavior, and the new docstring lines match the code. The human-written summary still needs filling in. See the review.

@claude claude 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.

Verdict: Approve -- please address the item below before merging. The reorder and the three passes change no behavior. The only new content is three lines in the VerifiersRollouter docstring, and they match the code. The PR touches rl/actors/system.py and rl/rollout/rollouter.py, so a maintainer still needs to review it.

Since the last review

  • The diff at d1a9e9c has 13 files. The extra file compared with 903bb3a is torchtitan/rl/examples/verifiers/rollouter.py (+3): "Workers see no GPU", and, with workers_on_controller_host=False, the workers, watchdogs and containers move to host 1, so run_group and the router calls cross hosts but generate doesn't. That is accurate for the docstring's two-host example: rollout_worker_hosts drops host 0, so host 1 is the only worker host, and under look-aside routing the worker's GenerationServer calls the generators on host 1 directly. The watchdogs are sh children of each worker, so they move with it.
  • The other 12 files match the version approved at 903bb3a, apart from the style pass and the BaseRolloutWorker.Config signatures. The verifiers README and the deleted SVG aren't in this PR's diff, so they come from a lower PR in the stack.

Example (unchanged)

Slurm: trainer on t0,t1; generators on g0, g1; worker_pool_size=4
                                    t0 (controller)          t1  g0  g1
default (True), before and after    ctrl+router+batcher+4    -   -   -
workers_on_controller_host=False    ctrl+router+batcher      2   1   1
(all workers, either way: CUDA_VISIBLE_DEVICES="")

Must fix

  1. The "Summary (human-written)" section is still empty. Only the author can write it.
Details
  • I re-checked these at HEAD and found no problems: rollout_worker_hosts (the id dedup, trainer hosts first, hosts[1:] or [this_host()]), the even split that skips hosts with 0 workers, first_worker_index, the hostname log line (@concurrent_endpoint), stop_rollout_workers over every mesh, the __supervise__ TODO, and the TODO at the worker pick in run_group_rollouts.
  • Callsites: MonarchActorSystem is the only ActorSystem implementation. Rollouter.setup_async passes on_controller_host. Search-R1 and Terminal-Bench set workers_on_controller_host=True explicitly, the other recipes use the default (True), and no in-repo recipe sets False.
  • The _Worker fake in test_shutdown.py still has only __init__ and close.

Not verified: real multi-node behavior (including cross-host generate_fn calls when generators and workers share no host), and the order in which Slurm nodes map to meshes (TODO at rollout_worker_hosts).

@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review. The stack is rebased onto main (the look-aside router PR merged), and the PRs below this one are updated.

@claude

claude Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 49s —— View job


Approve: rebasing onto main left this PR's diff unchanged at d802efc. The human-written summary still needs filling in. See the review.

@claude claude 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.

Verdict: Approve -- please address the item below before merging. The rebase onto main, which now includes the look-aside router, left this PR's diff the same as the version approved at d1a9e9c. The PR touches rl/actors/system.py and rl/rollout/rollouter.py, so a maintainer still needs to review it.

Since the last review

  • The 13 changed files at d802efc match d1a9e9c line for line. The only differences are in the context lines that come from main.
  • On main, run_group_rollouts (rollouter.py:272-283) passes generate_fn and release_session_fn to the worker. This PR adds only the TODO above random.choice, which sits where it did before.
  • The VerifiersRollouter docstring lines this PR adds ("Workers see no GPU", and "run_group and the calls to the router cross hosts; generate does not") still agree with the docstring above them on main: the worker's GenerationServer calls router.reserve, then calls generate on the generator it got.
  • The description no longer mentions row 0 and says the router-hop numbers predate look-aside routing. Both statements are accurate.

Example (unchanged)

Slurm: trainer on t0,t1; generators on g0, g1; worker_pool_size=4
                                    t0 (controller)          t1  g0  g1
default (True), before and after    ctrl+router+batcher+4    -   -   -
workers_on_controller_host=False    ctrl+router+batcher      2   1   1
(all workers, either way: CUDA_VISIBLE_DEVICES="")

Must fix

  1. The "Summary (human-written)" section is still empty. Only the author can write it.
Details
  • Callsites at HEAD: MonarchActorSystem is the only ActorSystem implementation, and Rollouter.setup_async passes on_controller_host. Search-R1 and Terminal-Bench set workers_on_controller_host=True explicitly, the other recipes use the default (True), and no in-repo recipe sets False. self._host_meshes is still set in MonarchActorSystem.__init__.
  • Re-checked at HEAD, no problems: rollout_worker_hosts (the id dedup, trainer hosts first, and hosts[1:] or [this_host()]), the even split that skips hosts with 0 workers, first_worker_index, the hostname log line (@concurrent_endpoint), stop_rollout_workers over every mesh, and the __supervise__ TODO. The _Worker fake still has only __init__ and close.

Not verified: real multi-node behavior (including cross-host generate_fn calls when workers and generators share no host), and the order in which Slurm nodes map to meshes (TODO at rollout_worker_hosts).

@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review

@claude

claude Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 1m 45s —— View job


Approve: the per-host CPU check at spawn time and the stop that keeps going when one host fails are both correct, and the human-written summary still needs filling in. See the review.

@claude claude 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.

Verdict: Approve -- please address the item below before merging. Since d802efc, the PR adds two things: a per-host CPU check at spawn time for spread workers, and a stop that keeps stopping the other hosts when one host's stop fails. Both are correct. The default placement is unchanged (workers_on_controller_host=True). The PR touches rl/actors/system.py, rl/rollout/rollouter.py and rl/controller/controller.py, so a maintainer still needs to review it.

What this PR does. It adds Rollouter.Config.workers_on_controller_host, which defaults to True. When it is False and a launcher passes host_meshes, spawn_rollout_workers splits the pool over every job host except trainer host 0, with one CPU proc mesh per host. Every worker starts with CUDA_VISIBLE_DEVICES="" under either placement.

Since the last review

  • controller.py:607: Controller.Config.num_rollout_workers now checks CPUs only when workers_on_controller_host is True. Spread workers are checked in MonarchActorSystem.spawn_rollout_workers (system.py:197-203) as ceil(workers / hosts) against this host's CPUs. That covers the one-node case with False too: rollout_worker_hosts returns [this_host()], so the check compares all the workers against this host's CPUs, and test_too_many_spread_workers_for_one_host_raise_before_any_spawns guards it.
  • system.py:241-250: stop_rollout_workers gathers every mesh's stop with return_exceptions=True and logs each failure. This matches how Rollouter.close handles worker close failures (rollouter.py:262-267), and the new test checks that the other meshes still stop.
  • The base is now the Terminal-Bench package PR. The recipe change goes through the public terminal_bench_rollouter_config, and still sets True.

Example (unchanged)

Slurm: trainer on t0,t1; generators on g0, g1; worker_pool_size=4
                                    t0 (controller)          t1  g0  g1
default (True), before and after    ctrl+router+batcher+4    -   -   -
workers_on_controller_host=False    ctrl+router+batcher      2   1   1
(all workers, either way: CUDA_VISIBLE_DEVICES="")

Must fix

  1. The "Summary (human-written)" section is still empty. Only the author can write it.

Should consider

  • torchtitan/rl/actors/monarch/system.py:194-196 -- "before any spawns" is inaccurate. The trainer and generator meshes are already up when this check runs (inline).
Details
  • Re-checked at 31f2a65, no problems: rollout_worker_hosts (the id dedup, trainer hosts first, hosts[1:] or [this_host()]), the even split that skips hosts with 0 workers, first_worker_index, the hostname log line (@concurrent_endpoint), and the __supervise__ TODO. The _Worker fake still has only __init__ and close.
  • Callsites: MonarchActorSystem is the only ActorSystem implementation, and Rollouter.setup_async passes on_controller_host. Search-R1 and Terminal-Bench set True explicitly, and no in-repo recipe sets False.
  • The spawn-time check can't move to config time: the host count is known only from host_meshes. The wording nit is the only thing it needs.

Not verified: real multi-node behavior, the order in which Slurm nodes map to meshes (TODO at rollout_worker_hosts), and whether every job host has the same CPU affinity as the controller under Slurm.

Comment thread torchtitan/rl/actors/monarch/system.py Outdated
Comment on lines +194 to +196
# `Controller.Config.num_rollout_workers` checks workers on the controller's host. Spread
# workers are checked here, before any spawns. A job's hosts are one machine type (the
# launcher's `gpus_per_node` assumes it too), so this host's CPU count stands for each.

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.

Nit: "before any spawns" overstates how early this check runs. Controller.setup_async (controller.py:814-869) spawns the trainer, the generators, the router and the batcher before it calls Rollouter.setup_async. So with workers_on_controller_host=False, too many workers per host raises only after the GPU meshes are up. The config-time check skips them now (controller.py:607). The check can't run at config time anyway, because the host count isn't known there. The description item 7 and the test name ..._raise_before_any_spawns say the same thing. Say "before any worker spawns" in all three places:

Suggested change
# `Controller.Config.num_rollout_workers` checks workers on the controller's host. Spread
# workers are checked here, before any spawns. A job's hosts are one machine type (the
# launcher's `gpus_per_node` assumes it too), so this host's CPU count stands for each.
# `Controller.Config.num_rollout_workers` checks workers on the controller's host. Spread
# workers are checked here, before any worker spawns (the GPU meshes are already up). A
# job's hosts are one machine type (the launcher's `gpus_per_node` assumes it too), so this
# host's CPU count stands for each.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reply from claude: Fixed: the comment now says "before any worker spawns", and the CPU check counts each host that runs workers.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reply from claude: This PR is replaced by the fresh draft "[rl] Spread rollout workers over the job's hosts (opt-in)". The comments here were read when planning it. Closing this one.

@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: This PR is replaced by the fresh draft "[rl] Spread rollout workers over the job's hosts (opt-in)". The comments here were read when planning it. Closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/rl CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant