[RL] Fix lazy import in isaaclab_rl subpackage - #7517
Conversation
Greptile SummaryThis PR replaces eager and manually maintained
Confidence Score: 5/5The PR appears safe to merge, with the public export mappings preserved and package metadata ensuring the runtime-required stubs are installed. The new lazy exporter is supplied with complete sibling stubs, representative public imports remain resolvable, and the added subprocess tests verify that ordinary namespace and play-entrypoint imports avoid the unwanted framework initialization. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Import isaaclab_rl] --> B[lazy_export reads __init__.pyi]
B --> C[Public names registered lazily]
C --> D{Symbol requested}
D -->|run_play_cli| E[Load entrypoints dispatch]
D -->|run_train_multigpu_cli| F[Load Torch Elastic multigpu module]
A -. no eager load .-> F
Reviews (1): Last reviewed commit: "Fix lazy imports in isaaclab_rl" | Re-trigger Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
The PR replaces the root and entrypoints package initializers with the shared stub-driven lazy export mechanism, preserving their public symbol sets while deferring Torch Elastic and unrelated framework imports.
- Design and architecture: The revised import path consistently uses
isaaclab.utils.module.lazy_export()with adjacent stubs. The root namespace delegates symbols toentrypoints, while the entrypoints stub maps each symbol toapi,dispatch, ormultigpu, allowing the multi-GPU launcher to remain deferred. - API: The new stubs preserve the previous exports: twelve root symbols and thirteen entrypoints symbols, including
BackendNameonly underisaaclab_rl.entrypoints.__version__remains eagerly available and is represented in the root stub. No public API removal or rename is evident. - Implementation: The subprocess tests directly exercise clean-interpreter namespace imports and selected symbol imports, checking that Torch, Torch Elastic, and unrelated RL frameworks are not loaded eagerly. The changelog fragment matches the affected source package. Installed-wheel inclusion of the runtime-consumed
.pyifiles remains the main packaging surface to validate, but the supplied patch does not establish a concrete packaging failure.
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.
|
run-ci |
|
run-ci |
# Description Backports the following merged `develop` PRs to `release/3.0.0`: - #7220 — prune unused Docker volumes on package-test runners - #7169 — cache the resolved OVRTX Warp device - #6889 — move the OVPhysX collider cache out of the Python interpreter directory - #7345 — document the registered XR camera PiP tasks - #7050 — update and reorganize the LEAPP documentation - #7473 — register external RSL-RL tasks before agent discovery - #7467 — update the China storage profile to Isaac Sim 6.1 - #7385 — accept legal float scale values when seeding Fabric frame views from USD - #7517 — use lazy exports in `isaaclab_rl` The duplicate #7517 in the original request is included once. Seven source commits replayed cleanly. Two required release-specific reconciliation: - #7169 retains the release branch's mapped OVRTX write path, which was removed separately on `develop`, while resolving and caching one Warp device for render-product IDs, mappings, and CUDA streams. - #7050 preserves the #7494 export-backend clarification that is already present on the release branch while applying the broader LEAPP documentation overhaul. No new dependencies are added. ## Type of change - Bug fix (non-breaking change which fixes an issue) - Performance improvement - Documentation update - CI/infrastructure update ## Release backport - [ ] <!-- backport-active-release --> This PR already targets the active release branch; do not backport it again. ## Validation - `uv run --no-project --with pytest python -m pytest -q .github/actions/run-package-tests/test_cleanup_docker_storage.py` — 10 passed - Nine isolated `isaaclab_rl` namespace/lazy-import regression cases passed - Resolved-device OVRTX mapping behavior check passed with Warp 1.16.0 - `uv run --no-project python -m compileall -q` on all changed Python modules and tests - `uv run --no-project python tools/changelog/cli.py check` against the exact `upstream/release/3.0.0` base - `pre-commit==4.6.2 run --all-files` passed all available hooks - `git diff --check upstream/release/3.0.0..HEAD` The full project test environment and documentation build cannot resolve on this macOS/arm64 host because the release lockfile supports Linux and Windows only. The Git LFS hook was also unavailable because `git-lfs` is not installed; none of the changed paths are LFS-tracked. Linux CI remains authoritative for simulator, OVRTX, Fabric, and full documentation validation. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the available formatting and static checks - [x] I have included the corresponding documentation changes - [x] Each touched source package includes its original changelog fragment - [x] Every backported commit records its source commit with `cherry picked from commit` - [x] The original contributors are preserved as commit authors --------- Signed-off-by: Zeng Qingcheng <60593302+NeoZng@users.noreply.github.com> Co-authored-by: myurasov-nv <168484206+myurasov-nv@users.noreply.github.com> Co-authored-by: Peter Verswyvelen <pverswyvelen@nvidia.com> Co-authored-by: pv-nvidia <197907000+pv-nvidia@users.noreply.github.com> Co-authored-by: hujc <jichuanh@nvidia.com> Co-authored-by: hougantc-nvda <127865892+hougantc-nvda@users.noreply.github.com> Co-authored-by: Frank Lai NV <frlai@nvidia.com> Co-authored-by: peterd-NV <peterd@nvidia.com> Co-authored-by: Sheikh Dawood <7774242+sheikh-nv@users.noreply.github.com> Co-authored-by: Zeng Qingcheng <60593302+NeoZng@users.noreply.github.com> Co-authored-by: Antoine RICHARD <antoiner@nvidia.com> Co-authored-by: Mustafa H <34825877+StafaH@users.noreply.github.com>
Description
Make the isaaclab_rl root package and unified entrypoints use the standard stub-driven lazy export mechanism. This prevents single-GPU play imports from loading the multi-GPU Torch Elastic launcher during Torch initialization, which caused a circular-import failure on Windows with Torch 2.11.
The change also adds static export stubs for both public namespaces and subprocess regression coverage for every isaaclab_rl package initializer, ensuring namespace imports do not eagerly load Torch or unrelated RL frameworks.
Type of change
Release backport
Testing
Checklist