Repository navigation
Add GR00T Training Examples: Pick and place apple and pack AGX orin - #7776
Conversation
|
| for model_cfg in (cfg.actor.model, cfg.rollout.model): | ||
| model_cfg.model_path = str(Path(model_cfg.model_path).expanduser().resolve()) |
There was a problem hiding this comment.
Backbone path remains relative
The new N1.7 configurations require a local backbone_model_path, but this loop only makes model_path absolute. If RLinf's native N1.7 loader resolves the backbone path in the Ray worker, it looks for .pretrained_checkpoints/rlinf/Cosmos-Reason2-2B relative to the worker's different working directory and can fail to load the model. Resolve backbone_model_path for both actor and rollout configurations here and in the equivalent loop in play_rlinf.py.
| satisfied = ( | ||
| installed_version("rlinf") == RLINF_VERSION and installed_version("transformers") == profile.transformers | ||
| ) | ||
| if not force and satisfied: | ||
| print_info(f"rlinf=={RLINF_VERSION} and transformers=={profile.transformers} are already installed.") | ||
| return |
There was a problem hiding this comment.
The installer treats the profile as satisfied without checking its generation-specific tokenizers requirement. If a partial installation or later package operation leaves RLinf and Transformers at the requested versions but removes or changes Tokenizers, rerunning this advertised repairable installer skips the corrective installation and leaves GR00T with an incompatible environment. Include the installed Tokenizers version and the profile's required range in this check.
There was a problem hiding this comment.
Isaac Lab Review Bot
The GR00T N1.7 integration has two material integration gaps: the new relative backbone path is not normalized before reaching Ray workers, and the existing assemble-trocar task is moved from a versioned NVIDIA asset bundle to an unpinned personal Hugging Face repository. Evaluation logging also reports the obsolete checkpoint field, and shared H2 action logic is duplicated across both tasks.
- Design and architecture: The shared H2 + Sharpa package is the appropriate ownership boundary, but both task packages retain byte-identical gravity-compensated action implementations that should live in that shared module. Repointing an existing task from its versioned NVIDIA bundle to a temporary personal asset host also weakens the task's availability and reproducibility contract.
- API: Checkpoint and resume resolution support the intended path forms, but the evaluation banner still reads runner.eval_policy_path after checkpoint loading moved to runner.ckpt_path or model rl_model_path, so runs supplied with --checkpoint are reported as using no checkpoint. The assemble-trocar asset source change also alters an existing environment's external compatibility surface without a stable replacement host.
- Implementation: Both entrypoints convert model_path to an absolute path for Ray workers but leave the new relative backbone_model_path unchanged, so N1.7 workers can resolve the Cosmos backbone against the wrong working directory. Normalize that field in train and play as well. Consolidate the duplicated H2 gravity-compensated action term in the shared embodiment module and update the checkpoint banner to report the path actually consumed.
Significant concerns. Posted 4 actionable findings inline.
Automated review; human maintainers own approval decisions.
| # Ray workers do not inherit the launcher's working directory, so a relative | ||
| # checkpoint path from the YAML must be made absolute before it reaches them. | ||
| for model_cfg in (cfg.actor.model, cfg.rollout.model): | ||
| model_cfg.model_path = str(Path(model_cfg.model_path).expanduser().resolve()) |
There was a problem hiding this comment.
🟡 Warning · Implementation — backbone_model_path stays relative for Ray workers
This loop (and the identical one in play_rlinf.py) absolutizes only model_path, but both new N1.7 configs also set a relative backbone_model_path: ".pretrained_checkpoints/rlinf/Cosmos-Reason2-2B", annotated as needing a local directory for offline load. By the same reasoning stated in the added comment, workers resolve it against their own working directory and can fail to find the backbone. Normalize backbone_model_path when present in both entrypoints.
| @@ -77,8 +77,9 @@ | |||
| "right_elbow_joint": -0.3, | |||
| } | |||
|
|
|||
| HEALTHCARE_S3 = "https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/Healthcare/0.5.0/132c82d" | |||
| USD_ROOT = f"{HEALTHCARE_S3}/Props/LightWheel" | |||
| from isaaclab_tasks.contrib.rlinf_assets import PROP_ASSET_ROOT | |||
There was a problem hiding this comment.
🟡 Warning · Design Architecture — Existing task repointed to personal asset host
USD_ROOT for the already-shipping IsaacContrib-Assemble-Trocar-G129-Dex3 moves from the versioned NVIDIA Omniverse bundle to RLINF_DEMO_ASSET_ROOT, which defaults to a personal Hugging Face account with no pinned revision. A previously stable public environment now breaks if that repository is renamed, gated or reorganized. Keep this task on its published asset-server bundle until the shared tree is hosted officially; also move the new import to module top.
| # The RLinf extension overlays these onto the N1.5 model it constructs. Older RLinf | ||
| # builds the rollout model from actor.model, newer ones from rollout.model in eval mode. | ||
| cfg.actor.model.rl_model_path = rl_weights | ||
| cfg.rollout.model.rl_model_path = rl_weights |
There was a problem hiding this comment.
🔵 Suggestion · Implementation — Startup banner prints unset eval_policy_path
runner.eval_policy_path is no longer assigned, yet the unchanged banner below still prints it and the task YAMLs default it to null. Every evaluation run now logs Checkpoint: None even when --checkpoint resolved weights, so the log no longer shows which weights were loaded. Print the resolved rl_weights (or the field actually consumed) instead.
| from isaaclab.envs.mdp.actions.joint_actions import JointPositionAction | ||
|
|
||
|
|
||
| class H2GravityCompensatedJointPositionAction(JointPositionAction): |
There was a problem hiding this comment.
🔵 Suggestion · Design Architecture — Embodiment action term duplicated across tasks
H2GravityCompensatedJointPositionAction is byte-identical to the copy in pick_and_place_apple/mdp/actions.py — its docstring still reads "pick-and-place apple task" — and the policy-order observation helpers are duplicated the same way. These are embodiment-level, not task-level, and this PR already adds isaaclab_tasks.contrib.h2_sharpa for exactly that; two copies will drift as the H2 articulation changes.
|
|
||
| import gymnasium as gym | ||
|
|
||
| for task_id in ("IsaacContrib-Pack-AGX-Orin-H2-Sharpa", "IsaacContrib-Pack-AGX-Orin-H2-Sharpa-Eval"): |
There was a problem hiding this comment.
expand this instead of using for loop
| from ..camera_config import CameraPresets | ||
| from ..robot_config import H2RobotPresets | ||
|
|
||
| TABLE_USD = f"{PROP_ASSET_ROOT}/Assets/Table256/Table256.usd" |
There was a problem hiding this comment.
USD link should be in env_cfg I think
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def _preview_material( |
There was a problem hiding this comment.
lets use the visual material asset cfg in config for this
There was a problem hiding this comment.
This material post-modification is added by mingxue. Rather than manually changing the material, it should update the asset primarily. This alignment affects sim2real transfer, but if for demo, we can remove these patches here. I have commented out these lines.
| if len(env_ids) == 0: | ||
| return | ||
|
|
||
| from .rewards import get_pack_agx_state |
There was a problem hiding this comment.
lets have import at top instead
| return _policy_idx_cache[key] | ||
|
|
||
|
|
||
| def get_robot_joint_states(env: ManagerBasedRLEnv) -> torch.Tensor: |
There was a problem hiding this comment.
it might be easier to use shared mdp for joint pos and joint velocity instead of declare your own
There was a problem hiding this comment.
I put basic h2 sharpa robot into asset/robot/, the head camera into asset/camera/
| return torch.cat([joint_pos, joint_vel, joint_torque], dim=-1) | ||
|
|
||
|
|
||
| def get_robot_policy_joint_positions(env: ManagerBasedRLEnv) -> torch.Tensor: |
There was a problem hiding this comment.
you could use joint position and supply the index through scene_entity_cfg instead of creating a new function
| return env.pnp_apple_state | ||
|
|
||
|
|
||
| def get_task_stage(env: ManagerBasedRLEnv) -> torch.Tensor: |
There was a problem hiding this comment.
shim function should be avoid as much as possible unless there are difficult reasons
There was a problem hiding this comment.
This function has been removed. now it directly use env.pnp_apple_state.
| reward. Release requires the AGX to remain seated, the right thumb to open, | ||
| and the right wrist to retreat. | ||
| """ | ||
| state = get_pack_agx_state(env) |
There was a problem hiding this comment.
lets try to reduce function that takes in env, they are way to flexible and unstructured
There was a problem hiding this comment.
This is the function left by Healthcare, I change it into a startup event.
| return get_pack_agx_state(env).task_stage | ||
|
|
||
|
|
||
| def _position_distance( |
There was a problem hiding this comment.
the math is simple enough it might be easier to directly look at computation rather than wrapped in function
There was a problem hiding this comment.
I have removed this func, making lines where use this func directly refers to get_pack_agx_state(env).task_stage.
| advance = in_stage & (hold_counter >= hold_steps) | ||
| stage = torch.where(advance, torch.full_like(stage, current + 1), stage) | ||
| hold_counter = torch.where(advance, torch.zeros_like(hold_counter), hold_counter) | ||
| return stage, hold_counter |
There was a problem hiding this comment.
we might want to avoid the word stage, beucase stage usually in isaaclab means usd stage, in this case you means phase, you can have a enum of predefined stage constant for better readability
There was a problem hiding this comment.
I have replaced all stage with phase.
There was a problem hiding this comment.
I don't think it makes sense to called this as rlinf_assets.py. Rlinf does not provide any asset.
There was a problem hiding this comment.
It is a temporary file here, after robot and asset has been upload to right position, it will be deleted.
The scene props the three RLinf post-training tasks draw from the shared bundle are Lightwheel SimReady assets, distributed under Creative Commons Attribution-NonCommercial 4.0 International. Neither the attribution nor the licence terms were recorded anywhere in the repository. Collect the terms under docs/licenses/assets/, next to the other asset licences, and state the attribution in both places a reader meets the assets: an "Attribution and Citation" section in the feature documentation, and a comment on the PROP_ASSET_ROOT constant the tasks resolve their USDs from. The documentation section also carries the RLinf citation, the framework the whole feature is built on. The non-commercial grant is called out under an "attention" admonition rather than left implicit, because Isaac Lab itself ships under BSD-3-Clause.
Share robot control and camera definitions, use ordered policy actions directly, and keep episode progress in the success term. Reuse RLinf chunk handling and apply material overrides when prototypes are spawned. Replace the checkout-repair installer with explicit dependency setup. Validate 77 focused tests, four task configurations, and native RLinf chunk-loop equivalence across eight mode combinations. Full scene checks remain blocked by HTTP 401 from the task asset repository.
d2dc6db to
76d9dd7
Compare
…ing guide (#9155) # Description Follow-up to #7776. Verifying the RLinf VLA post-training guide end to end turned up two defects in the `isaaclab_rl` RLinf 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|best` never found a checkpoint. Playback looked up run manifests with `env.eval.init_params.id`, while training records `env.train.init_params.id`. All three shipped recipes use a distinct `...-Eval` id for evaluation, so the lookup always failed with `No compatible manifested run with a checkpoint was found`. Playback now resolves the selector against the training id, matching `train_rlinf.py`; an explicit `--task` still takes precedence. - A relative `--config_path` failed with `initialize_config_dir() requires an absolute config_dir as input`. The path is now resolved to an absolute directory before Hydra is initialized. - The launch test is now a train → play round trip with a relative config directory: training writes the run manifest, and playback resolves `latest` through 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`)** - Remove the paragraph that pointed at the task author's personal checkpoint repositories. - Move the `assemble_trocar` `hf download` from the prerequisites into a new "Assemble Trocar checkpoint" subsection after the Step 2 dependency pins, and run it with `uv run --no-sync`. With the lockfile's `huggingface-hub` 1.x and `typer` 0.27, `hf` downloads the files but exits non-zero with a `click.exceptions.Exit` traceback; any `huggingface-hub` < 1.0 works. The Step 2 floor is raised to `>=0.34`, the first release that ships the `hf` CLI. - Add `Environments/Grid` to the local-mirror subtree list; the default `GroundPlaneCfg` USD is loaded from there. - Mark flash-attn as optional for GR00T N1.7, which falls back to PyTorch SDPA attention with a warning when the package is missing (building it needs a CUDA 13 `nvcc` to match the lockfile's torch). - Add `--no-sync` to the `uv run isaaclab ...` commands in "Key Files" so they do not re-sync the environment. No linked issue. ## Type of change - Bug fix (non-breaking change which fixes an issue) - Documentation update ## Screenshots Not applicable (CLI and documentation changes). ## Validation - `uv run python -m pytest source/isaaclab_rl/test/test_entrypoints.py` passes (the one skrl parser test was deselected locally because `skrl` is not installed in my environment). - Mutation checks: reverting the playback fix fails the new test with the manifest `ValueError`; reverting the config-path fix fails it with the Hydra `initialize_config_dir()` error; making training record the eval id fails it with the manifest `ValueError`. - `pre-commit` on the changed files, the changelog gate (`tools/changelog/cli.py check`), and a Sphinx render of the guide pass. - No GPU training or evaluation runs were performed for this PR; the code changes are confined to CLI argument handling. ## Checklist Docker and GPU tests run on demand. Push the commits you want tested, then comment `run-ci` on the pull request, or `run-ci ovstage` to include kitless OVStage rendering tests for that run. Subsequent pushes and plain `run-ci` comments do not run OVStage tests unless you comment `run-ci ovstage` again. - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `uv run isaaclab --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have validated the changed behavior with focused coverage and applied the [test-audit criteria](https://github.com/isaac-sim/IsaacLab/blob/HEAD/skills/developer/test-audit/SKILL.md) to any test changes - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump package versions — CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
Summary
Adds GR00T post-training examples for two Unitree H2 + Sharpa tasks, with training and evaluation configurations:
IsaacContrib-Pick-And-Place-Apple-H2-SharpaIsaacContrib-Pack-AGX-Orin-H2-SharpaThe policy sends 58 absolute position targets in dataset order. The existing Newton joint impedance controller tracks the 14 arm joints with the H2 gains and gravity feed-forward on PhysX. The 44 hand joints use the standard joint-position action. Both tasks share the starting pose and wrist calibration. Camera terms read raw RGB through the core observation manager and apply the fitted task-specific response. Scene selectors resolve wrist and thumb indices for each task’s success term.
Both task packages register their environment in
__init__.py, define it in<task>_env_cfg.py, and keep their RLinf recipe inagents/. For--config_name, userlinf_gr00t_pick_and_place_apple_ppo_cfgorrlinf_gr00t_pack_agx_ppo_cfg.Validation
Trained-policy playback
The RLinf env worker supplies action chunks on the CPU. When holding reset poses, the wrapper now moves each chunk to the simulator’s device before using its reset mask. Both H2 evaluation commands previously failed on the second action with a CPU/CUDA mismatch. The regression test reproduces the failure on the previous revision and passes with the fix.
The following runs used headless Isaac Sim on PhysX, RLinf video recording, the pinned GR00T N1.7 stack and Cosmos-Reason2-2B. Each task used one rollout epoch with the evaluation environment seed set to 0.
Reference recordings
These recordings were supplied with the original implementation, not regenerated after the cleanup.
pick_and_place_apple_third_person.mp4
pack_agx_orin_third_person.mp4
Release backport
develop