Skip to content

[Backport release/3.0.0] Make core unit tests device-aware (#7918) - #7921

Merged
StafaH merged 1 commit into
isaac-sim:release/3.0.0from
StafaH:backport/release/3.0.0/pr-7918
Sep 20, 2026
Merged

StafaH merged 1 commit into
isaac-sim:release/3.0.0from
StafaH:backport/release/3.0.0/pr-7918

Conversation

@StafaH

@StafaH StafaH commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Description

Backports #7918 to release/3.0.0.

This makes the core Torch and ProxyArray unit tests use Isaac Lab device selection instead of unconditionally allocating on cuda:0. CUDA-specific ProxyArray cases select from the CUDA device scope and skip cleanly when CUDA is unavailable, allowing downstream CPU-only package validation while preserving upstream CPU and CUDA coverage.

The merged source commit 1089f000607dd24e61da4d3095a7e05880bac98b cherry-picked cleanly onto release commit be270ed88bbc0ea46201ce5cdd4cd0a502971cbc. The backport validator confirms an exact three-file patch with no release-specific changes.

Type of change

  • Bug fix (non-breaking test-portability change)

Release backport

This pull request targets release/3.0.0 directly; no further backport is requested.

Validation

  • Normal device selection: 93 passed.
  • CPU-only mode with CUDA_VISIBLE_DEVICES empty and ISAACLAB_TEST_DEVICES=100: 60 passed, 2 skipped.
  • .github/scripts/backport.py validate-candidate --exact_patch: passed.
  • Release-based changelog validation: passed.
  • uv run --no-sync isaaclab -f: all formatting, lint, metadata, and repository hooks passed. The changelog hook was run separately against release/3.0.0 because its default base is develop.
  • git diff --check: passed.

Screenshots

Not applicable.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks
  • Documentation changes are not required for this test-only backport
  • My changes generate no new warnings
  • I have preserved the tests that prove the behavior works
  • The original changelog skip fragment is included
  • My name already exists in CONTRIBUTORS.md

# Description

Makes the core Torch and ProxyArray unit tests use Isaac Lab's existing
`test_devices()` selection instead of unconditionally allocating on
`cuda:0`. CUDA-specific ProxyArray coverage now selects from the CUDA
device scope and skips cleanly when the active test runtime has no CUDA
device.

This lets downstream package maintainers run these unit tests against
CPU-only installed packages while preserving CPU and CUDA coverage in
upstream CI. It addresses the low-risk test-portability portion of
isaac-sim#5084.

## Type of change

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

## Release backport

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

## Screenshots

Not applicable.

## Validation

- `CUDA_VISIBLE_DEVICES='' ISAACLAB_TEST_DEVICES=100 uv run python -m
pytest source/isaaclab/test/deps/test_torch.py
source/isaaclab/test/utils/warp/test_proxy_array.py -q` (`60 passed, 2
skipped`)
- `uv run python -m pytest source/isaaclab/test/deps/test_torch.py
source/isaaclab/test/utils/warp/test_proxy_array.py -q` (`93 passed`)
- `uv run python tools/changelog/cli.py check develop
--include-worktree`
- `uv run isaaclab -f`

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the pre-commit checks with `uv run isaaclab -f`
- [x] Documentation changes are not required for this test-only change
- [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/isaaclab/changelog.d/`
- [x] My name already exists in `CONTRIBUTORS.md`

(cherry picked from commit 1089f00)
@StafaH
StafaH requested a review from a team September 20, 2026 07:37
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Sep 20, 2026
@greptile-apps

greptile-apps Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The backport is non-blocking and appears safe to merge, though the CUDA-only ProxyArray tests should use the shard-recognized parameter name to preserve intended multi-GPU coverage.

Findings

  1. P2 CUDA tests bypass sharding ▶

Summary

This backport makes core Torch and ProxyArray tests use Isaac Lab’s centralized device selection instead of hard-coded cuda:0.

  • Torch tests now run across the configured available devices.
  • General ProxyArray tests use the same device-aware fixture.
  • CUDA-only ProxyArray cases skip cleanly without CUDA, but their parameter name prevents execution on non-default-GPU shards.
  • An empty changelog skip fragment records that no release note is required.

Reviews (1) · Last reviewed commit: "[Tests] Make core unit tests device-awar..."

assert first is second

def test_cuda_array_interface(self):
@pytest.mark.parametrize("cuda_device", test_devices(DeviceScope.CUDA))

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.

P2 CUDA tests bypass sharding

The multi-GPU shard selector recognizes only a parameter named device, but this test and test_wp_launch_accepts_proxy_array use cuda_device. As a result, both tests are deselected on non-default-GPU shards even when test_devices(DeviceScope.CUDA) selects the shard's GPU, so the intended CUDA coverage does not run there. Use the conventional device parameter name for both tests.

@StafaH

StafaH commented Sep 20, 2026

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 20, 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

This test-only backport replaces hard-coded cuda:0 usage in the Torch and ProxyArray tests with the shared test_devices() selection mechanism while retaining CUDA-specific coverage through DeviceScope.CUDA.

  • Design and architecture: Device selection is consistently delegated to the existing Isaac Lab test utility. General cases run on configured devices, while the two CUDA-only ProxyArray cases remain explicitly scoped and can skip on CPU-only systems.
  • API: No production API, export, CLI, or documented user behavior changes. Added parameters are internal pytest parametrization inputs, and the CPU-only negative __cuda_array_interface__ test remains explicitly pinned to CPU.
  • Implementation: The changed allocation and launch paths consistently use the selected device, including both logical-or operands and all allocation, launch, and synchronization arguments in the Warp launch test. CPU-only runs intentionally omit the CUDA-specific assertions, so they do not represent full CUDA coverage.

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.

@StafaH
StafaH merged commit bca9dba into isaac-sim:release/3.0.0 Sep 20, 2026
54 checks passed
@StafaH
StafaH deleted the backport/release/3.0.0/pr-7918 branch September 20, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant