Repository navigation
Reduce direct locomotion step overhead - #6512
AntoineRichard merged 7 commits into
Conversation
Stage persistent effort targets once per environment step and remove redundant reset work, state copies, scalar transfers, and split joint-state writes.
Greptile SummaryThis PR reduces overhead in the direct locomotion environment. The main changes are:
Confidence Score: 4/5The reset and logging changes need fixes before merging.
source/isaaclab_tasks/isaaclab_tasks/core/locomotion/locomotion_direct_env.py Important Files Changed
Reviews (1): Last reviewed commit: "Reduce direct locomotion step overhead" | Re-trigger Greptile |
| # Log survival success rate (survived = timed out without falling) | ||
| survived = self.reset_time_outs[env_ids].float() | ||
| self.extras.setdefault("log", {})["Metrics/success_rate"] = survived.mean().item() | ||
| self.extras.setdefault("log", {})["Metrics/success_rate"] = survived.mean() |
There was a problem hiding this comment.
When this env runs through wrappers that copy extras["log"] into episode info, Metrics/success_rate is now a device tensor instead of the previous Python float. SB3-style logging and serialization paths can receive that tensor directly, which can break or drop the success-rate metric.
| self.extras.setdefault("log", {})["Metrics/success_rate"] = survived.mean() | |
| self.extras.setdefault("log", {})["Metrics/success_rate"] = survived.mean().item() |
There was a problem hiding this comment.
Good catch. Fixed in 08ac265 by restoring .item(), which preserves the historical Python-float contract for extras["log"] and SB3-style episode info.
Keep the success-rate episode metric as a Python float so logging integrations retain the existing scalar contract while the reset path remains otherwise unchanged.
Describe the compatibility path in backend-neutral terms now that OVPhysX can provide the optional fused joint-state writer independently.
# Description Adds Articulation.write_joint_state_to_sim_index to the OVPhysX backend. The existing reset path updates the same state through separate position and velocity writers. That requires four Warp cache-update kernels: one for position, then three for velocity, the finite-difference baseline, and acceleration zeroing. The new writer performs those cache updates in one kernel while preserving the two OVPhysX tensor-binding writes required to update DOF position and velocity. The method preserves the existing semantics: - resolves partial environment and joint indices through the standard OVPhysX helpers - updates joint position and velocity caches - synchronizes the previous-velocity baseline and zeros selected joint accelerations - stamps the joint-acceleration cache - invalidates pose and velocity dependents once unless skip_forward is requested - leaves unselected environments and joints unchanged This is a focused OVPhysX backend PR. It has no dependency on #6512, although the compatibility path there can use this method automatically when both changes are present. ## Type of change - New feature (non-breaking change which adds functionality) ## Validation - Focused CPU OVPhysX tests: 3 passed, 207 deselected - The modified integration test fails on origin/develop with the expected missing-method AttributeError - Changelog gate: ./isaaclab.sh -p tools/changelog/cli.py check develop - Full pre-commit: ./isaaclab.sh -f - Full documentation build was attempted but remained silent for several minutes and was terminated; the public API docstring and RST cross-reference checks pass ## Screenshots Not applicable. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks with ./isaaclab.sh -f - [x] I have documented the public API and added a changelog fragment - [x] My changes generate no new warnings - [x] I have added tests that prove the feature works - [x] I have added a changelog fragment under source/isaaclab_ovphysx/changelog.d/ - [x] My name already exists in CONTRIBUTORS.md
Call the common articulation joint-state writer directly now that the OvPhysX implementation has landed in develop. This keeps the reset path backend-neutral and removes a compatibility branch that is no longer reachable.
# Description Adds Articulation.write_joint_state_to_sim_index to the OVPhysX backend. The existing reset path updates the same state through separate position and velocity writers. That requires four Warp cache-update kernels: one for position, then three for velocity, the finite-difference baseline, and acceleration zeroing. The new writer performs those cache updates in one kernel while preserving the two OVPhysX tensor-binding writes required to update DOF position and velocity. The method preserves the existing semantics: - resolves partial environment and joint indices through the standard OVPhysX helpers - updates joint position and velocity caches - synchronizes the previous-velocity baseline and zeros selected joint accelerations - stamps the joint-acceleration cache - invalidates pose and velocity dependents once unless skip_forward is requested - leaves unselected environments and joints unchanged This is a focused OVPhysX backend PR. It has no dependency on isaac-sim#6512, although the compatibility path there can use this method automatically when both changes are present. ## Type of change - New feature (non-breaking change which adds functionality) ## Validation - Focused CPU OVPhysX tests: 3 passed, 207 deselected - The modified integration test fails on origin/develop with the expected missing-method AttributeError - Changelog gate: ./isaaclab.sh -p tools/changelog/cli.py check develop - Full pre-commit: ./isaaclab.sh -f - Full documentation build was attempted but remained silent for several minutes and was terminated; the public API docstring and RST cross-reference checks pass ## Screenshots Not applicable. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks with ./isaaclab.sh -f - [x] I have documented the public API and added a changelog fragment - [x] My changes generate no new warnings - [x] I have added tests that prove the feature works - [x] I have added a changelog fragment under source/isaaclab_ovphysx/changelog.d/ - [x] My name already exists in CONTRIBUTORS.md
|
run-ci |
|
Backported to |
# Description Reduces common Direct Locomotion task overhead used by Ant and Humanoid without introducing the experimental Ant post-step path. The change: - stages effort targets once per environment step because articulation command buffers persist across decimation substeps; - uses the cached all-joint target path instead of repeatedly uploading joint indices; - keeps scalar zero assignments on-device; - removes a duplicate articulation reset already performed by the scene reset; - removes redundant clones after advanced indexing; and - uses the common fused joint-state writer provided by PhysX, Newton, and Isaac Lab OV. The isolated device scalar change improved the Ant host-return measurement from 3.433 ms to 3.231 ms. The remaining changes remove repeated launches, index transfers, copies, and reset writes; the larger fused post-step and device-mask work is deliberately excluded. This is one focused slice of superseded Draft PR #6509 and is independent of benchmark PR #6474. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Screenshots Not applicable. ## Validation - `uv run python tools/changelog/cli.py check develop` - `uv run --frozen isaaclab -f` - `uv run --frozen --extra test python -m pytest source/isaaclab_tasks/test/core/test_environments_newton.py -k 'Direct and (Ant or Humanoid)' -q` (`2 passed`) - Verified the fused writer interface on PhysX, Newton, and Isaac Lab OV. - The source change was exercised by the original focused CPU/CUDA validation before the PR split; new test files are intentionally omitted from this slice. ## Checklist Docker and GPU tests run on demand. Push the commits you want tested, then comment `run-ci` on the pull request. - [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` - [x] I have made corresponding changes to the documentation (not required for this internal performance fix) - [x] My changes generate no new warnings - [ ] 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 (cherry picked from commit 25fad3e)
Description
Reduces common Direct Locomotion task overhead used by Ant and Humanoid without introducing the experimental Ant post-step path.
The change:
The isolated device scalar change improved the Ant host-return measurement from 3.433 ms to 3.231 ms. The remaining changes remove repeated launches, index transfers, copies, and reset writes; the larger fused post-step and device-mask work is deliberately excluded.
This is one focused slice of superseded Draft PR #6509 and is independent of benchmark PR #6474.
Type of change
Release backport
developScreenshots
Not applicable.
Validation
uv run python tools/changelog/cli.py check developuv run --frozen isaaclab -fuv run --frozen --extra test python -m pytest source/isaaclab_tasks/test/core/test_environments_newton.py -k 'Direct and (Ant or Humanoid)' -q(2 passed)Checklist
Docker and GPU tests run on demand. Push the commits you want tested, then
comment
run-cion the pull request.pre-commitchecks with./isaaclab.sh --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bumpextension.toml— CI handles that)CONTRIBUTORS.mdor my name already exists there