Skip to content

[Odin] Fix multi-agent play benchmark environment creation - #7360

Merged
kellyguo11 merged 4 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/fix-marl-play-benchmark
Sep 10, 2026
Merged

kellyguo11 merged 4 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/fix-marl-play-benchmark

Conversation

@AntoineRichard

@AntoineRichard AntoineRichard commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Use the shared Isaac Lab environment creation path in all benchmark play adapters so DirectMARLEnv tasks follow the same backend-specific conversion rules as training.

This also:

  • Adds the frontend argument required by the shared environment creator.
  • Preserves native SKRL multi-agent handling for IPPO and MAPPO while converting PPO.
  • Reports the rejected unwrapped environment type in RL wrapper validation errors.
  • Adds focused regression coverage and package changelog fragments.

No new dependencies are required.

Type of change

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

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Screenshots

Not applicable.

Validation

  • uv run --isolated --frozen --extra test python -m pytest source/isaaclab/test/benchmark/test_api.py source/isaaclab_rl/test/test_rsl_rl_wrapper_observations.py -q --disable-warnings (31 passed)
  • uv run --frozen isaaclab -f
  • One-step Isaac-Shadow-Handover-Direct RSL-RL play benchmark with Newton MJWarp completed successfully.
  • Isaac Sim PhysX smoke was not run because the optional installation requires interactive NVIDIA EULA acceptance.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the repository formatting and pre-commit checks with uv run isaaclab -f
  • No public documentation changes are required; the behavior changes are covered by changelog fragments
  • My changes generate no new warnings
  • I have added tests that prove the fix is effective
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package
  • My name already exists in CONTRIBUTORS.md

@AntoineRichard
AntoineRichard requested a review from a team August 26, 2026 11:57
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Aug 26, 2026

@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

Reviewed the migration of all four benchmark play adapters from direct gym.make calls to the shared _common.create_isaaclab_env path, including MARL conversion selection, frontend argument parsing, wrapper diagnostics, regression coverage, and changelog integration. No actionable issue is supported by the patch.

  • Design and architecture: Environment creation is consistently centralized across RSL-RL, RL-Games, SB3, and SKRL. RSL-RL, RL-Games, and SB3 request single-agent conversion, while SKRL limits conversion to PPO and preserves native multi-agent handling for IPPO and MAPPO.
  • API: Each play adapter now exposes the existing shared frontend argument, defaulting to torch as covered by the parameterized parser test. The wrapper changes affect only validation diagnostics by reporting the same unwrapped object used in the type check. Both affected packages include user-visible changelog fragments.
  • Implementation: Traced environment creation through each changed adapter and the subsequent wrapper consumers. Cleanup registration and environment-creation timing remain in the same order, removed Gymnasium imports are no longer needed, and accessing env.unwrapped in diagnostic messages is consistent with the immediately preceding validation checks. Focused coverage verifies frontend parsing, RSL-RL MARL conversion, and the corrected unwrapped-type error message; the other adapters rely on the same shared creation path visible in their changed calls.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR routes all benchmark play adapters through the shared Isaac Lab environment creator, aligning frontend selection and multi-agent conversion with training behavior. It also improves invalid-environment diagnostics and adds focused regression coverage.

  • Adds the shared frontend CLI option to RL-Games, RSL-RL, SB3, and SKRL benchmark play adapters.
  • Converts DirectMARLEnv tasks for single-agent backends while preserving native SKRL IPPO and MAPPO handling.
  • Reports the rejected unwrapped environment type from RL adapter validation errors.
  • Adds regression tests and changelog fragments for both affected packages.

Confidence Score: 5/5

The PR appears safe to merge because the benchmark adapters now follow the established environment-creation and conversion contracts without introducing an actionable regression.

The shared helper supplies the intended frontend-specific construction, guards multi-agent conversion by environment type, and is invoked before each library adapter; the diagnostic-only wrapper changes consistently report the object that actually failed validation.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/benchmark/entrypoints/backends/rl_games/benchmark_play_rl_games.py Uses the shared frontend-aware environment creation path and requests single-agent conversion before applying the RL-Games adapter.
source/isaaclab/isaaclab/benchmark/entrypoints/backends/rsl_rl/benchmark_play_rsl_rl.py Aligns benchmark play environment creation with training and converts direct multi-agent tasks before RSL-RL wrapping.
source/isaaclab/isaaclab/benchmark/entrypoints/backends/sb3/benchmark_play_sb3.py Routes environment construction through the shared helper with the single-agent conversion required by SB3.
source/isaaclab/isaaclab/benchmark/entrypoints/backends/skrl/benchmark_play_skrl.py Converts PPO environments while retaining native multi-agent structure for SKRL IPPO and MAPPO.
source/isaaclab/test/benchmark/test_api.py Verifies frontend argument propagation and that RSL-RL requests multi-agent conversion before wrapper construction.
source/isaaclab_rl/isaaclab_rl/rsl_rl/vecenv_wrapper.py Improves validation diagnostics by reporting the same unwrapped object whose type failed the check.
source/isaaclab_rl/isaaclab_rl/rl_games/rl_games.py Reports the rejected unwrapped environment type without changing adapter validation behavior.
source/isaaclab_rl/isaaclab_rl/sb3.py Reports the rejected unwrapped environment type without changing adapter validation behavior.
source/isaaclab_rl/isaaclab_rl/skrl.py Reports the rejected unwrapped environment type while preserving SKRL environment acceptance rules.

Sequence Diagram

sequenceDiagram
    participant CLI as Benchmark CLI
    participant Common as Shared environment creator
    participant Env as Isaac Lab environment
    participant Convert as MARL conversion
    participant Adapter as RL backend adapter
    CLI->>Common: task, config, frontend, conversion flag
    Common->>Env: Create with Torch or Warp frontend
    alt Backend requires single-agent input
        Common->>Convert: Convert DirectMARLEnv
        Convert-->>Common: Single-agent environment
    else SKRL IPPO or MAPPO
        Common-->>Common: Preserve native multi-agent environment
    end
    Common-->>CLI: Prepared environment
    CLI->>Adapter: Apply backend wrapper
    Adapter-->>CLI: Play-ready environment
Loading

Reviews (1): Last reviewed commit: "Fix multi-agent play benchmark environme..." | Re-trigger Greptile

@AntoineRichard AntoineRichard changed the title Fix multi-agent play benchmark environment creation [Odin] Fix multi-agent play benchmark environment creation Aug 26, 2026
@maxkra15

maxkra15 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

test_api.py exercises environment creation only for RSL-RL. The parser test covers all four backends, but only checks that frontend defaults to torch

could add

  • RL-Games and SB3 request single-agent conversion
  • SKRL PPO requests conversion
  • SKRL IPPO/MAPPO preserve native multi-agent operation- important conditional branch

could parameterize test over (backend, algorithm, expected_conversion)

kellyguo11 added a commit that referenced this pull request Sep 7, 2026
# Description

The environment browser advertises SKRL support for the native
multi-agent tasks but previously omitted the algorithm from its
generated commands. SKRL consequently used its PPO default, converted
the environment to single-agent form, and selected the wrong algorithm
for pretrained-checkpoint lookup.

This change marks MAPPO as the generated-command default whenever a task
registers an SKRL MAPPO configuration, then appends `--algorithm MAPPO`
in the environment browser. Explicit runtime algorithm selection remains
unchanged, so other algorithm checkpoints are still supported.

This currently updates the generated commands for:

- `Isaac-Pendulum-MARL-Direct`
- `Isaac-Shadow-Handover-Direct`

Tracks NVBug 6675391. No matching existing PR was found; #7360 addresses
the separate benchmark play environment-creation path.

No new dependencies are required.

## Type of change

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

## Release backport

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

## Screenshots

Not applicable. A headless browser smoke test generated:

`uv run --extra skrl isaaclab train --rl_library skrl --task
Isaac-Shadow-Handover-Direct --algorithm MAPPO physics=newton_mjwarp`

## Validation

- `uv run --extra test python -m pytest --confcutdir=tools/test
tools/test/test_environ_docs.py -q` (28 passed)
- `uv run --isolated --extra dev --extra ov -- make -C docs
current-docs` (passed)
- `uv run isaaclab -f` (passed)
- Headless Chrome environment-browser command generation smoke test
(passed)

## 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 repository formatting and pre-commit checks with
`uv run isaaclab -f`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove the fix is effective
- [x] No changelog fragment is required because no source package
changed
- [x] My name already exists in `CONTRIBUTORS.md`
isaaclab-bot Bot pushed a commit that referenced this pull request Sep 7, 2026
# Description

The environment browser advertises SKRL support for the native
multi-agent tasks but previously omitted the algorithm from its
generated commands. SKRL consequently used its PPO default, converted
the environment to single-agent form, and selected the wrong algorithm
for pretrained-checkpoint lookup.

This change marks MAPPO as the generated-command default whenever a task
registers an SKRL MAPPO configuration, then appends `--algorithm MAPPO`
in the environment browser. Explicit runtime algorithm selection remains
unchanged, so other algorithm checkpoints are still supported.

This currently updates the generated commands for:

- `Isaac-Pendulum-MARL-Direct`
- `Isaac-Shadow-Handover-Direct`

Tracks NVBug 6675391. No matching existing PR was found; #7360 addresses
the separate benchmark play environment-creation path.

No new dependencies are required.

## Type of change

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

## Release backport

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

## Screenshots

Not applicable. A headless browser smoke test generated:

`uv run --extra skrl isaaclab train --rl_library skrl --task
Isaac-Shadow-Handover-Direct --algorithm MAPPO physics=newton_mjwarp`

## Validation

- `uv run --extra test python -m pytest --confcutdir=tools/test
tools/test/test_environ_docs.py -q` (28 passed)
- `uv run --isolated --extra dev --extra ov -- make -C docs
current-docs` (passed)
- `uv run isaaclab -f` (passed)
- Headless Chrome environment-browser command generation smoke test
(passed)

## 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 repository formatting and pre-commit checks with
`uv run isaaclab -f`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove the fix is effective
- [x] No changelog fragment is required because no source package
changed
- [x] My name already exists in `CONTRIBUTORS.md`

(cherry picked from commit 32c857a)
@AntoineRichard

Copy link
Copy Markdown
Collaborator 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 Sep 8, 2026
@AntoineRichard
AntoineRichard force-pushed the antoiner/fix-marl-play-benchmark branch from 62a2bd6 to 3604f8a Compare September 10, 2026 09:41
@AntoineRichard

Copy link
Copy Markdown
Collaborator 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 Sep 10, 2026
@AntoineRichard

Copy link
Copy Markdown
Collaborator 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 Sep 10, 2026
@kellyguo11
kellyguo11 merged commit 632f197 into isaac-sim:develop Sep 10, 2026
82 of 84 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.

5 participants