Skip to content

Fix RLinf train/play checkpoint and model configuration - #8250

Merged
ooctipus merged 3 commits into
isaac-sim:developfrom
ooctipus:fix/rlinf-checkpoint-launch
Oct 2, 2026
Merged

ooctipus merged 3 commits into
isaac-sim:developfrom
ooctipus:fix/rlinf-checkpoint-launch

Conversation

@ooctipus

@ooctipus ooctipus commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

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.

  • Playback passes --checkpoint to RLinf's native runner.ckpt_path; the old eval_policy_path field was ignored.
  • Training resume passes the enclosing global_step_<N> directory, which RLinf uses to find actor state and recover the training step.
  • Explicit checkpoint files/directories and model paths become absolute before Ray workers start. Existing latest/best selectors remain supported; ambiguous checkpoint directories fail rather than choosing arbitrary weights.
  • Rollout configuration inherits actor-model settings through OmegaConf.merge, with explicit rollout overrides taking precedence.

The native weight-loading hook is present in both the documented RLinf 0.2.0dev2 wheel and the RLinf revision used by #7776. No changes to Isaac Lab's GR00T extension are needed here.

Validation

  • 47 entrypoint tests and 5 checkpoint-manifest tests passed. Coverage stays in the existing files.
  • New train/play launch checks and the extended checkpoint-path check failed on unchanged develop and passed with the fix. They run real CLI/Hydra composition and stop at the worker boundary.
  • Exercised each RLinf version's unchanged init_worker method with a small real Torch model: the old field left weights unchanged; ckpt_path loaded the exact saved weights. This did not launch Ray or a VLA model.
  • Unified train/play --help and uv run --no-sync isaaclab -f passed.
  • Full distributed VLA training/evaluation was not run. Documentation build is left to CI.

Type of change

  • Bug fix
  • Documentation update

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Checklist

  • Read the contribution guidelines and applied the test-audit criteria.
  • Ran formatting and focused regression checks.
  • Updated documentation and added an isaaclab_rl changelog fragment.
  • Contributor is already listed in CONTRIBUTORS.md.

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.
@ooctipus
ooctipus requested a review from a team October 1, 2026 21:17
@github-actions github-actions Bot added bug Something isn't working documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Oct 1, 2026
@ooctipus

ooctipus commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 1, 2026
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Fixes checkpoint loading and model configuration for RLinf training and playback.

The PR appears safe to merge; no actionable issue was established.

Summary

The PR updates RLinf training and playback to resolve checkpoint and model paths before worker launch, resume from the enclosing training-step directory, pass playback weights through ckpt_path, and inherit actor-model settings in rollout configuration. It also updates documentation and adds launch-boundary tests.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  CLI[RLinf CLI and Hydra config] --> Resolve[Resolve checkpoint and model paths]
  CLI --> Merge[Merge actor model into rollout model]
  Resolve --> Train{Training or playback?}
  Merge --> Workers[Ray worker configuration]
  Train -->|Training resume| Step[Set resume_dir to global_step directory]
  Train -->|Playback| Weights[Set ckpt_path to weights file]
  Step --> Workers
  Weights --> Workers
Loading

Reviews (1) · Last reviewed commit: "Use the current changelog fragment forma..."

@isaaclab-review-bot isaaclab-review-bot 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.

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 --checkpoint and --model_path CLI behavior, selector handling, accepted checkpoint file/directory forms, resolver exceptions, and assignments to runner.ckpt_path and runner.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 removed runner.eval_policy_path assignment 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.merge and 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 from expected.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)

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.

🔵 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])

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.

🔵 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

you raise value error but then use the first match, you should warn instead right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think you need to check this anymore if you check is_dir above

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not use actual import?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@ooctipus

ooctipus commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 2, 2026
@ooctipus
ooctipus merged commit ffc8608 into isaac-sim:develop Oct 2, 2026
59 checks passed
ooctipus added a commit that referenced this pull request Oct 3, 2026
## 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`
@ooctipus
ooctipus deleted the fix/rlinf-checkpoint-launch branch October 14, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants