Repository navigation
Fix RLinf train/play checkpoint and model configuration - #8250
Conversation
Use the native evaluation checkpoint hook, resolve the resume root, and normalize paths before worker launch. Merge actor defaults into rollout settings while retaining overrides and checkpoint selectors. Extract the entrypoint fixes from isaac-sim#7776 without its task or model integration changes.
|
run-ci |
|
There was a problem hiding this comment.
Isaac Lab Review Bot
The RLinf checkpoint and model-configuration fixes are coherent and documented. Two minor maintainability issues remain: train and play duplicate the same rollout merge/path-normalization logic, and the checkpoint test repeats the same recursive-directory branch at three ancestor depths.
- Design and architecture: The checkpoint resolver remains appropriately shared while each entrypoint maps its result to RLinf's native training or playback field. However, the identical actor-to-rollout merge and model-path normalization block in both train and play should be moved into the shared RLinf helper to prevent their configuration semantics from drifting.
- API: Checked the
--checkpointand--model_pathCLI behavior, selector handling, accepted checkpoint file/directory forms, resolver exceptions, and assignments torunner.ckpt_pathandrunner.resume_dir. No new public export or lazy-export registration is required. - Compatibility and deprecation: Breaking changes: none identified. The internal resolver now returns absolute paths and rejects missing or ambiguous checkpoints, while training requires an enclosing
global_step_<N>directory. Both internal callers are updated, the accepted layout is documented, and the removedrunner.eval_policy_pathassignment was not consumed by RLinf. - Implementation: The selector delegation, recursive uniqueness check, checkpoint existence validation, training parent walk, merge precedence, and pre-worker path normalization are internally consistent. Consolidate the byte-identical
OmegaConf.mergeand model-path resolution block currently present in both RLinf entrypoints into the shared backend helper. - Style consistency: Imports, exception wording, documentation, and changelog placement follow adjacent patterns. The duplicated merge/path-resolution block, including its identical explanatory comment, conflicts with the repository guidance to share logic that has the same contract.
- Test quality: The changed tests cover selector resolution, direct files, containing directories, ambiguity, missing paths, native playback/training checkpoint fields, absolute model paths, and rollout inheritance at the CLI/Hydra boundary. In
test_recursive_selector_resolves_rlinf_checkpoint, the three values fromexpected.parents[:3]all execute the same recursive-directory branch and assert the same behavior; retain one containing-directory case alongside the distinct direct-file, ambiguity, and missing-file cases.
Minor fixes needed. Posted 2 actionable findings inline.
Automated review; human maintainers own approval decisions.
| break | ||
| else: | ||
| raise ValueError(f"Cannot resume: {checkpoint_path} is not inside a global_step_<N> directory.") | ||
| cfg.rollout.model = OmegaConf.merge(cfg.actor.model, cfg.rollout.model) |
There was a problem hiding this comment.
🔵 Suggestion · Design Architecture — Duplicated rollout merge and path resolution
Lines 123-126 are byte-identical to play_rlinf.py lines 107-110, including the comment: the same actor-into-rollout merge and expanduser().resolve() loop. cli_args_rlinf already owns the RLinf config logic shared by both entrypoints (configure_rlinf_environment, resolve_rlinf_checkpoint, print_rlinf_banner). Two copies of this precedence and path-resolution rule can silently drift between train and play; move the block into the shared helper.
|
|
||
| assert checkpoint == str(expected.resolve()) | ||
| kwargs = dict(log_root_path=str(tmp_path), task="Isaac-Cartpole", config_name="ppo") | ||
| paths = (expected, *expected.parents[:3]) |
There was a problem hiding this comment.
🔵 Suggestion · Test Quality — Redundant directory-depth checkpoint cases
expected.parents[:3] feeds three ancestor directories (model_state_dict, actor, global_step_10) through the same is_dir() plus recursive rglob branch, asserting the same result; depth selects no distinct code path. Keep the direct-file case and one containing directory, retaining the distinct ambiguity and missing-file failures that this change actually introduces.
There was a problem hiding this comment.
Consolidated this to an explicit file and its containing global_step directory in 6bc35ed. Verified that replacing recursive lookup with a direct lookup makes the retained directory case fail, so the recursive-lookup regression stays covered without testing three ancestor depths.
| matches = list(checkpoint_path.rglob("full_weights.pt")) | ||
| if len(matches) != 1: | ||
| raise ValueError(f"Expected exactly one full_weights.pt under {checkpoint_path}, found {len(matches)}.") | ||
| checkpoint_path = matches[0] |
There was a problem hiding this comment.
you raise value error but then use the first match, you should warn instead right?
There was a problem hiding this comment.
The raise stopped execution, so [0] only ran when exactly one file matched. I kept ambiguity as an error so we do not silently load arbitrary weights, but replaced the list/count/index sequence with one-element unpacking in 6bc35ed. latest and best remain explicit ways to choose among checkpoints.
| if len(matches) != 1: | ||
| raise ValueError(f"Expected exactly one full_weights.pt under {checkpoint_path}, found {len(matches)}.") | ||
| checkpoint_path = matches[0] | ||
| if not checkpoint_path.is_file(): |
There was a problem hiding this comment.
I don't think you need to check this anymore if you check is_dir above
There was a problem hiding this comment.
Changed this to elif in 6bc35ed, so directory results are not checked again. The check remains for explicit file paths: is_dir() is also false for a missing path, which should fail before starting workers.
| from hydra.core.global_hydra import GlobalHydra | ||
| from omegaconf import OmegaConf | ||
|
|
||
| backend = importlib.import_module(f"isaaclab_rl.entrypoints.backends.{mode}_rlinf") |
There was a problem hiding this comment.
Changed to normal module-level imports and parametrized the two backend modules directly in 6bc35ed.
| assert resolved.actor.model.model_path == str(tmp_path / "base") | ||
| assert resolved.rollout.model.model_path == str(tmp_path / "rollout") | ||
| assert resolved.rollout.model.model_type == "gr00t" | ||
| assert dict(resolved.rollout.model.rl_head_config) == {"add_value_head": True, "disable_dropout": True} |
There was a problem hiding this comment.
How expensive is this test to run? Should we combine play/train to be run together in same test run to import everything just once?
There was a problem hiding this comment.
Measured this: the train case takes 0.03 s and play 0.02 s; the selected test run including imports takes 1.26 s. Both already run in one pytest process, and the imports are now at module scope. I kept the two parameter cases for separate failure reporting. Neither starts Ray workers or loads a VLA model.
| directory (the ``global_step_<N>`` folder), a subdirectory containing exactly one | ||
| ``full_weights.pt``, or that weights file. RLinf loads the base model, then applies the | ||
| RL-finetuned weights through its native checkpoint hook. Relative model and checkpoint | ||
| paths are resolved from the launcher's working directory before Ray workers start. |
There was a problem hiding this comment.
Does rlinf use ray natively? Theres some documentation here, and below in a comment I saw it, is ray required? Or is it just used in the training by users choice?
There was a problem hiding this comment.
Yes, Ray is required by RLinf, including single-GPU train/eval. Its pinned version declares it as a core dependency, and the native Cluster implementation uses Ray. Both entrypoints construct that Cluster. Added a short clarification and removed the misleading claim that evaluation requires multiple GPUs.
|
run-ci |
## Summary Extracts the GR00T N1.7 integration from Fanxing's #7776. This PR is independent of the H2 tasks, material changes, and action-chunk reset handling that remain there. Entrypoint and checkpoint changes already landed in #8250. - Keep RLinf's native N1.7 model/processor loader and the N1.5 custom-data loader. - Use one pinned RLinf revision for both models, with direct imports and explicit action registries. Existing RLinf 0.2 setups must rerun the shared installation step. - Let YAML declare the checkpoint's language key and environment action order. Existing defaults remain unchanged. - Document pinned N1.7 dependencies in a separate environment from N1.5. No new runtime class, helper, compatibility fallback, or model-loading layer. Production changes are **+14 / −17 lines**. Existing tests are extended rather than adding a new test file. ## Validation - **74 tests passed:** 22 RLinf extension, 47 entrypoint, and 5 checkpoint-manifest tests. - The added language-key, action-order, and split-registry cases fail on unmodified develop and pass here. Removing the N1.7 guard also fails the native-loader ownership assertion. - Ran the unchanged RLinf `simulation_io` module and model dispatcher from pinned revision `0f9ea98c7a6d9e3ade24e8f4846c64d3b135dbcc` with the extension. Checked conversion values, native N1.7 dispatch, and N1.5 custom-data loading; model loading was stubbed at the dependency boundary. - `uv run --no-sync isaaclab -f` and `git diff --check` passed. Documentation build is left to CI. - **Full checkpoint inference and training were not run.** This PR makes no throughput or task-success claim. ## Type of change - New feature - Dependency update: RLinf 0.2 is no longer supported; installation and migration instructions are included - Documentation update ## Release backport - [ ] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Checklist - [x] Read the contribution guidelines - [x] Ran formatting and lint checks - [x] Updated documentation and added a package changelog fragment - [x] Validated the changed behavior and applied the test-audit criteria - [x] Contributor already listed in `CONTRIBUTORS.md`
Summary
First independent slice of #7776, based on current
develop. Fixes the existing RLinf train/play entrypoints without adding tasks, assets, dependencies, model-specific branches, or new helpers.--checkpointto RLinf's nativerunner.ckpt_path; the oldeval_policy_pathfield was ignored.global_step_<N>directory, which RLinf uses to find actor state and recover the training step.latest/bestselectors remain supported; ambiguous checkpoint directories fail rather than choosing arbitrary weights.OmegaConf.merge, with explicit rollout overrides taking precedence.The native weight-loading hook is present in both the documented RLinf
0.2.0dev2wheel and the RLinf revision used by #7776. No changes to Isaac Lab's GR00T extension are needed here.Validation
init_workermethod with a small real Torch model: the old field left weights unchanged;ckpt_pathloaded the exact saved weights. This did not launch Ray or a VLA model.--helpanduv run --no-sync isaaclab -fpassed.Type of change
Release backport
developChecklist
isaaclab_rlchangelog fragment.CONTRIBUTORS.md.