Repository navigation
Conversation
[Medium impact] Adds W&B checkpoint download to training and playback entrypoints. Fix the source-project fallback before merging so changing the destination project does not break continued training. Findings
SummaryAdds W&B source-run options to RSL-RL training and playback.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Parse W&B source options"] --> B["Apply agent and logging overrides"]
B --> C{"Explicit source project?"}
C -->|Yes| D["Use --wandb_project"]
C -->|No| E["Use agent_cfg.wandb_project"]
E --> F["May now contain destination project"]
D --> G["Find matching W&B checkpoint"]
F --> G
G --> H["Download checkpoint"]
H --> I["Load through existing RSL-RL runner"]
Reviews (1) · Last reviewed commit: "Merge current develop into W&B checkpoin..." · Reviewed by Greptile |
| if args_cli.wandb_run is not None: | ||
| return download_wandb_checkpoint( | ||
| log_root_path, | ||
| args_cli.wandb_project if args_cli.wandb_project is not None else agent_cfg.wandb_project, |
There was a problem hiding this comment.
Logging project changes checkpoint source
Using --wandb_run --logger wandb --log_project_name new-project without --wandb_project makes the loader search new-project for the source run. update_rsl_rl_cfg overwrites agent_cfg.wandb_project before this fallback reads it. Continued training therefore fails when the source run exists only in the original project.
Preserve the configured source project before applying logging overrides. The same fallback in play_rsl_rl.py needs the same fix.
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Design and architecture (1), Scope and over-engineering (1), Style consistency (2). Other reviewed categories look good.
- PR description: The title, CLI examples, behavior, and focused validation match the diff; remove the unrelated MPM consumer table and stale prerequisite and branch-refresh notes.
- Design and architecture: W&B checkpoint resolution duplicates the existing utils/wandb.py owner, creating parallel selection and download behavior; extend get_model_checkpoint and route both backends through it.
- Scope and over-engineering: Minimal implementation: extend utils/wandb.py and cli_args_rsl_rl.py; delete the duplicate common.py helper, collapse the train/play parser blocks, and keep only backend calls into shared owners; no source modules were added. Replace with one smaller PR: update those four owner/backend files, the changelog, and focused parser and W&B utility tests.
- API: API changes look good.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Implementation looks good.
- Style consistency: The downloader wraps a missing optional dependency instead of preserving ModuleNotFoundError; import wandb directly and retain Python’s original failure.
- Test quality: Test quality looks good.
Minor fixes needed. Posted 4 inline findings.
Automated review; human maintainers own approval decisions.
| @@ -67,6 +68,27 @@ def _parse_args(argv: list[str]) -> argparse.Namespace: | |||
| parser.add_argument( | |||
| "--external_callback", default=None, help="Fully qualified path to an externally defined callback." | |||
| ) | |||
| parser.add_argument( | |||
There was a problem hiding this comment.
🟡 Warning · Scope Complexity — Duplicated W&B options in both backends
These three options and the --checkpoint conflict check are copied verbatim into play_rsl_rl.py, letting the two CLI contracts drift. Define and validate them once in cli_args_rsl_rl.add_rsl_rl_args, which both backends already call.
| @@ -710,6 +710,56 @@ def resolve_checkpoint_selector( | |||
| ) | |||
|
|
|||
|
|
|||
| def download_wandb_checkpoint( | |||
There was a problem hiding this comment.
🟡 Warning · Design Architecture — Duplicates existing W&B checkpoint helper
isaaclab_rl/utils/wandb.py already owns run-file listing, highest-iteration selection, and download via get_model_checkpoint, and both backends import from it. Extend that module instead of adding a second W&B owner here.
| """Download a checkpoint uploaded by a Weights & Biases run and return its local path. | ||
|
|
||
| The checkpoint is picked among the run's uploaded files by matching | ||
| :attr:`checkpoint_pattern` against the file name. When several files match, the naturally |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — :attr: role used for parameters
checkpoint_pattern is a function parameter, so :attr: produces an unresolvable cross-reference. The adjacent resolve_checkpoint_selector docstring names parameters in plain text; use checkpoint_pattern here and in Raises.
| try: | ||
| import wandb | ||
| except ImportError as exc: # wandb is an optional logging backend, not a base dependency | ||
| raise ImportError("Resolving a checkpoint from W&B requires the 'wandb' package to be installed.") from exc |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Wrapped optional dependency import error
The contribution guide requires missing optional dependencies to raise Python's original ModuleNotFoundError rather than being wrapped to add an install hint. Import wandb directly and drop the Raises: ImportError docstring entry.
|
thanks for the contribution, can you think of a place in the docs where we can add this and also add it to agent skills, this is very useful for them |
002ac87 to
78757f5
Compare
maxkra15
left a comment
There was a problem hiding this comment.
Matching uses basename, sorting uses the full path. checkpoints/model_100.pt + model_20.pt selects iteration 20. Sort basename or captured iteration. Add this regression. Rebase and run CI.
2c684b1 to
ee72a7e
Compare
|
run-ci |
|
@maxkra15 lmk if it's good to merge |
maxkra15
left a comment
There was a problem hiding this comment.
Checkpoint basenames now sort correctly across nested paths. The13 selector tests and mixed-directory repro pass. Current-head CI is green.
StafaH
left a comment
There was a problem hiding this comment.
We currently use --checkpoint <WANDB_PATH> for loading wandb checkpoints. Is this not working? Let's fix the usage and documentation of that instead of adding the additional CLI arguments?
|
@StafaH |
|
Thanks @jnskkmhr for putting this together. Since |
# Description RSL-RL `train` and `play` already load checkpoints from W&B runs through `--checkpoint` (#7925), but this was only mentioned in the `--help` text. This adds it to the quickstart checkpoint table and to the RL page (checkpoint selectors and resuming training). Supersedes #8406. ## Type of change - Documentation update ## Checklist - [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 - [ ] 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 - [ ] 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
Load RSL-RL checkpoints directly from W&B runs for local inference or continued training. This is useful when a policy was trained on a cluster or remote server: download its saved checkpoint from W&B and run it on your local computer without manually copying checkpoint files between machines.
Example
Run these commands from an Isaac Lab checkout with the RSL-RL dependencies installed. Authenticate on each machine with
uv run --with wandb wandb login. ReplaceYOUR_ENTITYandYOUR_RUN_IDwith the entity and run ID shown in the source run's W&B URL.Train on a cluster or remote server
uv run --with wandb isaaclab train \ --rl_library rsl_rl \ --task Isaac-Velocity-Flat-G1 \ --num_envs 4096 \ --max_iterations 10000 \ --logger wandb \ --log_project_name g1_remote_trainingOnce the run has uploaded a checkpoint, use its run ID for local playback or continued training. Use the same task and compatible policy configuration when loading the checkpoint.
Download and play on your local computer
uv run --with wandb isaaclab play \ --rl_library rsl_rl \ --task Isaac-Velocity-Flat-G1 \ --num_envs 1 \ --viz newton_rtx \ --wandb_entity YOUR_ENTITY \ --wandb_project g1_remote_training \ --wandb_run YOUR_RUN_IDContinue training from the W&B checkpoint
uv run --with wandb isaaclab train \ --rl_library rsl_rl \ --task Isaac-Velocity-Flat-G1 \ --num_envs 4096 \ --wandb_entity YOUR_ENTITY \ --wandb_project g1_remote_training \ --wandb_run YOUR_RUN_ID \ --logger wandb \ --log_project_name g1_continued_training--wandb_projectselects the source checkpoint project;--log_project_nameselects the destination training project. The loader selects the highest-iteration checkpoint matchingagent.load_checkpoint. If omitted, the source project defaults to the agent configuration'swandb_project, and the source entity usesWANDB_ENTITY/WANDB_USERNAME, then the authenticated W&B login.--wandb_runcannot be combined with--checkpoint.Depends on / setup
IsaacLabjnskkmhr/PR_wandb_integ→mainmain; no prerequisite PRs.wandbChanges
utils/wandb.py:get_model_checkpointwith checkpoint-pattern selection; use the same downloader for run IDs and existing URL/URI references.ModuleNotFoundError.Test plan
At
ee72a7e01, 99/99 passed:uv run --extra dev --extra skrl python -m pytest -q \ source/isaaclab_rl/test/test_wandb.py \ source/isaaclab_rl/test/test_entrypoints.py \ source/isaaclab_rl/test/test_entrypoints_common.pyThe nested-path regression fails before the sorting fix:
z_archive/model_3.ptwins overcheckpoints/model_100.pt. After the fix, the basename determines the highest iteration while the original remote path is retained for downloading.Coverage also checks source/destination-project separation, custom patterns, URL/URI compatibility, entity defaults, missing checkpoints, and the original missing-dependency error. Remote W&B calls are replaced at the client boundary; no live checkpoint download or training run was performed.
Full repository formatting/lint and changelog checks passed against
upstream/main. Tests emitted 35 existing PyTorch deprecation warnings.Type of change
Release backport
mainChecklist