Repository navigation
Fix RLinf playback checkpoint selectors and update the VLA post-training guide - #9155
Conversation
Remove the personal checkpoint links paragraph and fix the issues found while verifying the documented workflow end to end: - Move the assemble_trocar ``hf download`` after the Step 2 dependency pins into a new subsection and run it with ``uv run --no-sync``; with the lockfile's huggingface-hub 1.x and typer 0.27 the ``hf`` command exits non-zero after downloading. Raise the hub pin floor to 0.34, the first release that ships the ``hf`` CLI. - Add ``Environments/Grid`` to the local mirror subtree list since the default ground plane is loaded from there. - Mark flash-attn as optional for GR00T N1.7, which falls back to SDPA attention with a warning when it is missing. - Add ``--no-sync`` to the ``uv run isaaclab`` commands in Key Files.
``isaaclab play --rl_library rlinf --checkpoint latest|best`` looked up run manifests with ``env.eval.init_params.id`` while training records ``env.train.init_params.id``, so recipes with a separate evaluation task id never found their checkpoints. Resolve the selector against the training id, matching the train entrypoint. Resolve ``--config_path`` to an absolute directory before handing it to Hydra, whose ``initialize_config_dir()`` rejects relative paths. Extend the launch test into a train/play round trip with a relative config directory: training writes the run manifest and playback resolves ``latest`` through it although the eval task id differs.
[Medium impact] The PR appears safe to merge. SummaryFixes RLinf checkpoint selection and relative config directories.
No actionable issues found. This review checked source code; it did not run tests or GPU workflows. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
Config[Config directory] --> Absolute[Resolve absolute path]
Absolute --> Hydra[Compose recipe]
Hydra --> Train[Training task ID]
Train --> Manifest[Write run manifest]
Hydra --> Play[Playback selector]
Manifest --> Match[Match training task and config name]
Play --> Match
Match --> Weights[Load saved weights]
Reviews (1) · Last reviewed commit: "Fix RLinf playback checkpoint selectors ..." · Reviewed by Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Implementation (1), Style consistency (1). Other reviewed categories look good.
- PR description: The title matches the five-file diff; describe validation as mocked CLI composition with synthetic weights, record the actual pytest deselection command, and limit the hf compatibility claim to the documented >=0.34,<1.0 range.
- Design and architecture: Architecture looks good.
- Scope and over-engineering: No over-engineering issues.
- API: API changes look good.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: The N1.7 command block still executes flash-attn installation without CUDA 13 nvcc; move that command into a separate optional step so the documented SDPA path remains usable.
- Style consistency: The new launch helper omits backend and return annotations required by contribution guidance; annotate the module parameter and composed configuration result.
- Test quality: Test quality looks good.
Minor fixes needed. Posted 2 inline findings.
Automated review; human maintainers own approval decisions.
| uv pip install --no-deps \ | ||
| "git+https://github.com/NVIDIA/Isaac-GR00T.git@1a1837f20538b7d7e21f977a11a5aee14f99803c" \ | ||
| "transformers==4.57.3" "tokenizers>=0.22,<0.23" "huggingface-hub>=0.34,<1.0" | ||
| # Optional: building flash-attn requires a CUDA 13 nvcc. Without it, N1.7 logs a warning |
There was a problem hiding this comment.
🟡 Warning · Implementation — Separate the optional flash-attn install
The N1.7 command block still installs flash-attn when followed as written, failing without CUDA 13 nvcc despite the stated SDPA fallback. Put the install in a clearly optional step.
| backend.run(args) | ||
| GlobalHydra.instance().clear() | ||
|
|
||
| def launch(backend, checkpoint: str): |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Annotate the new launch helper
The helper omits its backend parameter and return annotations, contrary to the signature-typing rule. Annotate the module argument and composed configuration return value.
|
run-ci |
|
should we cherry pick this to release? |
Yes, I have updated the description. |
## Summary Support installed external tasks in RLinf training and playback while keeping task and service implementations downstream. These shared changes are separate from #9148 and do not require its Trocar assets or task update. - Register external tasks in simulator workers and consistently forward task selection, retaining distinct train/eval IDs when no CLI override is supplied. - Preserve split-specific settings while replacing recipe keys overridden by the CLI, including physics/renderer preset selectors. - Read success from pre-reset `final_obs` and preserve the first completed episode’s outcome through the action chunk. Reset-episode frames cannot erase a win or turn a completed failure into a win; legacy recipes retain their metrics. - Keep deterministic, device-preserving resizing in `isaaclab.utils.images`, round uint8 pixels to nearest, and leave augmentation in task observation processors. Resolve worker split settings once and document tensor layout and storage ownership. - Require paired GPU resize dimensions for GR00T N1.5 and validate matching train/eval output sizes and adapt a metadata copy without mutating checkpoint metadata. - Select an optional `runner.isaaclab_context` in the training recipe to manage worker initialization/training, without adding Gym constructor kwargs. Preserve padded hold actions after mid-chunk resets. Consumers: [medical-pad GR00T/GRPO demo](isaac-sim/isaaclab_demos#14) and [Trocar Cosmos demo](isaac-sim/isaaclab_demos#13). Only the latter also requires the task changes in #9148. ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `main` ## Validation - RLinf adapter: **39 passed**; entrypoints: **67 passed**; image utilities: **54 passed**. - Medical-pad integration/configuration/action codec: **14 passed** against this standalone branch. - Trocar demo: **11 passed** against the combined Lab snapshot; the explicit-RTX configuration regression also passed. - Native RLinf 16-action chunk dispatch with real Lab autoreset passed success and failure checks on CPU, using stand-in world-model/classifier dependencies. The success observation becomes false immediately on reset, so this does not rely on tracker caching. - Incompatible train/eval sizes and legacy augmentation keys fail on the driver before RLinf validation or cluster startup. - Trocar task crop/configuration/rendering: **3 passed**; updated PhysX/RTX smoke with task cropping enabled passed. - Full `isaaclab --format` checks, including changelog validation, passed. ## GPU image-preprocessing measurement Baseline: [`a3ff0b523`](KumoLiu@a3ff0b5). Candidate: combined snapshot [`806b6f1fa`](KumoLiu@806b6f1), including the task-owned crop processor from #9148 and this PR's deterministic resizing. NVIDIA A100 80 GB PCIe, PyTorch 2.11.0+cu130, GPU 0. Process 32 environments × 3 uint8 BHWC views, 320×240 → 224×224 after a 5% crop. Each case uses 50 warmups and 250 measured observations, with interleaved baseline/candidate batches and synchronization at batch boundaries. The measurement includes the actual crop/resize functions and observation-manager image copies; it excludes simulation, IPC, policy inference and extra-view stacking. | Processing | Baseline ms/observation | Candidate ms/observation | | --- | ---: | ---: | | Center crop | 0.958 | 1.057 | | Random crop | 1.526 | 1.586 | With matching crop offsets, pixel differences are at most one uint8 level because conversion now rounds rather than truncates. These results quantify preprocessing cost only and do not establish end-to-end training throughput or success-rate parity. <details> <summary>Reproduce the preprocessing measurement</summary> Run from the tested combined snapshot with its task dependencies installed and the baseline commit available locally: ```bash CUDA_VISIBLE_DEVICES=0 uv run --no-sync python - <<'PYCODE' """Compare the actual policy image functions, including observation-manager storage ownership.""" import ast,json,statistics,subprocess,time from pathlib import Path import torch from isaaclab.utils.images import resize_images from isaaclab_tasks.contrib.assemble_trocar.mdp.observations import crop_policy_camera LAB=Path.cwd() BASELINE='a3ff0b5235847231d6191dd487176699cb8e077f' source=subprocess.check_output(['git','show',BASELINE+':source/isaaclab/isaaclab/utils/images.py'],cwd=LAB,text=True) node=next(n for n in ast.parse(source).body if isinstance(n,ast.FunctionDef) and n.name=='crop_and_resize_images') ns={'torch':torch};exec(ast.get_source_segment(source,node),ns);old_resize=ns['crop_and_resize_images'] images=[torch.randint(256,(32,240,320,3),device='cuda:0',dtype=torch.uint8) for _ in range(3)] results=[] with torch.inference_mode(): for random in (False,True): def old(): return [old_resize(image.clone(),height=224,width=224,crop_scale=.05,random_crop=random) for image in images] def new(): # ObservationManager copies processor inputs and copies borrowed processor outputs. return [resize_images(crop_policy_camera(image.clone(),scale=.05,random_crop=random).clone(),height=224,width=224) for image in images] torch.cuda.manual_seed_all(13);before=old() torch.cuda.manual_seed_all(13);after=new() max_delta=max(int((a.to(torch.int16)-b.to(torch.int16)).abs().max()) for a,b in zip(before,after)) assert max_delta<=1,max_delta for fn in (old,new): for _ in range(50):fn() torch.cuda.synchronize();samples={'baseline':[],'candidate':[]};functions={'baseline':old,'candidate':new} for repeat in range(10): order=['baseline','candidate'] if repeat%2==0 else ['candidate','baseline'] for name in order: torch.cuda.synchronize();start=time.perf_counter() for _ in range(25):functions[name]() torch.cuda.synchronize();samples[name].append((time.perf_counter()-start)*1000/25) results.append({'crop':'random' if random else 'center','max_pixel_difference':max_delta,**{name:{'mean_ms':statistics.mean(values),'min_ms':min(values),'max_ms':max(values)} for name,values in samples.items()}}) report={'baseline':BASELINE,'candidate':subprocess.check_output(['git','rev-parse','HEAD'],cwd=LAB,text=True).strip(),'gpu':torch.cuda.get_device_name(0),'torch':torch.__version__,'envs':32,'views':3,'input_hw':[240,320],'output_hw':[224,224],'crop_scale':.05,'warmup':50,'measured':250,'includes':'actual crop and resize functions plus observation-manager image clones; excludes simulation, RPC, model inference','results':results} path=Path('policy-image-processing.json');path.write_text(json.dumps(report,indent=2));print(json.dumps(report,indent=2)) PYCODE ``` </details> Based on main `c1afcee17`, including #9155 checkpoint selector fixes for separate train/eval task IDs. ## Runner context configuration Training recipes can set `runner.isaaclab_context: module:callable`. The callable receives the runner and merged training environment overrides (recipe plus CLI), then returns a context manager. The optional hook is used by the Trocar Cosmos demo to manage service GPU residency during collection and policy updates. Unset recipes use the normal training path. The context wraps worker initialization and training, including exception cleanup, and is never stored in Gym task constructor kwargs. ## Type of change - Bug fix - New feature - Documentation update --------- Co-authored-by: Fanxing-LI <[email protected]>
…9217) ## Summary Support installed external tasks in RLinf training and playback while keeping task and service implementations downstream. These shared changes are separate from isaac-sim#9148 and do not require its Trocar assets or task update. - Register external tasks in simulator workers and consistently forward task selection, retaining distinct train/eval IDs when no CLI override is supplied. - Preserve split-specific settings while replacing recipe keys overridden by the CLI, including physics/renderer preset selectors. - Read success from pre-reset `final_obs` and preserve the first completed episode’s outcome through the action chunk. Reset-episode frames cannot erase a win or turn a completed failure into a win; legacy recipes retain their metrics. - Keep deterministic, device-preserving resizing in `isaaclab.utils.images`, round uint8 pixels to nearest, and leave augmentation in task observation processors. Resolve worker split settings once and document tensor layout and storage ownership. - Require paired GPU resize dimensions for GR00T N1.5 and validate matching train/eval output sizes and adapt a metadata copy without mutating checkpoint metadata. - Select an optional `runner.isaaclab_context` in the training recipe to manage worker initialization/training, without adding Gym constructor kwargs. Preserve padded hold actions after mid-chunk resets. Consumers: [medical-pad GR00T/GRPO demo](isaac-sim/isaaclab_demos#14) and [Trocar Cosmos demo](isaac-sim/isaaclab_demos#13). Only the latter also requires the task changes in isaac-sim#9148. ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `main` ## Validation - RLinf adapter: **39 passed**; entrypoints: **67 passed**; image utilities: **54 passed**. - Medical-pad integration/configuration/action codec: **14 passed** against this standalone branch. - Trocar demo: **11 passed** against the combined Lab snapshot; the explicit-RTX configuration regression also passed. - Native RLinf 16-action chunk dispatch with real Lab autoreset passed success and failure checks on CPU, using stand-in world-model/classifier dependencies. The success observation becomes false immediately on reset, so this does not rely on tracker caching. - Incompatible train/eval sizes and legacy augmentation keys fail on the driver before RLinf validation or cluster startup. - Trocar task crop/configuration/rendering: **3 passed**; updated PhysX/RTX smoke with task cropping enabled passed. - Full `isaaclab --format` checks, including changelog validation, passed. ## GPU image-preprocessing measurement Baseline: [`a3ff0b523`](KumoLiu@a3ff0b5). Candidate: combined snapshot [`806b6f1fa`](KumoLiu@806b6f1), including the task-owned crop processor from isaac-sim#9148 and this PR's deterministic resizing. NVIDIA A100 80 GB PCIe, PyTorch 2.11.0+cu130, GPU 0. Process 32 environments × 3 uint8 BHWC views, 320×240 → 224×224 after a 5% crop. Each case uses 50 warmups and 250 measured observations, with interleaved baseline/candidate batches and synchronization at batch boundaries. The measurement includes the actual crop/resize functions and observation-manager image copies; it excludes simulation, IPC, policy inference and extra-view stacking. | Processing | Baseline ms/observation | Candidate ms/observation | | --- | ---: | ---: | | Center crop | 0.958 | 1.057 | | Random crop | 1.526 | 1.586 | With matching crop offsets, pixel differences are at most one uint8 level because conversion now rounds rather than truncates. These results quantify preprocessing cost only and do not establish end-to-end training throughput or success-rate parity. <details> <summary>Reproduce the preprocessing measurement</summary> Run from the tested combined snapshot with its task dependencies installed and the baseline commit available locally: ```bash CUDA_VISIBLE_DEVICES=0 uv run --no-sync python - <<'PYCODE' """Compare the actual policy image functions, including observation-manager storage ownership.""" import ast,json,statistics,subprocess,time from pathlib import Path import torch from isaaclab.utils.images import resize_images from isaaclab_tasks.contrib.assemble_trocar.mdp.observations import crop_policy_camera LAB=Path.cwd() BASELINE='a3ff0b5235847231d6191dd487176699cb8e077f' source=subprocess.check_output(['git','show',BASELINE+':source/isaaclab/isaaclab/utils/images.py'],cwd=LAB,text=True) node=next(n for n in ast.parse(source).body if isinstance(n,ast.FunctionDef) and n.name=='crop_and_resize_images') ns={'torch':torch};exec(ast.get_source_segment(source,node),ns);old_resize=ns['crop_and_resize_images'] images=[torch.randint(256,(32,240,320,3),device='cuda:0',dtype=torch.uint8) for _ in range(3)] results=[] with torch.inference_mode(): for random in (False,True): def old(): return [old_resize(image.clone(),height=224,width=224,crop_scale=.05,random_crop=random) for image in images] def new(): # ObservationManager copies processor inputs and copies borrowed processor outputs. return [resize_images(crop_policy_camera(image.clone(),scale=.05,random_crop=random).clone(),height=224,width=224) for image in images] torch.cuda.manual_seed_all(13);before=old() torch.cuda.manual_seed_all(13);after=new() max_delta=max(int((a.to(torch.int16)-b.to(torch.int16)).abs().max()) for a,b in zip(before,after)) assert max_delta<=1,max_delta for fn in (old,new): for _ in range(50):fn() torch.cuda.synchronize();samples={'baseline':[],'candidate':[]};functions={'baseline':old,'candidate':new} for repeat in range(10): order=['baseline','candidate'] if repeat%2==0 else ['candidate','baseline'] for name in order: torch.cuda.synchronize();start=time.perf_counter() for _ in range(25):functions[name]() torch.cuda.synchronize();samples[name].append((time.perf_counter()-start)*1000/25) results.append({'crop':'random' if random else 'center','max_pixel_difference':max_delta,**{name:{'mean_ms':statistics.mean(values),'min_ms':min(values),'max_ms':max(values)} for name,values in samples.items()}}) report={'baseline':BASELINE,'candidate':subprocess.check_output(['git','rev-parse','HEAD'],cwd=LAB,text=True).strip(),'gpu':torch.cuda.get_device_name(0),'torch':torch.__version__,'envs':32,'views':3,'input_hw':[240,320],'output_hw':[224,224],'crop_scale':.05,'warmup':50,'measured':250,'includes':'actual crop and resize functions plus observation-manager image clones; excludes simulation, RPC, model inference','results':results} path=Path('policy-image-processing.json');path.write_text(json.dumps(report,indent=2));print(json.dumps(report,indent=2)) PYCODE ``` </details> Based on main `c1afcee17`, including isaac-sim#9155 checkpoint selector fixes for separate train/eval task IDs. ## Runner context configuration Training recipes can set `runner.isaaclab_context: module:callable`. The callable receives the runner and merged training environment overrides (recipe plus CLI), then returns a context manager. The optional hook is used by the Trocar Cosmos demo to manage service GPU residency during collection and policy updates. Unset recipes use the normal training path. The context wraps worker initialization and training, including exception cleanup, and is never stored in Gym task constructor kwargs. ## Type of change - Bug fix - New feature - Documentation update --------- Co-authored-by: Fanxing-LI <[email protected]> (cherry picked from commit 05e3a7d)
…l task support (#9306) ## Description Backport #9155, #9184, and #9217 to `release/3.1.0`: - #9155: fix RLinf playback checkpoint selectors and relative config paths, strengthen train-to-play regression coverage, and update the VLA post-training guide. - #9184: add pi0.5 evaluation and inference-server scripts for sampled tabletop tasks, and change the gripper/prop contact response to 20 ms. - #9217: support external RLinf tasks, preserve split-specific recipe overrides, capture terminal episode success, add deterministic image resizing and validation, and support an optional training runner context. Cherry-picked with `-x` from `c1afcee17283aacaebd5ccdbb4e823827752ffd6`, `92ecbeeb428fb50b242651d747be0fe3bcef6d4e`, and `05e3a7dc46dce08a2e61511cf5ef358a5ffd4c2d`. All three applied without conflicts or manual edits; stable patch IDs match the original commits. The prerequisite tabletop task from #9165 is already on the release branch. Original changelog fragments are included for every touched package. ## Type of change - Release backport: bug fixes, features, example scripts, and documentation ## Validation - Full repository formatting/lint and changelog hooks pass on the final combined changes, using `ISAACLAB_CHANGELOG_BASE_REF=upstream/release/3.1.0`. - `git diff --check upstream/release/3.1.0` passes; all three stable patch IDs match their source commits. - Image utilities: **54 passed** locally after adding #9217. - RLinf adapter: 32 passed locally; remaining tests are blocked by missing dependencies in the local macOS environment. Entrypoint test collection is also blocked by unavailable runtime dependencies. - Clean docs build attempted locally; uv rejects macOS because the lockfile supports Linux and Windows only. - GPU inference, training, and simulation were not rerun locally for this backport. - Full CI retriggered with `run-ci` and completed on final head `eae44aca5037347a7bd95cb2a5fdc5447c29eb25`: **54 passed, 7 skipped/neutral, no failures or pending checks**. - [Docker + Tests](https://github.com/isaac-sim/IsaacLab/actions/runs/46363334813) passed, including RLinf, contrib, core, task, rendering, and performance jobs. Windows, ARM, multi-GPU unit/training smoke tests, clean docs build, wheel, licensing, pre-commit, and changelog checks also passed. OVStage tests were not requested by the plain `run-ci` command. ## Checklist - [x] Read the contribution guidelines - [x] Run full formatting and lint checks - [x] Preserve the original documentation, regression tests, and changelog changes - [x] Verify all three cherry-picks match the original patches - [x] Complete CI on the final combined head --------- Co-authored-by: Fanxing-LI <[email protected]> Co-authored-by: Octi Zhang <[email protected]> Co-authored-by: YunLiu <[email protected]> Co-authored-by: Fanxing-LI <[email protected]>
Description
Follow-up to #7776. Verifying the RLinf VLA post-training guide end to end turned up two defects in the
isaaclab_rlRLinf entry points and several problems in the guide itself. This PR fixes them and removes the remaining references to personal Hugging Face checkpoints.Entry point fixes (
isaaclab_rl)isaaclab play --rl_library rlinf --checkpoint latest|bestnever found a checkpoint. Playback looked up run manifests withenv.eval.init_params.id, while training recordsenv.train.init_params.id. All three shipped recipes use a distinct...-Evalid for evaluation, so the lookup always failed withNo compatible manifested run with a checkpoint was found. Playback now resolves the selector against the training id, matchingtrain_rlinf.py; an explicit--taskstill takes precedence.--config_pathfailed withinitialize_config_dir() requires an absolute config_dir as input. The path is now resolved to an absolute directory before Hydra is initialized.latestthrough it although the recipe's eval task id differs from its training id. Reverting either fix, or making training record the eval id, turns the test red with the original errors.Documentation (
rlinf_vla_posttraining.rst)assemble_trocarhf downloadfrom the prerequisites into a new "Assemble Trocar checkpoint" subsection after the Step 2 dependency pins, and run it withuv run --no-sync. With the lockfile'shuggingface-hub1.x andtyper0.27,hfdownloads the files but exits non-zero with aclick.exceptions.Exittraceback; anyhuggingface-hub< 1.0 works. The Step 2 floor is raised to>=0.34, the first release that ships thehfCLI.Environments/Gridto the local-mirror subtree list; the defaultGroundPlaneCfgUSD is loaded from there.nvccto match the lockfile's torch).--no-syncto theuv run isaaclab ...commands in "Key Files" so they do not re-sync the environment.No linked issue.
Type of change
Screenshots
Not applicable (CLI and documentation changes).
Validation
uv run python -m pytest source/isaaclab_rl/test/test_entrypoints.pypasses (the one skrl parser test was deselected locally becauseskrlis not installed in my environment).ValueError; reverting the config-path fix fails it with the Hydrainitialize_config_dir()error; making training record the eval id fails it with the manifestValueError.pre-commiton the changed files, the changelog gate (tools/changelog/cli.py check), and a Sphinx render of the guide pass.Release backport
mainChecklist
Docker and GPU tests run on demand. Push the commits you want tested, then comment
run-cion the pull request, orrun-ci ovstageto include kitless OVStage rendering tests for that run. Subsequent pushes and plainrun-cicomments do not run OVStage tests unless you commentrun-ci ovstageagain.pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions — CI handles that)CONTRIBUTORS.mdor my name already exists there