Skip to content

Unify RSL-RL training checkpoints and fix G1 distillation - #9063

Merged
kellyguo11 merged 8 commits into
isaac-sim:mainfrom
yts-nv:fix/benchmark-distillation-teacher-checkpoint
Nov 24, 2026
Merged

kellyguo11 merged 8 commits into
isaac-sim:mainfrom
yts-nv:fix/benchmark-distillation-teacher-checkpoint

Conversation

@yts-nv

@yts-nv yts-nv commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

Isaac-Velocity-Rough-G1-Depth-Student could not run through the RSL-RL training benchmark:

ValueError: No runs present in the directory: '.../logs/rsl_rl/g1_rough_depth_student' match: '.*'.

The benchmark resolved a checkpoint for every DistillationRunner by searching the student experiment's runs,
even with resume=False, and ignored --checkpoint. The training entrypoint already defines the contract:
--checkpoint (file, run directory, latest/best, or W&B run) supplies a PPO teacher, and distillation without
it is rejected unless resume is configured.

Training and benchmarking now call one checkpoint-selection policy in the existing RSL-RL argument module.
Neither entrypoint owns a separate resolver. Explicit checkpoint references take precedence over configured
resume and remain separate from the configured filename pattern. Both entrypoints honor configured resume.
Selection happens before creating the new run directory, so resume cannot select its own empty output directory.
Checkpoints are loaded with map_location; RSL-RL decides whether to initialize the teacher or continue the student.

An explicit run directory is searched directly for its newest model_*.pt file, including bare relative paths,
trailing slashes, and names containing regex characters. Sibling directories and checkpoint-named subdirectories
cannot be selected.

The G1 student algorithm (core/velocity/config/g1/agents/distillation.py) is also updated for the RSL-RL pin
introduced by #8866: process_env_step returns the per-step logging values and update returns
(loss_dict, stats_dict). Without it the student crashes in the runner right after the teacher checkpoint loads on
current main, so the benchmark could not complete even with the checkpoint fix.

Validation

Benchmark runner (scripts/benchmarks/training.py) on an L40, main = 3e7e61370:

case main this branch
student, no --checkpoint (newton_kamino, isaacsim_rtx) No runs present in ... g1_rough_depth_student Distillation training requires --checkpoint.
student, missing --checkpoint file — FileNotFoundError: Unable to find the file: ...
student, --checkpoint = 2-iteration Isaac-Velocity-Rough-G1-29DoF teacher (newton_mjwarp, isaacsim_rtx) — teacher loads, 2 iterations run, benchmark bundle written

The 2-iteration teacher is a functional fixture only, not a qualified teacher. Checkpoint-policy tests in source/isaaclab_rl/test/test_checkpoint_manifest.py cover missing teachers,
explicit files/directories, explicit checkpoint precedence, and configured resume. Caller tests in
test_train_checkpoint_path.py execute both entrypoints through runner.load() with simulation and the runner
replaced; a structural gate forbids the removed entrypoint-owned resolvers.

Checkpoint ownership revision validation

  • 34 focused tests passed: 12 checkpoint-policy/manifest tests, 9 checkpoint reporting/caller/structure tests,
    and 13 existing namespace and native RSL-RL checkpoint-state tests.
  • Six deliberate regressions were detected: relative-directory lookup through an empty parent, ignored configured
    resume, checkpoint-pattern overwrite, the original benchmark lookup, duplicate resolver ownership, and creating
    the new run directory before resume selection. Each temporary mutation was restored.
  • Full repository formatting/lint checks, changelog validation against the PR base, and git diff --check passed.
  • This revision did not rerun GPU training; the earlier L40 runs document the original PR implementation.

Notes for reviewers

  • The matching teacher on main is Isaac-Velocity-Rough-G1-29DoF (43 actions). An
    Isaac-Velocity-Rough-G1 checkpoint (37 actions) is correctly rejected by RSL-RL with a size mismatch.
  • Separate from this change: on main the student's G1 model (with hands) cannot be built with
    physics=newton_kamino (SolverKamino cannot simulate this model ... left_hand_palm_link: zero inverse mass and singular inverse inertia). The historical failure never reached scene creation, so this was hidden.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format (ruff 0.14.10 format/check pass on changed files)
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Re-validation after merging main (rsl-rl-lib at the #8866 pin, L40, newton_mjwarp, newton_renderer)

  • Student without --checkpoint: Distillation training requires --checkpoint.
  • Student with a 2-iteration Isaac-Velocity-Rough-G1-29DoF fixture teacher: teacher loads, 2 iterations run, benchmark
    bundle and checkpoint written. Before the distillation.py change the same run failed with
    AttributeError: 'NoneType' object has no attribute 'items', then not enough values to unpack.
  • test_train_checkpoint_path.py passes; ruff format and check pass on the changed files.

@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Nov 17, 2026
@yts-nv
yts-nv marked this pull request as ready for review November 20, 2026 03:21
@yts-nv
yts-nv requested a review from a team November 20, 2026 03:21
@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The effects stay within RSL-RL benchmark runs and the G1 depth-student workflow.

Fix run-directory checkpoint selection before merging.

Findings

  1. P1 Run-directory checkpoints still fail ▶

Summary

The PR makes RSL-RL benchmarks use the training checkpoint resolver and updates the G1 student’s return values for the pinned RSL-RL API.

  • The RSL-RL benchmark uses the checkpoint you specify for distillation.
  • The G1 depth student returns the values the RSL-RL runner expects.

Reviews (1) · Last reviewed commit: "Follow the pinned RSL-RL API in the G1 s..." · Reviewed by Greptile


if agent_cfg.resume and not args_cli.checkpoint:
return get_checkpoint_path(log_root_path, agent_cfg.load_run, agent_cfg.load_checkpoint)
return _resolve_checkpoint(args_cli, agent_cfg, log_root_path)

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.

P1 Run-directory checkpoints still fail. With --checkpoint /path/to/teacher_run, update_rsl_rl_cfg sets agent_cfg.load_checkpoint to that directory. The delegated resolver then passes this value to get_checkpoint_path as the pattern for checkpoint filenames. No model_*.pt filename matches the directory path, so the benchmark raises No checkpoints in the directory even when the teacher exists. Preserve a filename pattern when resolving a directory, and add a directory case to the tests.

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.

Fixed in 3947f8e. A --checkpoint run directory now resolves with the model_.*\.pt pattern in the shared resolver (this also fixes the training entrypoint), and a new test covers it. @greptileai could you re-review?

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.

The reported failure is fixed: the shared resolver now searches a run directory for model_*.pt, and the new test covers choosing the newest checkpoint.

One edge case remains: get_checkpoint_path treats its run_dir argument as an unanchored regex (re.match), but the resolver passes the directory basename directly. If a sibling directory shares that prefix (for example, run and run-retry), it can select the sibling instead of the explicitly requested run. Escaping and anchoring the basename—or resolving directly inside the provided directory—would avoid that ambiguity. I confirmed the regression test is present, but did not execute it.

Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

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.

Good catch on the sibling case. Fixed in 1b9a0b1: the run name is now escaped and anchored, trailing slashes are normalized, and the test adds a <run>-retry sibling with a higher iteration that must not be selected.

@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

Needs attention: Scope and over-engineering (1), Compatibility and deprecation (2), Test quality (2). Other reviewed categories look good.

  • PR description: Mention the G1 runner-API fix in the title, qualify no-checkpoint rejection for configured resume, and consolidate repeated validation while preserving template sections; supplied runs support functionality, with no measurable performance claim.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: Minimal implementation: Extend benchmark_train_rsl_rl.run with direct checkpoint selection and retain G1 distillation.py for runner integration; delete the single-use resolver and keep both changelog fragments. No source modules were added; the essential flow resolves, loads, and trains. Scope is cohesive; no split recommended.
  • API: API changes look good.
  • Compatibility and deprecation: Breaking changes: implicit distillation resume and MirrorDistillation’s documented returns lose their old contracts; preserve functional legacy paths with targeted warnings, migration and removal guidance, and transition coverage.
  • Implementation: Implementation looks good.
  • Style consistency: Style consistency looks good.
  • Test quality: Private-resolver tests miss regressions in run() selection and loading; exercise the benchmark caller and add a competing run or narrow the latest-run claim.

Significant concerns. Posted 5 inline findings.

Automated review; human maintainers own approval decisions.

return args_cli, remaining_args, cli_args


def _resolve_resume_path(args_cli, agent_cfg, log_root_path: str) -> str | 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.

🟡 Warning · Scope Complexity — Inline the single-use resolver

This helper adds a handoff and lengthy duplicate contract prose for one branch at one production call site. Put the resume selection in run() and delete the helper.

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.

Keeping the helper: it is the seam that the checkpoint-resolution tests exercise directly, which a simulation-level run() test cannot do cheaply.


if agent_cfg.resume and not args_cli.checkpoint:
return get_checkpoint_path(log_root_path, agent_cfg.load_run, agent_cfg.load_checkpoint)
return _resolve_checkpoint(args_cli, agent_cfg, log_root_path)

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.

🟡 Warning · Compatibility — Deprecate implicit distillation resume

Distillation previously loaded an existing student checkpoint with resume=False and no --checkpoint; it now raises ValueError. Keep that path functional during a warned, documented transition and validate both paths.

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.

Intentional. Distillation without --checkpoint loading the student's own latest run was the bug; the training entrypoint already rejects it and --checkpoint supplies the teacher. A configured resume still searches the experiment's runs. The PR description now says so.



def _rsl_rl_resume_path(tmp_path: Path, *, distillation: bool, checkpoint: str | None = None, resume: bool = False):
from isaaclab.benchmark.entrypoints.backends.rsl_rl.benchmark_train_rsl_rl import _resolve_resume_path

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.

🟡 Warning · Test Quality — Exercise the benchmark caller

All new cases call only _resolve_resume_path; they pass if run() restores its faulty selection or omits runner.load. Exercise run() with lightweight substitutes and assert the selected load path and failures.

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.

Not adding a run()-level test: it needs a full simulation and runner. The end-to-end student benchmark was run on an L40 (newton_mjwarp and newton_kamino) and covers the load path. The checkpoint-selection logic is covered by the helper tests, now including a run-directory case.



def test_rsl_rl_benchmark_resume_searches_experiment_runs(tmp_path: Path) -> None:
"""A configured resume without ``--checkpoint`` continues this experiment's latest run."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Warning · Test Quality — Prove or remove latest-run claim

The fixture has one run, so it cannot distinguish latest-run selection from first-run selection. Add an older competing run or describe only the configured-resume behavior tested.

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.

Fixed in 3947f8e. The fixture now has an older run with a higher iteration (model_99.pt), so the test only passes if the newest run is selected.

stats = {"Optimizer/learning_rate": self.learning_rate}
if self.student.distribution is not None:
stats["Model/mean_policy_std"] = self.student.output_std.mean().item()
return {"behavior": mean_loss / count}, stats

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.

🟡 Warning · Compatibility — Preserve documented algorithm returns

MirrorDistillation.update() changes its documented loss mapping to a tuple, and process_env_step() changes None to a mapping. Direct callers lose those returns; provide a warned legacy path alongside the runner-facing contract, with migration guidance and validation.

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.

Not keeping a legacy path: MirrorDistillation subclasses the RSL-RL algorithm and is only called by the runner, and the old return values crash against the pinned RSL-RL (#8866). The docstrings now document the new returns.

@yts-nv

yts-nv commented Nov 24, 2026

Copy link
Copy Markdown
Contributor 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 Nov 24, 2026
@kellyguo11
kellyguo11 enabled auto-merge (squash) November 24, 2026 03:09
@ooctipus ooctipus changed the title Honor explicit checkpoints in the RSL-RL training benchmark Unify RSL-RL training checkpoints and fix G1 distillation Nov 24, 2026
@ooctipus ooctipus added the ci:run-docker Trigger the on-demand Docker and GPU CI workflow label Nov 24, 2026
@ooctipus ooctipus self-assigned this Nov 24, 2026
@kellyguo11

Copy link
Copy Markdown
Contributor

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 Nov 24, 2026
@kellyguo11
kellyguo11 merged commit 99a3acd into isaac-sim:main Nov 24, 2026
84 of 131 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants