Repository navigation
Conversation
8859257 to
22a943d
Compare
e503037 to
2a7dc8d
Compare
Signed-off-by: Zeyu Zhou <[email protected]>
Signed-off-by: Zeyu Zhou <[email protected]>
Signed-off-by: Zeyu Zhou <[email protected]>
Signed-off-by: Zeyu Zhou <[email protected]>
Signed-off-by: Zeyu Zhou <[email protected]>
Signed-off-by: Zeyu Zhou <[email protected]>
Signed-off-by: Zeyu Zhou <[email protected]>
…main Signed-off-by: Zeyu Zhou <[email protected]>
Signed-off-by: Zeyu Zhou <[email protected]>
2a7dc8d to
67771e6
Compare
|
/ok to test 67771e6 |
Signed-off-by: Zeyu Zhou <[email protected]>
Signed-off-by: Zeyu Zhou <[email protected]>
zyzhou5
left a comment
There was a problem hiding this comment.
Code review — generated using review-pr-team
Reviewed published head 67771e6. Four PR-introduced Mooncake correctness findings are attached inline, each checked by the independent devil's-advocate pass.
The distributed-save design is worth keeping: payload bytes stay with their owners for shard writes, while the coordinator exchanges commands and metadata. Delaying Mooncake restore until clients attach is justified; these corrections do not require changing Simple's restore order or adding a coordinator framework.
Validation was source tracing plus 59 mocked/stdlib diagnostic cases and focused failure probes, not a native Ray/Mooncake/GPU or fresh-process restore run. Passing expected-error probes is not evidence that the affected production paths succeeded.
Generated by Codex using the repository's review-pr-team workflow.
Merge upstream main at fd45cb8, preserving its GDR and generation-server changes alongside checkpoint setup. Accept complete restore replicas on any current participant, retain buffers on registration error codes, and discover only generation DP leaders. Update regression coverage and the data-plane README without new checkpoint knobs or Simple-path changes. Validation: 573 focused CPU unit tests passed; selected pinned pre-commit format/lint hooks passed. GPU/E2E validation remains deferred. Signed-off-by: Zeyu Zhou <[email protected]>
|
/ok to test f2581b6 |
|
/ok to test 3d0bef5 |
yuki-97
left a comment
There was a problem hiding this comment.
Nice work. The save planner is carefully built: the discovery key-slicing partitions the controller cut with no empty slice at any participant count, the batch and buffer-capacity arithmetic is exact, and sorted(saved_keys) != keys means a partially-failed fan-out can never publish a loadable checkpoint. The buffer quarantine covers all three of its paths, the path-traversal guard ships with 8 shard-name cases across both entry points, and the e2e evidence — a resumed run loading a step-5 checkpoint, plus latency grids from four OCI-HSG nodes with eight storage actors — is more than most PRs this size carry.
Scope: the new tq_mooncake_checkpoint module and its wiring into the SingleController checkpoint lifecycle, at 3d0bef5.
Checked:
- Save path against Mooncake and TransferQueue at their pinned SHAs: discovery, manifest completeness, batching, buffer registration and quarantine.
- Load path: participant-count independence, manifest trust boundary, and restore-vs-attach ordering through the actor constructor.
- CI as execution evidence: check-runs for this head, with job logs mapped to shards rather than inferred from the green tick.
- Guidelines: copyright, pyrefly registration, config access patterns, exception breadth, Ray actor pragmas, docs.
- Dead and tautological code, and doc/comment claims against the code they describe.
Remaining comments cover a config combination that has no guard, CI execution coverage for the new module, a failure-path cleanup race, a test blind spot on replica eligibility, and one asymmetry between what save writes and what load accepts.
|
/ok to test 2882d2e |
Reject automatic generation shard restarts with Mooncake data-plane checkpointing and document the follow-up in NVIDIA-NeMo#4178. Replace the plugin marker with a lazy manager mixin, remove unused legacy checkpoint formats, and add replica eligibility and setup guard coverage. Signed-off-by: Zeyu Zhou <[email protected]>
2882d2e to
8de3ea7
Compare
|
/ok to test 8de3ea7 |
Bring main a9c3178 (25 commits since the previous merge base 702cd79) into the branch on top of the #5 submodule bump (00621c2). Conflicts: - nemo_rl/algorithms/single_controller_utils/setup.py and tests/unit/single_controller/test_setup.py: keep main's sharded Gym stacks (NVIDIA-NeMo#3373), multi-teacher MOPD (NVIDIA-NeMo#4045), critic optimizer rebuild (NVIDIA-NeMo#4213) and Mooncake storage checkpoints (NVIDIA-NeMo#3898) next to the Megatron token-capture setup guards and backend wiring; the vLLM-only capture guard is replaced by the backend-aware one. - tests/unit/models/generation/test_vllm_token_capture_hosting.py: keep main's stripped staged token arrays (NVIDIA-NeMo#4206) on top of the shared vLLM chain-cache prefix resolution. - pyproject.toml (semantic conflict, auto-merged by git): main NVIDIA-NeMo#3566 removed `exclude-dependencies = ["nvidia-cutlass-dsl-libs-base"]` in favour of per-version dependency-metadata overrides for CUTLASS DSL 4.5.x, while this branch's mcore extra pinned nvidia-cutlass-dsl[cu13]==4.8.0.dev0 (68b63da). Without the exclusion that pin drags in the pre-release nvidia-cutlass-dsl-libs-base==4.8.0.dev0, which uv refuses for a transitive dependency, so `uv lock` no longer resolves. Pin 4.6.2 instead: it is the stable release flashinfer-python 0.6.18.post1 actually requires (>=4.6.2a0), and it is the pin NVIDIA-NeMo#4139 uses for the same Megatron-Bridge bump on main. - uv.lock: regenerated from main's copy with uv 0.11.28 (the docker/Dockerfile pin), so it carries main's new git pins (Model-Optimizer, sglang, Lens, TransferQueue, nvidia-resiliency-ext, torch_memory_saver) together with the Gym and Megatron-Bridge main pins and the flashinfer index spelling from #5. `uv lock --check` passes with uv 0.11.28 and 0.12.5. Submodule pins: Automodel follows main (72daceffa); Gym (9fc05c0ff) and Megatron-Bridge (fcea83a85) stay at the #5 pins, which descend from main's. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Laura Dang <[email protected]>
Bring main a9c3178 (25 commits since the previous merge base 702cd79) into the branch on top of the #5 submodule bump (00621c2). Conflicts: - nemo_rl/algorithms/single_controller_utils/setup.py and tests/unit/single_controller/test_setup.py: keep main's sharded Gym stacks (NVIDIA-NeMo#3373), multi-teacher MOPD (NVIDIA-NeMo#4045), critic optimizer rebuild (NVIDIA-NeMo#4213) and Mooncake storage checkpoints (NVIDIA-NeMo#3898) next to the Megatron token-capture setup guards and backend wiring; the vLLM-only capture guard is replaced by the backend-aware one. - tests/unit/models/generation/test_vllm_token_capture_hosting.py: keep main's stripped staged token arrays (NVIDIA-NeMo#4206) on top of the shared vLLM chain-cache prefix resolution. - pyproject.toml (semantic conflict, auto-merged by git): main NVIDIA-NeMo#3566 removed `exclude-dependencies = ["nvidia-cutlass-dsl-libs-base"]` in favour of per-version dependency-metadata overrides for CUTLASS DSL 4.5.x, while this branch's mcore extra pinned nvidia-cutlass-dsl[cu13]==4.8.0.dev0 (68b63da). Without the exclusion that pin drags in the pre-release nvidia-cutlass-dsl-libs-base==4.8.0.dev0, which uv refuses for a transitive dependency, so `uv lock` no longer resolves. Pin 4.6.2 instead: it is the stable release flashinfer-python 0.6.18.post1 actually requires (>=4.6.2a0), and it is the pin NVIDIA-NeMo#4139 uses for the same Megatron-Bridge bump on main. - uv.lock: regenerated from main's copy with uv 0.11.28 (the docker/Dockerfile pin), so it carries main's new git pins (Model-Optimizer, sglang, Lens, TransferQueue, nvidia-resiliency-ext, torch_memory_saver) together with the Gym and Megatron-Bridge main pins and the flashinfer index spelling from #5. `uv lock --check` passes with uv 0.11.28 and 0.12.5. Submodule pins: Automodel follows main (72daceffa); Gym (9fc05c0ff) and Megatron-Bridge (fcea83a85) stay at the #5 pins, which descend from main's. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Laura Dang <[email protected]>
…L needs Move the Gym pin from 120d516f, a merge of the pre-merge checkpoint stack that is on no Gym branch head and does not descend from main's pin, to bf631d0a on NVIDIA-NeMo/Gym amahishi/rl-gym-turn-recovery-pin: - Gym main at 9ef5ed0f, which carries the merged checkpoint stack (#3882-#3889) and descends from main's pin da9f6714; - NVIDIA-NeMo/Gym#3894: checkpoint Workplace Assistant sessions; - NVIDIA-NeMo/Gym#4690: name the episodes an agent's own /run drives in the agent commit reply (run_episode_ids); - the checkpoint test agent the turn-recovery functional test runs, with its participant installed once per app now that Gym installs it twice. - NVIDIA-NeMo/Gym#3895-#3898: Gymnasium servers on the shared resources server setup, and checkpointing for Blackjack, indirect prompt injection and the proof refinement agent. Relock with uv 0.11.18: Gym moves ray and jinja2 out of its core dependencies and adds requests; every resolved package keeps its version. Gym's coordination now sends each control body pre-encoded as data rather than json, so the adapter test's in-process client forwards both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anish Mahishi <[email protected]>
…L needs Move the Gym pin from main's 6f295d7d to bf631d0a on NVIDIA-NeMo/Gym amahishi/rl-gym-turn-recovery-pin: - Gym main at 9ef5ed0f, which carries the merged checkpoint stack (#3882-#3889) and descends from main's pin 6f295d7d; - NVIDIA-NeMo/Gym#3894: checkpoint Workplace Assistant sessions; - NVIDIA-NeMo/Gym#4690: name the episodes an agent's own /run drives in the agent commit reply (run_episode_ids); - the checkpoint test agent the turn-recovery functional test runs, with its participant installed once per app now that Gym installs it twice. - NVIDIA-NeMo/Gym#3895-#3898: Gymnasium servers on the shared resources server setup, and checkpointing for Blackjack, indirect prompt injection and the proof refinement agent. Gym adds requests to its core dependencies, so the lock records it for nemo-gym; requests is already locked, and every resolved package keeps its version. Gym's coordination now sends each control body pre-encoded as data rather than json, so the adapter test's in-process client forwards both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anish Mahishi <[email protected]>
The pin no longer needs commits that exist only on an unmerged branch. The turn-recovery test holds its boundary through a policy-call proxy, so it no longer uses the checkpoint test agent (NVIDIA-NeMo/Gym#4773), and the agent commit reply's run_episode_ids (NVIDIA-NeMo/Gym#4690) is on main. The other pin-only commits, the indirect prompt injection and proof refinement checkpoint exports (NVIDIA-NeMo/Gym#3897, #3898), are for environments RL's tests do not use. Gym's pyproject.toml is identical to the previous pin's, so uv.lock is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anish Mahishi <[email protected]>
…ckpointing Setup rejected async_rl.generation_fleet_health.restart_dead_shards=true with checkpointing.save_data_plane on the mooncake_cpu backend (NVIDIA-NeMo#3898). Each generation DP leader then owned its captured payload in its own Mooncake segment, so a restart lost that payload, left the dead actor among the checkpoint participants, and brought the replacement back without a TQ client. None of that holds any more. Since NVIDIA-NeMo#4465 token-capture clients own no segment and configure_checkpoint_workers drops them from the participants, and restart_shard now reinstalls token capture. Remove the guard, accept the combination in the setup test, and drop the docs paragraph that described the restriction. Closes NVIDIA-NeMo#4178. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…L needs Move the Gym pin from main's 6f295d7d to bf631d0a on NVIDIA-NeMo/Gym amahishi/rl-gym-turn-recovery-pin: - Gym main at 9ef5ed0f, which carries the merged checkpoint stack (#3882-#3889) and descends from main's pin 6f295d7d; - NVIDIA-NeMo/Gym#3894: checkpoint Workplace Assistant sessions; - NVIDIA-NeMo/Gym#4690: name the episodes an agent's own /run drives in the agent commit reply (run_episode_ids); - the checkpoint test agent the turn-recovery functional test runs, with its participant installed once per app now that Gym installs it twice. - NVIDIA-NeMo/Gym#3895-#3898: Gymnasium servers on the shared resources server setup, and checkpointing for Blackjack, indirect prompt injection and the proof refinement agent. Gym adds requests to its core dependencies, so the lock records it for nemo-gym; requests is already locked, and every resolved package keeps its version. Gym's coordination now sends each control body pre-encoded as data rather than json, so the adapter test's in-process client forwards both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anish Mahishi <[email protected]>
The pin no longer needs commits that exist only on an unmerged branch. The turn-recovery test holds its boundary through a policy-call proxy, so it no longer uses the checkpoint test agent (NVIDIA-NeMo/Gym#4773), and the agent commit reply's run_episode_ids (NVIDIA-NeMo/Gym#4690) is on main. The other pin-only commits, the indirect prompt injection and proof refinement checkpoint exports (NVIDIA-NeMo/Gym#3897, #3898), are for environments RL's tests do not use. Gym's pyproject.toml is identical to the previous pin's, so uv.lock is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anish Mahishi <[email protected]>
…L needs Move the Gym pin from main's 6f295d7d to bf631d0a on NVIDIA-NeMo/Gym amahishi/rl-gym-turn-recovery-pin: - Gym main at 9ef5ed0f, which carries the merged checkpoint stack (#3882-#3889) and descends from main's pin 6f295d7d; - NVIDIA-NeMo/Gym#3894: checkpoint Workplace Assistant sessions; - NVIDIA-NeMo/Gym#4690: name the episodes an agent's own /run drives in the agent commit reply (run_episode_ids); - the checkpoint test agent the turn-recovery functional test runs, with its participant installed once per app now that Gym installs it twice. - NVIDIA-NeMo/Gym#3895-#3898: Gymnasium servers on the shared resources server setup, and checkpointing for Blackjack, indirect prompt injection and the proof refinement agent. Gym adds requests to its core dependencies, so the lock records it for nemo-gym; requests is already locked, and every resolved package keeps its version. Gym's coordination now sends each control body pre-encoded as data rather than json, so the adapter test's in-process client forwards both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anish Mahishi <[email protected]>
The pin no longer needs commits that exist only on an unmerged branch. The turn-recovery test holds its boundary through a policy-call proxy, so it no longer uses the checkpoint test agent (NVIDIA-NeMo/Gym#4773), and the agent commit reply's run_episode_ids (NVIDIA-NeMo/Gym#4690) is on main. The other pin-only commits, the indirect prompt injection and proof refinement checkpoint exports (NVIDIA-NeMo/Gym#3897, #3898), are for environments RL's tests do not use. Gym's pyproject.toml is identical to the previous pin's, so uv.lock is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anish Mahishi <[email protected]>
…L needs Move the Gym pin from main's 6f295d7d to bf631d0a on NVIDIA-NeMo/Gym amahishi/rl-gym-turn-recovery-pin: - Gym main at 9ef5ed0f, which carries the merged checkpoint stack (#3882-#3889) and descends from main's pin 6f295d7d; - NVIDIA-NeMo/Gym#3894: checkpoint Workplace Assistant sessions; - NVIDIA-NeMo/Gym#4690: name the episodes an agent's own /run drives in the agent commit reply (run_episode_ids); - the checkpoint test agent the turn-recovery functional test runs, with its participant installed once per app now that Gym installs it twice. - NVIDIA-NeMo/Gym#3895-#3898: Gymnasium servers on the shared resources server setup, and checkpointing for Blackjack, indirect prompt injection and the proof refinement agent. Gym adds requests to its core dependencies, so the lock records it for nemo-gym; requests is already locked, and every resolved package keeps its version. Gym's coordination now sends each control body pre-encoded as data rather than json, so the adapter test's in-process client forwards both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anish Mahishi <[email protected]>
The pin no longer needs commits that exist only on an unmerged branch. The turn-recovery test holds its boundary through a policy-call proxy, so it no longer uses the checkpoint test agent (NVIDIA-NeMo/Gym#4773), and the agent commit reply's run_episode_ids (NVIDIA-NeMo/Gym#4690) is on main. The other pin-only commits, the indirect prompt injection and proof refinement checkpoint exports (NVIDIA-NeMo/Gym#3897, #3898), are for environments RL's tests do not use. Gym's pyproject.toml is identical to the previous pin's, so uv.lock is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anish Mahishi <[email protected]>
…ckpointing Setup rejected async_rl.generation_fleet_health.restart_dead_shards=true with checkpointing.save_data_plane on the mooncake_cpu backend (NVIDIA-NeMo#3898). Each generation DP leader then owned its captured payload in its own Mooncake segment, so a restart lost that payload, left the dead actor among the checkpoint participants, and brought the replacement back without a TQ client. None of that holds any more. Since NVIDIA-NeMo#4465 token-capture clients own no segment and configure_checkpoint_workers drops them from the participants, and restart_shard now reinstalls token capture. Remove the guard, accept the combination in the setup test, and drop the docs paragraph that described the restriction. Closes NVIDIA-NeMo#4178. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…L needs Move the Gym pin from main's 6f295d7d to bf631d0a on NVIDIA-NeMo/Gym amahishi/rl-gym-turn-recovery-pin: - Gym main at 9ef5ed0f, which carries the merged checkpoint stack (#3882-#3889) and descends from main's pin 6f295d7d; - NVIDIA-NeMo/Gym#3894: checkpoint Workplace Assistant sessions; - NVIDIA-NeMo/Gym#4690: name the episodes an agent's own /run drives in the agent commit reply (run_episode_ids); - the checkpoint test agent the turn-recovery functional test runs, with its participant installed once per app now that Gym installs it twice. - NVIDIA-NeMo/Gym#3895-#3898: Gymnasium servers on the shared resources server setup, and checkpointing for Blackjack, indirect prompt injection and the proof refinement agent. Gym adds requests to its core dependencies, so the lock records it for nemo-gym; requests is already locked, and every resolved package keeps its version. Gym's coordination now sends each control body pre-encoded as data rather than json, so the adapter test's in-process client forwards both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anish Mahishi <[email protected]>
…L needs Move the Gym pin from main's 6f295d7d to bf631d0a on NVIDIA-NeMo/Gym amahishi/rl-gym-turn-recovery-pin: - Gym main at 9ef5ed0f, which carries the merged checkpoint stack (#3882-#3889) and descends from main's pin 6f295d7d; - NVIDIA-NeMo/Gym#3894: checkpoint Workplace Assistant sessions; - NVIDIA-NeMo/Gym#4690: name the episodes an agent's own /run drives in the agent commit reply (run_episode_ids); - the checkpoint test agent the turn-recovery functional test runs, with its participant installed once per app now that Gym installs it twice. - NVIDIA-NeMo/Gym#3895-#3898: Gymnasium servers on the shared resources server setup, and checkpointing for Blackjack, indirect prompt injection and the proof refinement agent. Gym adds requests to its core dependencies, so the lock records it for nemo-gym; requests is already locked, and every resolved package keeps its version. Gym's coordination now sends each control body pre-encoded as data rather than json, so the adapter test's in-process client forwards both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anish Mahishi <[email protected]>
…L needs Move the Gym pin from main's 6f295d7d to bf631d0a on NVIDIA-NeMo/Gym amahishi/rl-gym-turn-recovery-pin: - Gym main at 9ef5ed0f, which carries the merged checkpoint stack (#3882-#3889) and descends from main's pin 6f295d7d; - NVIDIA-NeMo/Gym#3894: checkpoint Workplace Assistant sessions; - NVIDIA-NeMo/Gym#4690: name the episodes an agent's own /run drives in the agent commit reply (run_episode_ids); - the checkpoint test agent the turn-recovery functional test runs, with its participant installed once per app now that Gym installs it twice. - NVIDIA-NeMo/Gym#3895-#3898: Gymnasium servers on the shared resources server setup, and checkpointing for Blackjack, indirect prompt injection and the proof refinement agent. Gym adds requests to its core dependencies, so the lock records it for nemo-gym; requests is already locked, and every resolved package keeps its version. Gym's coordination now sends each control body pre-encoded as data rather than json, so the adapter test's in-process client forwards both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anish Mahishi <[email protected]>
…ckpointing Setup rejected async_rl.generation_fleet_health.restart_dead_shards=true with checkpointing.save_data_plane on the mooncake_cpu backend (NVIDIA-NeMo#3898). Each generation DP leader then owned its captured payload in its own Mooncake segment, so a restart lost that payload, left the dead actor among the checkpoint participants, and brought the replacement back without a TQ client. None of that holds any more. Since NVIDIA-NeMo#4465 token-capture clients own no segment and configure_checkpoint_workers drops them from the participants, and restart_shard now reinstalls token capture. Remove the guard, accept the combination in the setup test, and drop the docs paragraph that described the restriction. Closes NVIDIA-NeMo#4178. Signed-off-by: Zeyu Zhou <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
What does this PR do ?
This PR enables distributed checkpointing and recovery for the Mooncake data-plane backend through the existing TQ checkpoint lifecycle. Storage-owning workers save their data directly to shared storage, avoiding gathering all payloads at a central coordinator. Recovery distributes loading across the current workers before restoring queue metadata, without requiring the original worker identities or data placement. The design reuses the existing checkpoint controls, preserves Simple's checkpoint behavior, and keeps ordinary Mooncake PUTs free of checkpoint-related disk writes.
Existing checkpoint support with Simple
SingleController already triggers checkpointing through TQ. TQ saves the queue metadata and calls the storage backend's checkpoint methods. For Simple, the storage manager delegates to its dedicated storage units, and each unit saves its own data. During recovery, TQ restores the storage contents before restoring queue metadata.
What Mooncake was missing
Mooncake already stores data across multiple processes, but its TQ storage manager did not implement the corresponding storage save/load methods.
Unlike Simple's dedicated storage units, Mooncake's storage lives inside worker processes that have attached a Mooncake client. Supporting checkpointing therefore requires identifying those storage owners and asking them to save or restore data through the existing worker handles.
What this PR adds
The existing checkpoint controls and publication mechanism are reused. Simple's checkpoint behavior remains unchanged, and ordinary Mooncake PUTs do not perform checkpoint-related disk writes.
How to enable
In an existing Single-Controller configuration, set:
E2E test
The resumed training run loaded the step-5 checkpoint from the original training run.
Performance
Benchmarked on four OCI-HSG nodes with two storage actors per node (eight total). See the benchmark setup and reproduction scripts.
Simple
Save latency (seconds, mean of 3 runs)
Load latency (seconds, mean of 3 runs)
Mooncake
Save latency (seconds, mean of 3 runs)
Load latency (seconds, mean of 3 runs)