Repository navigation
[Backport release/3.0.0] Make core unit tests device-aware (#7918) - #7921
Conversation
# 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)
|
| assert first is second | ||
|
|
||
| def test_cuda_array_interface(self): | ||
| @pytest.mark.parametrize("cuda_device", test_devices(DeviceScope.CUDA)) |
There was a problem hiding this comment.
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.
|
run-ci |
There was a problem hiding this comment.
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.
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
1089f000607dd24e61da4d3095a7e05880bac98bcherry-picked cleanly onto release commitbe270ed88bbc0ea46201ce5cdd4cd0a502971cbc. The backport validator confirms an exact three-file patch with no release-specific changes.Type of change
Release backport
This pull request targets
release/3.0.0directly; no further backport is requested.Validation
CUDA_VISIBLE_DEVICESempty andISAACLAB_TEST_DEVICES=100: 60 passed, 2 skipped..github/scripts/backport.py validate-candidate --exact_patch: passed.uv run --no-sync isaaclab -f: all formatting, lint, metadata, and repository hooks passed. The changelog hook was run separately againstrelease/3.0.0because its default base isdevelop.git diff --check: passed.Screenshots
Not applicable.
Checklist
CONTRIBUTORS.md