Skip to content

Add wandb play and resume option - #3426

Closed
renezurbruegg wants to merge 6 commits into
isaac-sim:mainfrom
renezurbruegg:feature/resume_wandb
Closed

renezurbruegg wants to merge 6 commits into
isaac-sim:mainfrom
renezurbruegg:feature/resume_wandb

Conversation

@renezurbruegg

Copy link
Copy Markdown
Collaborator

Description

Porting over my old orbit PR for wandb loading and resuming of checkpoints. This allows the user to directly play a specified run from wandb.

Usage:
To e.g. resume (or play) the training from a run located at https://wandb.ai/<user_name>/<project_name>/runs/<run_id>

 python scripts/reinforcement_learning/rsl_rl/play.py --task Isaac-Velocity-Flat-Cassie-Play-v0 --num_envs 4 --headless --logger wandb \
 --wandb_run_id <run_id> --wandb_username <user_name> --log_project_name <project_name>

This will immediately download the newest checkpoint (or the one with iteration --wandb_checkpoint_iteration XX) and use it for play or resuming.

If you are using an extension template, make sure to carry over the changes to your cli_args.py

Checklist

  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@renezurbruegg renezurbruegg changed the title Feature/resume wandb Add wandb play and resume option Sep 10, 2025
"--log_project_name", type=str, default=None, help="Name of the logging project when using wandb or neptune."
)

arg_group.add_argument(

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.

Could we make a separate group for wandb instead of adding it to rsl-rl group?

# SPDX-License-Identifier: BSD-3-Clause


import contextlib

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.

This should be moved to isaaclab_rl directory. Core has nothing to do with logging :)

``{time-stamp}_{run_name}``.
"""

run_id: str | None = 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.

Hmm why does this need to be part of rl config? It isn't used by rsl-rl wrapper.

help="Select which wandb checkpoint iteration to load. If not provided, the latest checkpoint will be used.",
)
arg_group.add_argument(
"--wandb_username",

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.

Should this be wandb entity? Or that's the same concept?

Comment on lines +29 to +32
Example:
model_path = get_model_checkpoint(run_id="my_run_id", project="my_project", checkpoint=100, wandb_username="my_username")
This will download the model checkpoint from https://wandb.ai/my_username/my_project/runs/my_run_id and save it
to models_tmp/my_project/my_run_id/model_100.pt

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.

Would put this in python code-block



def get_model_checkpoint(
run_id: str, project="isaaclab", checkpoint: int = -1, wandb_username=None, tmp_folder_dir: str = "models_tmp"

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.

Suggested change
run_id: str, project="isaaclab", checkpoint: int = -1, wandb_username=None, tmp_folder_dir: str = "models_tmp"
run_id: str, project: str = "isaaclab", checkpoint: int = -1, wandb_username=None, tmp_folder_dir: str = "models_tmp"

models = []
# List all available files in the run
for file in wdb_run.files():
if "model" in file.name and file.name.endswith(".pt"):

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.

This is very specific to rsl-rl naming of checkpoints. If plan is to only keep support for rsl-rl, then I suggest moving this to rsl-rl sub-package in isaaclab_rl.

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.

Would suggest putting this print after the model is found so you also get to know which model iteration you downloaded.

if wandb_username is None:
wandb_username = os.environ.get("WANDB_USERNAME")

print("Downloading model from wandb...", f"{wandb_username}/{project}/{run_id}")

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.

Suggested change
print("Downloading model from wandb...", f"{wandb_username}/{project}/{run_id}")
print(f"Downloading model from wandb: {wandb_username}/{project}/{run_id}")

arg_group.add_argument(
"--wandb_username",
type=str,
default=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.

Would this make sense?

Suggested change
default=None,
default=os.environ["WANDB_USERNAME"],

@Mayankm96 Mayankm96 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.

Thanks for this feature. Added a few comments.

Also is this using the latest wandb version? Or this works with the default wandb version in IsaacLab (which is 0.12). I think the minimum version I needed was 0.19.

@github-actions github-actions Bot added documentation Improvements or additions to documentation enhancement New feature or request isaac-lab Related to Isaac Lab team labels Sep 11, 2025
@Mayankm96 Mayankm96 removed the documentation Improvements or additions to documentation label Sep 11, 2025
@ooctipus

Copy link
Copy Markdown
Collaborator

This seems a nice feature!! Thanks for the PR, I agree with Mayank:

Unless we can make it general to all rl-library, it makes more sense to put in rsl-rl sub package in isaaclab_rl/rsl_rl, or directly pr to rsl_rl if eth folks like it.
Different rl-library also expects different keys for the same wandb utility.

@Mayankm96 Mayankm96 moved this to In review in Isaac Lab Oct 10, 2025

@Mayankm96 Mayankm96 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.

This is a nice feature, but the checkpoint retrieval is something specific to RSL-RL. Would not put utils for that in the core.

@Mayankm96
Mayankm96 force-pushed the main branch 2 times, most recently from 2ef7fc8 to f3061a4 Compare January 28, 2026 16:16
@kellyguo11

Copy link
Copy Markdown
Contributor

Hi @renezurbruegg , would you be able to take a look at the review comments?

@AntoineRichard

AntoineRichard commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Hi @renezurbruegg — thank you so much for opening this PR, and for taking the time to contribute to Isaac Lab! 🙏

We're currently doing a big spring-clean of our pull request backlog, which had grown past 400 open PRs. Being honest: at that volume we stopped being able to give every contribution the attention it deserved, and this one is a case where we dropped the ball on getting back to you. That's on us, not on you.

Why this PR is being closed: Here is exactly what we found on this PR when we reviewed the backlog:

Opened 2025-09-10 (about 12 months ago)
Last commit on the branch 2025-09-11
Last activity from the author about 12 months ago
Target branch main — note that active development happens on develop; main only receives releases
Review status Changes were requested (Mayankm96), but the follow-up never landed
Merge status Behind the base branch, needs a rebase
Size 6 commit(s), 3 file(s) changed, +113 / -0

It was picked up by the sweep because it targets main instead of develop, and it has been open for about 12 months. It was then put in the "close" bucket because the author has been silent for about 12 months — which is the signal we used to tell apart pull requests that are still being worked on from ones that have genuinely been set aside.

We deliberately did not close pull requests that were approved and ready to land, or that were small and clearly still fixing a live bug — there were 27 of those, and we are merging them rather than closing them.

To be completely clear — this is not a judgement on the quality or the value of your work. It's purely about getting the queue down to a size where we can actually review things properly and give contributors real, timely feedback.

One thing worth knowing first: Isaac Lab 3.0 has since shipped. develop is now at
3.0.0 while main is still at 2.3.2, and 3.0 restructured a fair amount — quaternion
conventions, actuator collections, data access, and the Isaac Sim extension imports all
changed. The migration guide
is the place to start if you rebase.

It is also the honest reason a lot of these older pull requests stopped applying: the code
they touched moved or was rewritten underneath them.

If this change is still relevant, please reopen this PR or open a fresh one against develop. With the backlog down to a reviewable size, it should get a response a lot sooner than this one did.

Thanks again for contributing to Isaac Lab, and sorry for the long silence! 💚


🤖 This comment was drafted with AI assistance as part of a maintainer-led sweep of the Isaac Lab pull request backlog. A maintainer is behind this cleanup — but if this closure looks wrong, it may well be, so please push back and we'll take another look.

@github-project-automation github-project-automation Bot moved this from In review to Done in Isaac Lab Aug 25, 2026
StafaH added a commit that referenced this pull request Sep 21, 2026
#7925)

# Description

Ports the intent of #3426 (closed) forward to the current Isaac Lab 3.0
entrypoint architecture, with a cleaner UX: passing a wandb run URL or
shorthand as `--checkpoint` now automatically downloads and loads that
run's checkpoint — no extra flags required.

```bash
# Play (or resume training from) a specific run, latest checkpoint:
isaaclab play --rl_library rsl_rl --task <task> \
    --checkpoint https://wandb.ai/<entity>/<project>/runs/<run_id>

# Or the shorthand, optionally pinning a specific iteration:
isaaclab play --rl_library rsl_rl --task <task> \
    --checkpoint wandb:<entity>/<project>/<run_id>?checkpoint=100
```

Starting a **new** `--logger wandb` training run also prints the exact
shorthand to copy into a later `--checkpoint`:

```
[INFO] Logging to wandb run: wandb:my_entity/my_project/a1b2c3d4
[INFO] Resume or play it later with: --checkpoint wandb:my_entity/my_project/a1b2c3d4
```

This works by pinning `WANDB_RUN_ID` before RSL-RL's writer lazily calls
`wandb.init()`, so the run id is known and printable immediately instead
of only after training completes.

No new CLI flags were added — entity resolution reuses the existing
`WANDB_ENTITY`/`WANDB_USERNAME` environment variables that `wandb` and
RSL-RL's own writer already honor.

## Type of change

- New feature (non-breaking change which adds functionality)

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

## 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
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump `extension.toml` — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>
isaaclab-bot Bot pushed a commit that referenced this pull request Sep 21, 2026
#7925)

# Description

Ports the intent of #3426 (closed) forward to the current Isaac Lab 3.0
entrypoint architecture, with a cleaner UX: passing a wandb run URL or
shorthand as `--checkpoint` now automatically downloads and loads that
run's checkpoint — no extra flags required.

```bash
# Play (or resume training from) a specific run, latest checkpoint:
isaaclab play --rl_library rsl_rl --task <task> \
    --checkpoint https://wandb.ai/<entity>/<project>/runs/<run_id>

# Or the shorthand, optionally pinning a specific iteration:
isaaclab play --rl_library rsl_rl --task <task> \
    --checkpoint wandb:<entity>/<project>/<run_id>?checkpoint=100
```

Starting a **new** `--logger wandb` training run also prints the exact
shorthand to copy into a later `--checkpoint`:

```
[INFO] Logging to wandb run: wandb:my_entity/my_project/a1b2c3d4
[INFO] Resume or play it later with: --checkpoint wandb:my_entity/my_project/a1b2c3d4
```

This works by pinning `WANDB_RUN_ID` before RSL-RL's writer lazily calls
`wandb.init()`, so the run id is known and printable immediately instead
of only after training completes.

No new CLI flags were added — entity resolution reuses the existing
`WANDB_ENTITY`/`WANDB_USERNAME` environment variables that `wandb` and
RSL-RL's own writer already honor.

## Type of change

- New feature (non-breaking change which adds functionality)

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

## 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
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump `extension.toml` — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>

(cherry picked from commit 847354d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request isaac-lab Related to Isaac Lab team

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants