Skip to content

[WIP] [rl] Prompt image files share the rollout worker's torch transport pool - #6334

Draft
wwwjn wants to merge 1 commit into
wwwjn/data-plane/6b-rdma-groupsfrom
wwwjn/data-plane/5b-shared-rdma-pool
Draft

wwwjn wants to merge 1 commit into
wwwjn/data-plane/6b-rdma-groupsfrom
wwwjn/data-plane/5b-shared-rdma-pool

Conversation

@wwwjn

@wwwjn wwwjn commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Human note: TODO (Jiani)
6334_hybrid

TLDR: Prompt image files move from Monarch RDMABuffer onto the NIXL pool that #6469 uses for large rollout groups, so rollout workers run one RDMA stack. One file at a time on one CPU host, the pool reads 5 MB in 7.4 ms (Monarch 15.4) and keeps/releases a group's files in 1.6/0.04 ms (3.0/1.0). On A100 (a busy shared host), per-call image read p50 rises from 38-54 to 101-111 ms, 0.6-0.7% of a 16 s generate call, and rollout worker RSS drops from 3.0 to 2.5-2.6 GB. Against sending the files by value (the default), the pool does not gain on one host either: a generate call takes 16.1-16.3 s p50 both ways.

# PR Independent? Needs
0 RDMA object for microbatches and prompts (#5862) yes -
1 Rollout workers compute and record each group's rollouts (#6301) yes - (stacked on 0 for merge order only)
2 Split the batcher into a metadata half and a bytes half (#6302) yes 0 (its batcher code)
3 Trainer DP replica leaders read their rollouts from the rollout workers and pack them (#6303) no 1, 2
4 Read the next step's rollout groups during the optimizer step (#6324) no 3
5 Trainer leaders read large rollout groups by RDMA over torch transport (#6469) no 3 (stacked on 4 for merge order only)
6 Prompt image files share the rollout worker's torch transport pool (#6334, this PR) no 5

Merge bottom-up.

Problem

  1. With rdma_min_image_bytes set, a rollout worker keeps each large prompt image file as a Monarch RDMABuffer (MonarchRDMAObject, [WIP][rl] One RDMA object for microbatches and prompts; rollout workers send images as RDMA handles #5862); generator rank 0 reads it.
  2. With rdma_min_group_bytes set, [WIP] [rl] Trainer leaders read large rollout groups by RDMA over torch transport #6469 keeps each large rollout group in a NIXL-registered pool (RDMAByteBuffers); the DP replica leaders read slices of it.
  3. So a worker with both knobs runs two RDMA stacks: the RDMAObject protocol with its Monarch implementation (216 lines), and a torch transport module.

Solution

  1. RDMAImageFiles copies each file of at least rdma_min_image_bytes into the worker's RDMAByteBuffers once per group, keyed by PromptImage.hash_value; release() returns them after the group's last generate call, before the group is kept (RolloutGroupStore.keep).
  2. Each allocation gets a generation (RDMAByteBuffers.allocate), and the worker writes a (group_id, generation) tag before and after each file, as on group regions. A file's head tag is the buffer's first 16 bytes, and a serialized group zeroes the bytes before its first region ([WIP] [rl] Trainer leaders read large rollout groups by RDMA over torch transport #6469), so a group that reuses a file's buffer overwrites the file's head tag. RDMAPrompt.read(buffers) reads all kept files in one RDMAByteBuffers.read call and raises on a reused buffer.
  3. With the images knob set, generator rank 0 needs NIXL: at setup it makes a torch transport and reads every worker's probe (Generator.check_rdma_probes); a failed or hung read fails setup.
  4. BaseRolloutWorker makes one RDMAByteBuffers when either knob is set, shares it between RDMAImageFiles and its RolloutGroupStore, and makes the setup probe every reader reads (make_rdma_probe). The store logs rollout_worker/pool_bytes, pool_bytes_in_use and pool_registrations with every training group, with either knob.
  5. Deleted: rl/transport/rdma_object.py (RDMAObject, RegisterRDMAObject), rl/actors/monarch/rdma_object.py (MonarchRDMAObject) and their test file. RDMAPrompt and RDMAImageFiles move to rl/transport/torch_transport_rdma.py. Net production code: +80 lines.
  6. Unchanged: both knobs' names and meaning, the knob-off paths, the bytes the generator gets, and how groups are kept and read. With only rdma_min_group_bytes set, two things change: the leaders' setup probe now runs with the generators', after the engine loops start (a generator answers only once its engine is built), so a broken trainer path fails setup later; and every training group carries the pool metrics, not only the ones kept in registered memory.
before:  worker --image--> Monarch RDMABuffer          <-- generator rank 0
         worker --group--> RDMAByteBuffers pool (NIXL) <-- DP replica leaders
after:   worker --image--> RDMAByteBuffers pool (NIXL) <-- generator rank 0 (whole files)
         worker --group--> the same pool               <-- DP replica leaders (slices)

Results

Monarch (#6324) -> this PR (pool): Qwen3.5-0.8B Geometry3K, 2048 px, 16 x 8, A100, 4 GPUs, 12 steps, medians of
steps >= 3, rdma_min_image_bytes = 1 MiB (every file) and rdma_min_group_bytes = 1; both on two lanes at once,
then lanes swapped. CPU bench (earlier head, image path unchanged): one host, one file at a time.
CPU bench, read one 5 MB file, p50     15.4 -> 7.4 ms
CPU bench, keep/release 5 MB files     3.0/1.0 -> 1.6/0.04 ms per group
image read per generate call, p50      37.5 -> 101.3 ms (swapped: 54.2 -> 110.9)
generate call, p50                     16.2 -> 16.0 s (swapped: 16.0 -> 17.3)
step                                   21.23 -> 20.31 s (swapped: 20.66 -> 20.90)
rollout worker RSS (max over workers)  2.99 -> 2.63 GB (swapped: 3.01 -> 2.49)
rollout_worker/pool_bytes/max          144 -> 158 MB (swapped: 131 -> 137)
images by value -> in the pool, this head, same recipe, both with rdma_min_group_bytes = 1, two lanes, then swapped:
generate call, p50                     16.06 -> 16.12 s (swapped: 16.14 -> 16.33)
image read per generate call, p50      none -> 97.0 ms (swapped: 84.6)
step                                   20.49 -> 21.09 s (swapped: 21.52 -> 20.73)
rollout worker RAM (max over workers)  2.44 -> 2.51 GiB (swapped: 2.50 -> 2.46)
correctness vs main 076f2e88b (rl_grpo_qwen3_0_6b_varlen_batch_invariant, seed 42, deterministic, 10 steps):
  62/62 non-timing tags equal at trainer TP 2 with rdma_min_group_bytes on (this head);
  63/63 at PP 2 x FSDP 2 and 62/62 at TP 2, knob off and on (an earlier head; since then only setup probes and tests changed)
Geometry3K 2048 px with both knobs, this head: 10 steps; generator rank 0 probes every worker at setup and reads every
  file over NIXL; rollout_worker/pool_bytes 145 MB, trainer/rdma_read_bytes 75.6 MB per leader per step

NOTE:

Test plan

  • pytest tests/rl/unit_tests/cpu: 830 passed, 8 skipped, 4 failed, with nixl ([WIP] [rl] Trainer leaders read large rollout groups by RDMA over torch transport #6469: 828; -3 test_rdma_object.py, +3 test_torch_transport_rdma.py, +2 test_rdma_rollout_group.py). The 4 also fail on main 076f2e88b (770 passed): recipe tests whose torch_checkpointing.storage.fsspec_storage import fails locally.
  • pytest tests/rl/unit_tests/gpu/test_cp_images.py (2 A100s, this head): 4 passed.
  • test_torch_transport_rdma.py: test_a_read_after_the_worker_reused_the_files_buffer_raises fails without the tag check; in test_a_probe_read_that_fails_raises_at_setup the message names the reader and the knob.
  • test_rdma_rollout_group.py::test_a_file_read_after_a_serialized_group_reused_its_buffer_raises: a smaller group takes the file's buffer; fails (no raise) without [WIP] [rl] Trainer leaders read large rollout groups by RDMA over torch transport #6469's zeroed padding.

@wwwjn

wwwjn commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@claude review

@claude

claude Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @wwwjn's task in 3m 33s —— View job


Needs discussion -- review posted; leans toward this design once generator rank 0's NIXL is probed at setup.

@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 -- the PR is an explicit maintainers' choice between two designs. I'd lean toward this one: one RDMA stack, the CUDA-context workaround goes away, and it deletes code. But first it should fail at setup when generator rank 0 can't use NIXL.

What this PR does. With rdma_min_image_bytes set, a rollout worker used to keep large prompt image files as Monarch RDMABuffers. Now it copies them into the same NIXL RDMAByteBuffers pool that #6323 uses for packed groups. Each file is laid out as | tag | file | tag |, where the tag is (group_id, generation). Generator rank 0 reads the files on a single reader thread, with a transport it creates lazily. This deletes the RDMAObject protocol, its Monarch implementation, and the GPU 0 CUDA context each worker made.

Example. A 5 MB image, group of 8, 2 turns:

before: worker: RDMABuffer(file) + a CUDA context on GPU 0 (~250 MiB per worker)
        rank 0: 16 Monarch reads; worker: drop() deregisters after the last call
after:  worker: pool.allocate(5 MB + 32) -> tagged copy, one handle shared by all 16 prompts
        rank 0: 16 NIXL reads on one thread (tags checked); worker: release() -> free list, stays registered
        same group's pack: may reuse that buffer if the size class matches

Must fix

  1. PR description: the human-written summary is still TODO (Jiani), and the commit title says "(prototype)". Also, "A generator without NIXL fails on its first kept image file" is not what happens (see 2).
  2. torchtitan/rl/generator/generator.py:468 -- nothing checks at setup that generator rank 0 has NIXL. A missing NIXL or a broken RDMA path doesn't fail the run: _run_single_rollout catches the error and marks every image rollout ERROR. Fix: extend the existing RDMAProbe gate to the images knob and probe from each generator's rank 0.

Should consider

  • torchtitan/rl/rollout/rollouter.py:430 -- the two pool users keep separate generation counters and duplicate tag structs, so (group_id, generation) is not unique within the shared pool. Let allocate stamp a generation on each handle instead; this deletes code.
  • tests/rl/unit_tests/cpu/test_torch_transport_rdma.py:380 -- the NIXL image test duplicates existing loopback and NIXL coverage; delete it.

Questions

  • The pool never shrinks. Image buffers used to be freed per group; now they stay registered at their per-size-class peak, so worker CPU registered memory rises. The results report only GPU memory. Can you report the rollout workers' pool_bytes / RSS? And with only the images knob on, nothing logs the pool metrics: they are emitted from RolloutGroupBuffers.pack.
  • With both knobs on, each image file is copied into the pool twice per group: once as an RDMAImageFile and again as the packed group's image regions. Was keeping the file buffers until the group's release, and pointing PackedRolloutGroupHandle.image_regions at them, considered? That would finish the "one pool" idea, but it needs handles that span several buffers.
Details
  • Gate: the problem is real (two RDMA stacks in one worker, plus a ~250 MiB per-worker CUDA-context hack on GPU 0). Building on torch transport matches principle 3 (PyTorch-native). Net production LoC is negative. The cost is a NIXL dependency on generator rank 0, and slower p50 reads (17-26 ms vs 12 ms) from one GIL-bound reader thread, about 0.1% of a generate call. That is a maintainer judgment.
  • The RDMAImageFile docstring says the release order rules out a read racing a reuse. That holds today only because nothing cancels a generate call (controller.py:734). If that changes, the failure mode is worse than with Monarch. A torn read (old tags, new middle) passes the tag check, and the engine would store the result in _pixel_values_lru_cache under hash_value (vllm/engine.py:479-491). With Monarch, a read of a dropped buffer errors. Worth a TODO next to the existing one, not a blocker.
  • Pool thread-safety: every worker-side use (_keep, release, pack, probe) runs on the actor's event loop thread. The generator side runs on one dedicated thread. Consistent with "Use from one thread at a time".

Not verified: cross-host NIXL image reads (not measured in the PR either); worker CPU memory growth.


def _read_prompt_on_reader_thread(self, prompt: RDMAPrompt) -> Prompt:
if self._image_file_buffers is None:
self._image_file_buffers = RDMAByteBuffers()

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 PR adds a new requirement: generator rank 0 needs NIXL. But nothing checks for it at setup, and when it's missing the run doesn't fail the way the description says ("fails on its first kept image file").

What happens instead: the ValueError from RDMAByteBuffers() here, or a read failure on a host that reports RDMA but can't transfer (the case RDMAProbe exists for), goes back through generate to _run_single_rollout. That function catches Exception (rollouter.py:720), logs it and marks the rollout ERROR. So every rollout with an image file >= rdma_min_image_bytes errors, and training keeps going on whatever is left. That breaks principle 8 (unsupported config -> clear error at setup).

Smallest fix: reuse the existing probe.

  • In controller.py:858, gate the probe on rdma_min_image_bytes is not None or rdma_min_group_bytes is not None.
  • When the images knob is set, also send the probes to each generator's rank 0 through a small check_rdma_probes endpoint. That endpoint builds _image_file_buffers on the reader thread and calls check_rdma_probes.
  • Make check_rdma_probes's message name the reader role and the knob, not only "trainer DP replica leader" / rdma_min_group_bytes.

Building the transport at setup also takes the NIXL init and connect cost off the first generate call.

Comment thread torchtitan/rl/rollout/rollouter.py Outdated
rdma_byte_buffers if config.rdma_min_image_bytes is not None else None
)
# Tags each group's kept image files (`RDMAImageFiles`), so a stale read is caught.
self._image_file_generations = itertools.count(1)

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.

Two users now share one pool, but each keeps its own tag counter: this _image_file_generations, and RolloutGroupBuffers._generations (packed_group_handle.py:117). They also have duplicate struct.Struct("<qq") tags (_IMAGE_FILE_TAG, _REGION_TAG).

Both counters start at 1 and tag with the same group_id. And the normal next user of a released image buffer is the same group's packed buffer, since run_group releases the files right before finish_rollout_group packs. So (group_id, generation) no longer names one use of a pooled buffer, which is what both docstrings promise. Catching a stale read now depends on the two counters drifting apart and on where the region tags land, not on how the tag is built.

Simpler and unique by construction: let the pool stamp each allocation. Add e.g. RDMAByteBuffer.generation = next(counter) in RDMAByteBuffers.allocate, and have both users tag with handle.generation. This deletes:

  • this counter;
  • the group_id / generation params of RDMAImageFiles and fields of RDMAImageFile;
  • RolloutGroupBuffers._generations;
  • one of the two tag structs.



@requires_nixl
def test_nixl_image_file_reaches_the_reader_as_a_handle() -> 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.

This test duplicates coverage that already exists.

  • RDMAImageFiles / RDMAPrompt.read don't depend on the transport, and the loopback tests above already cover them: keep once, release, tags.
  • A whole-buffer NIXL read of a pooled buffer is already covered by the existing requires_nixl tests, e.g. test_nixl_reads_new_bytes_from_reused_buffers_without_registering.

If no regression would get past those, delete this one (.claude/rules/tests.md: no duplicate coverage).

@wwwjn
wwwjn force-pushed the wwwjn/data-plane/5b-shared-rdma-pool branch from 1addde2 to 0d370c2 Compare November 23, 2026 20:35
@wwwjn
wwwjn force-pushed the wwwjn/data-plane/5b-shared-rdma-pool branch from 0d370c2 to 5ac68e6 Compare November 23, 2026 21:20
@wwwjn

wwwjn commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@claude review again

@claude

claude Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @wwwjn's task in 1m 44s —— View job


Needs discussion -- re-review posted: the round-1 fixes resolve the earlier blocker, the human-written summary is still TODO, and there are two small new should-considers.

@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 -- the round-1 commit resolves the earlier blocker. This PR versus #6323 is still a maintainers' call. I'd still lean toward this PR, once the author writes the human summary.

What changed since the last review (5ac68e6).

  • The pool stamps each allocation with a generation (RDMAByteBuffer.generation). Image files and group regions now tag with it through one shared REGION_TAG.
  • Generator rank 0 now reads every worker's probe at setup.
  • The pool metrics are now logged with either knob.
  • The TODO on the cancel race is added.
  • The duplicate NIXL image test is removed.

Example (the tag fix). One group, both knobs on, with the file and the packed group in the same size class:

before: file buffer   tag (7, 1)   <- the worker's image-file counter
        packed group  tag (7, 1)   <- the group counter, same buffer   -> a stale file read passes the tag check
after:  file buffer   tag (7, 41)  <- pool allocation #41
        packed group  tag (7, 42)  <- pool allocation #42             -> a stale file read raises

Earlier findings

  • Resolved: generator rank 0's NIXL fails at setup. The setup probe now runs Generator.check_rdma_probes through InterGeneratorRouter, under the same timeout as the leaders, and the error names the reader and the knob.
  • Resolved: the tags are unique within the shared pool (the per-allocation generation). This also deletes both callers' counters and one of the two tag structs.
  • Resolved: the duplicate NIXL image test is deleted.
  • Answered: the description now reports worker RSS and pool_bytes, and gives the reason for the second copy.
  • Still open: the "Summary (human-written)" section is still TODO (Jiani). The author has to write it; an agent must not fill it in.

Should consider (new)

  • torchtitan/rl/generator/generator.py:326 -- the comment still says the transport is made on the first kept prompt. It is now made by the setup probe.
  • torchtitan/rl/torch_transport_rdma.py:232 -- pool_metrics puts rollout_worker/... keys and a stateful registration counter into the generic transport. Its only consumer is the worker actor, so build the metrics there.
Details
  • Probe placement: the probe now runs after generator_start_engine_loop, so a broken group path is reported after the vLLM engine build, not before it. That is needed for the generator probe (a generator answers only once its engine is built). For the leaders, it only delays the error, which is acceptable.
  • PackedRolloutGroupHandle.generation and RDMAImageFile.generation are now properties over buffer.generation on frozen slots dataclasses. They aren't annotated, so they don't become fields, and pickling over Monarch carries buffer.generation. No other RDMAByteBuffer(...) construction exists besides allocate.
  • check_rdma_probes_within_timeout uses one reader label for all generators ("Rank 0 of a generator"), because InterGeneratorRouter.check_rdma_probes gathers them. A hang therefore doesn't say which generator. A read failure (not a hang) still names the host through check_rdma_probes. Fine for a setup check.

Not verified: cross-host NIXL reads from generator rank 0; the setup probe on a multi-generator run.

Comment thread torchtitan/rl/generator/generator.py Outdated
Comment on lines +326 to +327
# transport reads block, and one transport serves one thread. The transport is made on
# the first such prompt, so runs without kept files never start NIXL here.

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 comment went stale in the round-1 commit. With rdma_min_image_bytes set, the transport is now made at setup by check_rdma_probes, not on the first kept prompt. A reader who trusts the comment would expect the NIXL init cost on the first generate call.

Suggested change
# transport reads block, and one transport serves one thread. The transport is made on
# the first such prompt, so runs without kept files never start NIXL here.
# transport reads block, and one transport serves one thread. The transport is made by
# the setup probe (`check_rdma_probes`), so runs without the images knob never start NIXL.

Comment thread torchtitan/rl/torch_transport_rdma.py Outdated
# other process reads it, so replacing it (unregistering the old one) is safe.
self._staging: tuple[torch.Tensor, Memory] | None = None

def pool_metrics(self) -> list[m.Metric]:

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.

RDMAByteBuffers is the generic transport. The trainer leaders and generator rank 0 use it too. But this method hard-codes rollout_worker/... metric keys, makes the transport module import observability.metrics, and gives every instance a _num_registrations_logged counter that only the worker actor uses. The name also hides a side effect: every call resets the registration delta, so a second caller would see 0.

The only consumer is RolloutWorkerActor (rollout_worker.py:135). Build the three metrics there from self._rdma_byte_buffers.pool, and keep the counter on the actor. That keeps the transport module free of rollout concepts, and this method and its import go away.

@wwwjn

wwwjn commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@claude review again

@claude

claude Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @wwwjn's task in 44s —— View job


Needs discussion -- re-review posted: round 2 fixes both earlier should-considers and adds nothing new; what's left is the human-written summary and the maintainers' choice between this PR and #6323.

@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 -- round 2 resolves both should-considers from the last review and adds no new problems. What's left is the maintainers' choice between this PR and #6323, plus the human-written summary, which only the author can write.

What changed since the last review (5ac68e6 -> 5fd8564).

  • pool_metrics has moved out of RDMAByteBuffers and into RolloutWorkerActor._pool_metrics, along with its registration counter. torch_transport_rdma.py no longer imports observability.metrics or has rollout_worker/... keys.
  • The comment on the generator's image-file reader now says the setup probe creates the transport.
  • The metrics test moved with the code, from test_torch_transport_rdma.py to test_rollouter_pool.py. Its assertions are the same.

Example (where the metrics live).

before: RDMAByteBuffers.pool_metrics()      -> rollout_worker/* keys in the generic transport,
                                               used by leaders and generator rank 0 too
after:  RolloutWorkerActor._pool_metrics()  -> reads self._rdma_byte_buffers.pool;
                                               the counter is on the actor, its only consumer

Must fix

  1. PR description: the "Human note" / human-written summary is still TODO (Jiani). The author has to write it, not an agent.

Earlier findings

  • Resolved: the stale reader-thread comment at torchtitan/rl/generator/generator.py:325.
  • Resolved: rollout metrics no longer live in the generic transport (torchtitan/rl/actors/monarch/rollout_worker.py:142).
  • Resolved earlier and still in place at HEAD: the setup probe on generator rank 0, per-allocation generation tags, and deletion of the duplicate NIXL test.
Details
  • _pool_metrics runs only from run_group's training path, on the actor's event-loop thread, so the read-and-reset of _num_pool_registrations_logged has a single caller, as the old method did.
  • The moved test builds the actor with object.__new__ and sets two private fields. That ties it to __init__'s attribute names, but it is the smallest way to test the delta reset without building a worker. It isn't worth churning.
  • The decision between designs is unchanged from the previous two reviews. This PR runs one RDMA stack and deletes the RDMAObject / Monarch code. Its costs are a NIXL dependency on generator rank 0 (now checked at setup) and slower p50 image reads (17-34 ms vs 12 ms, about 0.1-0.2% of a generate call).

Not verified: cross-host NIXL reads from generator rank 0; the setup probe on a multi-generator run.

@wwwjn
wwwjn force-pushed the wwwjn/data-plane/5b-shared-rdma-pool branch from 5fd8564 to 29779f5 Compare November 24, 2026 17:53
@wwwjn
wwwjn force-pushed the wwwjn/data-plane/5b-shared-rdma-pool branch from 29779f5 to 67c225b Compare November 24, 2026 20:05
@wwwjn

wwwjn commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@claude review again

@claude

claude Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @wwwjn's task in 1m 18s —— View job


Needs discussion -- re-review posted: the rebase and the new commit (67c225b, comment only) add nothing new to fix; still open are the human-written summary and the maintainers' choice between this PR and #6323.

@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 round adds nothing new to fix. Two things are still open: the maintainers' choice between this PR and #6323, and the human-written summary, which only the author can write.

What changed since the last review.

  • The stack was rebased onto a base that has one more commit, 93aef80, which changes only the rdma_min_group_bytes docstring.
  • The PR's first three commits look the same as at the last review. I re-read the full diff at HEAD and found no change from the merge.
  • New commit 67c225b changes only a comment. RolloutWorkerActor.make_rdma_probe (torchtitan/rl/actors/monarch/rollout_worker.py:163) now names both readers of the probe: every trainer DP replica leader when rdma_min_group_bytes is set, and rank 0 of each generator when rdma_min_image_bytes is set. That matches the controller's gate at controller.py:943-305.

Example (who reads the probe at setup, from the controller).

rdma_min_group_bytes set  -> Trainer.check_rdma_probes on each DP replica leader
rdma_min_image_bytes set  -> InterGeneratorRouter.check_rdma_probes -> Generator.check_rdma_probes on each rank 0
both set                  -> both, gathered under one rdma_probe span; each read has its own 60 s timeout

Must fix

  1. PR description: the "Human note" is still TODO (Jiani). The author has to write the human-written summary; an agent must not.

Earlier findings

  • Still resolved at HEAD:
    • the setup probe on generator rank 0;
    • generation tags stamped per allocation (RDMAByteBuffer.generation, shared REGION_TAG);
    • the pool metrics on the worker actor (_pool_metrics), logged with either knob;
    • the reader-thread comment;
    • the TODO on the cancel race;
    • the duplicate NIXL test is deleted.
Details
  • Rebase check: the base's knob docstring still says "Setup reads a probe from each worker on each leader" (rollouter.py:385). That is still true for the groups knob. This PR's rdma_min_image_bytes docstring covers generator rank 0, so the two don't contradict each other.
  • The description says the Results ran before #6323 took its read-ahead commits. Read-ahead changes only when trainer leaders read group columns. Image files are read by generator rank 0 and released before the group is packed, so the comparison still holds. Nothing in this diff interacts with read-ahead.
  • The design choice is unchanged from earlier rounds. This PR runs one RDMA stack and deletes RDMAObject / MonarchRDMAObject (235 lines). Its costs are a NIXL dependency on generator rank 0, now checked at setup, and slower p50 image reads: 17-34 ms vs 12 ms, about 0.1-0.2% of a generate call.

Not verified: cross-host NIXL reads from generator rank 0; the setup probe on a multi-generator run.

@wwwjn
wwwjn added this pull request to stack #6362 November 24, 2026 20:15
@wwwjn
wwwjn removed this pull request from stack #6362 November 24, 2026 22:25
@wwwjn
wwwjn removed this pull request from stack #6467 December 1, 2026 21:17
@wwwjn
wwwjn changed the base branch from wwwjn/data-plane/6-read-ahead to wwwjn/data-plane/6b-rdma-groups December 1, 2026 21:17
@wwwjn
wwwjn force-pushed the wwwjn/data-plane/5b-shared-rdma-pool branch from 8955c73 to 95cbed0 Compare December 1, 2026 21:17
@wwwjn
wwwjn added this pull request to stack #6471 December 1, 2026 21:18
@wwwjn
wwwjn force-pushed the wwwjn/data-plane/5b-shared-rdma-pool branch from 95cbed0 to 828272a Compare December 1, 2026 21:29
@wwwjn
wwwjn force-pushed the wwwjn/data-plane/5b-shared-rdma-pool branch from 828272a to bba9829 Compare December 1, 2026 22:31
@wwwjn
wwwjn force-pushed the wwwjn/data-plane/5b-shared-rdma-pool branch from bba9829 to 346fce0 Compare December 1, 2026 22:50
@wwwjn wwwjn changed the title [rl] Prompt image files share the rollout worker's torch transport pool [WIP] [rl] Prompt image files share the rollout worker's torch transport pool Dec 1, 2026
@wwwjn

wwwjn commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

from claude: Rebased onto #6301's new head 6e2d4ba, where each rollout worker records its own groups (recorder_lines is gone, so nothing here carries recorder lines anymore). Built on the latest heads of this stack. RL CPU suite: same 4 local env failures as before; 10-step bitwise run with one validation: all non-timing TensorBoard tags and the recorded rollouts match #5862. @claude review

@claude

claude Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @wwwjn's task in 2m 59s —— View job


Needs discussion -- re-review posted: the rebase onto #6469 / #6301 is sound and the new [0:16] group tag closes the stale-file case; one mechanical must-fix (test-only rdma_byte_buffers kwarg), plus the maintainers' call on NIXL vs Monarch for images now that reads measure 2-2.7x slower.

@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 -- the code is sound after the rebase. What's left is a maintainer call: should NIXL replace Monarch for prompt image files, given that image reads are now measured at 2.7-2.0x slower per call (101 vs 38 ms p50) and #5862 lands the Monarch path first?

What changed since the last review (314f9be). The PR is rebased onto #6469 (#6323 is closed), and #6301's new head no longer has recorder_lines; nothing here referenced them. Since the previous head, the code changes are:

  • The pool moved from RolloutWorkerActor into BaseRolloutWorker, which builds it when either knob is set.
  • RolloutGroupStore takes an optional pool (rdma_min_group_bytes None, images only) and logs the pool metrics with every kept group.
  • The probe is now made by BaseRolloutWorker.make_rdma_probe.
  • A serialized group now also stamps its tag at bytes [0:16] of its buffer. A new test covers this.

I re-read the full production diff (+466/-373 in torchtitan/*.py, +93 net) and the test diff.

Example (why the [0:16] stamp is needed). A 4x-sized image file is released, and a smaller serialized group of the same size class takes its buffer:

file use:   [0:16] (1, gen 1) | file ............................ | (1, gen 1)
group use:  [0:16] ???        | pad | (1,2) rollouts (1,2) |  (old file bytes, untouched) ... (1, gen 1)
before: both of the file's tags survive -> a stale file read passes with a torn middle
after:  the group writes (1, gen 2) at [0:16] -> the stale read raises

The reverse case is also caught: an image file writes contiguously from byte 0, so any stale group region it overlaps loses its head tag.

Must fix

  1. torchtitan/rl/rollout/rollouter.py:482 -- only a test passes the new rdma_byte_buffers kwarg on BaseRolloutWorker / MessageEnvRolloutWorker. Delete it and monkeypatch in the test (inline).

Earlier findings

All still resolved at HEAD:

  • the setup probe on generator rank 0 (controller.py:958-998);
  • the per-allocation generation with one shared REGION_TAG;
  • the pool metrics, logged with either knob (now in RolloutGroupStore._keep);
  • the reader-thread comment and the cancel-race TODO;
  • the duplicate NIXL test, which is gone.

No leftovers of the deleted path (RDMAObject, register_rdma_object, _REGION_TAG, check_rdma_probes_on_leaders) anywhere in torchtitan/ or tests/.

Questions

  • With this PR, does rdma_min_image_bytes beat sending images by value at all? The knob's docstring now says the crossover "is not measured yet". The Results compare only against Monarch, and per-call reads went from 38 to 101 ms. Without a knob-off row on the same run, a user has no basis to set this knob.
Details
  • Overlap search: gh pr list --search "rdma_min_image_bytes" finds only #5862 and this PR. #6323 is closed; its group path now lives in #6469, the base.

  • The design trade, updated to the new numbers:

    • for: one RDMA stack instead of two, -216 lines of RDMAObject / Monarch code, worker RSS 3.0 -> 2.5-2.6 GB;
    • against: generator rank 0 needs NIXL (checked at setup), per-call image reads are 2-2.7x slower (0.6-0.7% of a generate call), and the pool's registered memory grows 4-10%.
    • Step-time deltas (21.23 -> 20.31, swapped 20.66 -> 20.90) flip sign between lanes, so they are noise.
    • Landing #5862's Monarch image path and then deleting it here is the maintainers' call.
  • Behavior change with only rdma_min_group_bytes set:

    • the leader probe now runs after generator_start_engine_loop, so a broken trainer path fails later in setup;
    • every training group carries the pool metrics, not only the ones kept in registered memory.

    Both are stated in the description. pool_registrations is a Sum of per-call deltas, so logging it on more groups doesn't double-count it.

  • run_group releases the files in finally, after the TaskGroup exits. The only cancellation path is stop_rollout_workers at shutdown (rollouter.py:281), and it cancels the controller-side call, not the generator's read. So the existing TODO still describes the only race.

  • Pre-existing in #6469, not this PR: alignment padding inside a serialized group is never written. When a smaller group reuses a larger group's buffer, a stale region whose head tag falls in the new group's padding keeps its tags. This PR's image-file writes are contiguous, so they don't add such a case.

Not verified: cross-host NIXL reads from generator rank 0; the setup probe on a multi-generator run.

Before merge: fill in the human-written summary.

Comment thread torchtitan/rl/rollout/rollouter.py Outdated
Comment on lines +482 to +491
rdma_byte_buffers: RDMAByteBuffers | None = None,
) -> None:
if config.rdma_min_image_bytes is not None and register_rdma_object is None:
raise ValueError(
"rdma_min_image_bytes is set, but no register_rdma_object was given: the "
"rollout worker must run in an actor system that provides RDMA."
)
self._rdma_min_image_bytes = config.rdma_min_image_bytes
self._register_rdma_object = register_rdma_object
self._rdma_min_group_bytes = config.rdma_min_group_bytes
# Used only from the event loop's thread.
if rdma_byte_buffers is None and (
config.rdma_min_image_bytes is not None
or config.rdma_min_group_bytes is not None
):
rdma_byte_buffers = RDMAByteBuffers()

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.

Only one caller passes this kwarg, and it's a test: test_rollout_worker.py:498, which needs a loopback pool. RolloutWorkerActor builds the worker without it (rollout_worker.py, worker_config.build(**worker_kwargs)), and so does VerifiersRolloutWorker. MessageEnvRolloutWorker.__init__ (line 786) only forwards it. In production the worker always makes its own pool, so the kwarg and the "made here unless given" branch have no production consumer (.claude/rules/design.md: every new symbol needs a current consumer).

Smallest fix:

  • Drop the parameter from both __init__s.
  • Build the pool unconditionally: self._rdma_byte_buffers = RDMAByteBuffers() if (image knob or group knob) else None.
  • In the test, monkeypatch.setattr("torchtitan.rl.rollout.rollouter.RDMAByteBuffers", lambda: worker_buffers).
  • Also drop "made here unless given" from the class docstring at line 413.

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.

from claude: Dropped the kwarg from both __init__s: the worker builds its pool when either knob is set, the test monkeypatches rollouter.RDMAByteBuffers, and the class docstring no longer says "made here unless given". cf6cee8

@wwwjn
wwwjn force-pushed the wwwjn/data-plane/5b-shared-rdma-pool branch from 346fce0 to ef681ab Compare December 2, 2026 00:07
@wwwjn
wwwjn force-pushed the wwwjn/data-plane/5b-shared-rdma-pool branch from ef681ab to cf6cee8 Compare December 2, 2026 00:43
@wwwjn

wwwjn commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

from claude: @claude review

This round (cf6cee8): the test-only rdma_byte_buffers kwarg is gone; the [0:16] stamp is dropped because #6469 now zeroes a group's padding, including the bytes before its first region.

@claude

claude Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @wwwjn's task in 1m 56s —— View job


Needs discussion -- re-review posted: cf6cee8 is sound, but two comments still describe the dropped [0:16] stamp and one docstring path is wrong (all mechanical). Still a maintainer call: NIXL vs Monarch for images.

@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 -- the code in cf6cee8 is sound. Two comments still describe the [0:16] stamp this round dropped, which is a mechanical fix. The open question is still the maintainers': should NIXL replace Monarch for prompt image files, given that image reads are 2-2.7x slower per call?

What changed since the last review.

  • The test-only rdma_byte_buffers kwarg is gone from BaseRolloutWorker and MessageEnvRolloutWorker. The worker now builds its pool when either knob is set, and the test monkeypatches rollouter.RDMAByteBuffers.
  • The [0:16] group stamp is dropped. #6469 now zeroes every byte a serialized group doesn't write, including [0:48) before region 0's head tag. That clears a released image file's head tag.

Example (why a stale file read still raises without the stamp). A released 4x-sized file buffer is taken by a smaller serialized group:

file use:   [0:16] (1, gen 1) | file ................................. | (1, gen 1)
group use:  [0:48] 0 ... 0    | (1,2) rollouts (1,2) | (old file bytes, untouched) | (1, gen 1)
stale file read: head (0, 0) != (1, 1) -> RuntimeError

I checked the other reuse orders too:

  • file after file: the new file's head tag overwrites the old one;
  • group after group: already covered by #6469's zeroing;
  • file over a stale group: the file is written contiguously from byte 0, so any group region it overlaps loses its head tag, and regions past the file's end keep their original bytes and tags.

Must fix

  1. torchtitan/rl/transport/torch_transport_rdma.py:55 -- the REGION_TAG comment still says files and groups "stamp their tag at bytes [0:16]".
  2. torchtitan/rl/transport/rdma_rollout_group.py:19 -- the module docstring has the same stale claim ("the worker also writes it at bytes [0:16]").
  3. torchtitan/rl/transport/torch_transport_rdma.py:13 -- the docstring path should be rl/transport/rdma_rollout_group.py, not rollout/....

Earlier findings

  • Resolved: the test-only rdma_byte_buffers kwarg (rollouter.py:482).
  • Still resolved at HEAD:
    • the setup probe on generator rank 0;
    • the per-allocation generation with one shared REGION_TAG;
    • the pool metrics, logged with either knob;
    • the cancel-race TODO;
    • no leftovers of RDMAObject / register_rdma_object.

Questions

  • Still open: does rdma_min_image_bytes beat sending images by value at all on this path? The knob's docstring says the crossover "is not measured yet", and Results compare only against Monarch (38 -> 101 ms p50 per call).
Details
  • Overlap search: gh pr list --search "rdma_min_image_bytes" finds #5862 (the Monarch path this PR deletes) and #6469 (the base), nothing else.
  • With this round, catching a stale file read depends on #6469's zeroing loop (rdma_rollout_group.py:213-216) covering [0:48). test_a_file_read_after_a_serialized_group_reused_its_buffer_raises guards it and expects (0, 0), so a regression in the base's zeroing would fail this test.
  • RolloutGroupStore's assert is loosened to rdma_min_group_bytes is None or rdma_byte_buffers is not None, and _keep now logs pool metrics whenever buffers exist. Both match the description.
  • Design trade, unchanged since the last round:
    • for: one RDMA stack, -216 lines of Monarch / RDMAObject code, worker RSS 3.0 -> 2.5-2.6 GB;
    • against: generator rank 0 needs NIXL (checked at setup), 2-2.7x slower per-call image reads (0.6-0.7% of a generate call), and 4-10% more registered pool memory.

Not verified: cross-host NIXL reads from generator rank 0; the setup probe on a multi-generator run.

Before merge: fill in the human-written summary.

Comment on lines +55 to +59
# What an owner writes before and after each region a reader must tell from a later use of the
# same pooled buffer: (group_id, `RDMAByteBufferHandle.generation`). Image files and serialized groups share
# the pool, so the generation, numbered per allocation, is what makes a tag name one use. Image
# files and serialized groups also stamp their tag at bytes [0:16] of the buffer, where an image
# file's head tag sits, so any later use of the buffer overwrites that tag.

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 comment went stale in cf6cee8. It says "image files and serialized groups also stamp their tag at bytes [0:16]", but _serialize / keep_in_registered_buffer no longer write a tag there. A stale image-file read is now caught because the group zeroes its unwritten bytes (rdma_rollout_group.py:213-216), which include [0:48). The new test expects exactly that: (0, 0) .... A reader who trusts this comment would look for a stamp that doesn't exist, and would miss that the check now depends on #6469's zeroing.

Suggested change
# What an owner writes before and after each region a reader must tell from a later use of the
# same pooled buffer: (group_id, `RDMAByteBufferHandle.generation`). Image files and serialized groups share
# the pool, so the generation, numbered per allocation, is what makes a tag name one use. Image
# files and serialized groups also stamp their tag at bytes [0:16] of the buffer, where an image
# file's head tag sits, so any later use of the buffer overwrites that tag.
# What an owner writes before and after each region a reader must tell from a later use of the
# same pooled buffer: (group_id, `RDMAByteBufferHandle.generation`). Image files and serialized
# groups share the pool, so the generation, numbered per allocation, is what makes a tag name one
# use. An image file's head tag is the buffer's bytes [0:16]: a later image file overwrites it with
# its own tag, and a serialized group zeroes it (the bytes before its first region).

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.

from claude: Applied your wording. e4e3c7a

Comment on lines +19 to +21
tag = REGION_TAG: (group_id, the buffer allocation's generation), written by the worker,
checked by the reader; the worker also writes it at bytes [0:16], before region 0's
tag at 48, where an image file's head tag sits if the buffer held one before

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 the same stale claim, in the module docstring: "the worker also writes it at bytes [0:16]". After cf6cee8 nothing writes a tag at [0:16]. The bytes before region 0's tag at 48 are zeroed together with the rest of the unwritten padding (lines 213-216).

Suggested change
tag = REGION_TAG: (group_id, the buffer allocation's generation), written by the worker,
checked by the reader; the worker also writes it at bytes [0:16], before region 0's
tag at 48, where an image file's head tag sits if the buffer held one before
tag = REGION_TAG: (group_id, the buffer allocation's generation), written by the worker,
checked by the reader; every byte the worker doesn't write is zeroed, including
[0:48) before region 0's tag, where an image file's head tag sits if the buffer held one

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.

from claude: Applied your wording. e4e3c7a

- prompt image files (`BaseRolloutWorker.Config.rdma_min_image_bytes`): `RDMAImageFiles` keeps a
group's large files, and generator rank 0 reads them whole (`RDMAPrompt.read`);
- serialized training groups (`BaseRolloutWorker.Config.rdma_min_group_bytes`,
`rollout/rdma_rollout_group.py`): the trainer's DP replica leaders read only the rollouts they

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.

Wrong path: the module is torchtitan/rl/transport/rdma_rollout_group.py. There is no rl/rollout/rdma_rollout_group.py.

Suggested change
`rollout/rdma_rollout_group.py`): the trainer's DP replica leaders read only the rollouts they
`rl/transport/rdma_rollout_group.py`): the trainer's DP replica leaders read only the rollouts they

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.

from claude: Fixed the path. e4e3c7a

@wwwjn
wwwjn force-pushed the wwwjn/data-plane/5b-shared-rdma-pool branch from cf6cee8 to c5d7f3f Compare December 2, 2026 01:10
@wwwjn
wwwjn force-pushed the wwwjn/data-plane/5b-shared-rdma-pool branch from c5d7f3f to e4e3c7a Compare December 2, 2026 01:11
@wwwjn

wwwjn commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

from claude: @claude review

This round (e4e3c7a): the three stale comments. The knob-off row you asked for, same head and recipe, both with rdma_min_group_bytes = 1, two lanes then swapped:

generate call, p50                  16.06 -> 16.12 s (swapped: 16.14 -> 16.33)
image read per generate call, p50   none -> 97.0 ms (swapped: 84.6)
step                                20.49 -> 21.09 s (swapped: 21.52 -> 20.73)
rollout worker RAM, max             2.44 -> 2.51 GiB (swapped: 2.50 -> 2.46)

So on one host the pool does not beat sending the files by value; the knob docstring now says to keep it off unless sending is measured to cost more (e.g. across hosts).

@claude

claude Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @wwwjn's task in 1m 21s —— View job


Needs discussion -- re-review posted: e4e3c7a fixes the three stale comments, but the by-value row shows this image path has no measured gain. The maintainers need to decide whether to keep rdma_min_image_bytes at all (measure across hosts, drop it, or keep Monarch).

@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 -- e4e3c7a fixes all three stale comments, and the code has nothing left to fix. But the new by-value row shows this PR's image path has no measured benefit. So whether to keep rdma_min_image_bytes at all is now a maintainer decision, not just "NIXL vs Monarch".

What changed since the last review (cf6cee8 -> e4e3c7a).

  • The three comments are fixed: the REGION_TAG comment (torch_transport_rdma.py:55), the rdma_rollout_group.py module docstring, and the module path.
  • The rdma_min_image_bytes docstring (rollouter.py:441-446) drops the GB300 Monarch crossover. It now says that on one host the knob does not beat sending files by value, and to keep it off unless sending is measured to cost more.
  • The description gains the knob-off row.

I couldn't fetch cf6cee8, so I re-read the full production diff at HEAD. No leftovers of the old path: no RDMAObject, register_rdma_object, rdma_object, or "[0:16] stamp".

Example (what the new row says, Geometry3K 2048 px, 3.4-6.4 MB files, one host).

images by value:          generate p50 16.06 s (swapped 16.14)   image read: none
images in the NIXL pool:  generate p50 16.12 s (swapped 16.33)   image read p50 97 ms (84.6)
cross-host, NIXL:         not measured
cross-host, Monarch:      ~2x faster than by value from 5 MB (GB300, #5862) -- the only measured gain

Must fix

  1. Gate (value): this PR replaces the only image-RDMA path with a measured gain (Monarch, cross-host, #5862) with one that has none. The knob's own docstring now tells users to keep it off. .claude/rules/config.md says to "expose only options a verified recipe uses". Yet the PR still adds NIXL on generator rank 0, a setup probe through the router, a reader thread, and RDMAImageFiles / RDMAPrompt to serve the knob. One of these has to happen before this lands, and choosing between them is the maintainers' call:
    • (a) measure NIXL image reads across hosts, where #5862 saw Monarch's gain, and show the knob beats by value there;
    • (b) drop prompt images by RDMA entirely. Close the image half of #5862, and here delete rdma_min_image_bytes, RDMAImageFiles, RDMAPrompt, Generator.check_rdma_probes, and the router and actor endpoints. The pool then serves only groups, and this PR shrinks to roughly nothing;
    • (c) keep Monarch for images (#5862 as is) and close this PR.

Earlier findings

  • Resolved: the REGION_TAG comment, the rdma_rollout_group.py docstring, and the module path.
  • Answered: the knob-off comparison. It is the basis for must-fix 1.
  • Still resolved at HEAD:
    • the generator rank 0 setup probe;
    • one REGION_TAG with a per-allocation generation;
    • pool metrics with either knob;
    • the cancel-race TODO;
    • no test-only rdma_byte_buffers kwarg.
Details
  • Overlap search: gh pr list --state open --search "rdma_min_image_bytes" finds #5862 (Monarch image path), #6469 (base), and this PR.
  • Reading the new numbers:
    • The generate-call deltas (+0.06 s, +0.19 s) are within lane-to-lane noise. Step time flips sign between lanes (+0.6 s, -0.8 s).
    • The images knob doesn't gain on one host, and it doesn't clearly lose. Its cost is the NIXL dependency, plus 85-97 ms of per-call reads that the generate call absorbs.
  • If (b) is chosen, the shared-pool machinery this PR adds for images also goes: the [0:48) zeroing argument for image head tags, and the generator's image-file-reader thread. Only #6469's group path is left.
  • Why (a) matters: per-call reads queue on rank 0's one GIL-bound reader thread (the description's NOTE). Cross-host latency adds to each round trip, so NIXL may not reproduce Monarch's cross-host gain. Unverified.

Not verified: cross-host NIXL image reads; the setup probe on a multi-generator run.

Before merge: fill in the human-written summary.

This branch has not been deployed

No deployments
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