-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix cartpole-camera frame-stacking performance regression #5849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
96d453a
Speculative fixes for frame stacking perf regressions introduced in P…
jmart-nv de05064
Drop read-side torch.roll from CircularBuffer.buffer via memmove-shif…
jmart-nv 2547274
Add CircularBuffer.copy_to_stacked and clone=False opt-out for frame-…
jmart-nv 1f8325a
Add stack_dim mode to CircularBuffer for free contiguous stacked-outp…
jmart-nv db671be
Defer RGB normalize past frame-stack buffer.
jmart-nv 8fd347c
Fuse uint8 camera-image normalize via Warp kernel.
jmart-nv 31f5f9c
Replace eager uint8 sum with Warp tiled-reduction kernel
jmart-nv 2334cf3
Fix obs aliasing in stacked_image and CircularBuffer.reset
jmart-nv 342ff92
Changelog fragments for framestack performance regression fix
jmart-nv c5023ce
Restore original comments that were accidentally trimmed
jmart-nv 3ee26c7
Address PR #5849 review feedback (docstrings + cold-path tidy-up)
jmart-nv 9441d0d
Post-rebase cleanup: precommit formatting, variable renames, changelo…
jmart-nv 5b3e944
Address Greptile review: int64 partials reduction + clearer CircularB…
jmart-nv 4df4101
Fix docs build: drop unsupported :paramref: role in CircularBuffer do…
jmart-nv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
source/isaaclab/changelog.d/jmart-framestack-perf.minor.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| Added | ||
| ^^^^^ | ||
|
|
||
| * Added :paramref:`~isaaclab.utils.buffers.CircularBuffer.stack_dim` constructor argument | ||
| and :attr:`~isaaclab.utils.buffers.CircularBuffer.stacked` property: when ``stack_dim`` is | ||
| set, the internal storage is rearranged so ``stacked`` returns the ``K`` frames merged | ||
| along the chosen dim as a free contiguous view. | ||
| * Added :mod:`isaaclab.utils.images` with :func:`~isaaclab.utils.images.normalize_camera_image` | ||
| and the ``is_rgb_like`` / ``is_depth_like`` / ``is_normals_like`` predicates, shared | ||
| between the DirectRLEnv and ManagerBasedEnv camera observation paths. | ||
| * Added :func:`isaaclab.utils.warp.ops.normalize_image_uint8`, a fused Warp-kernel | ||
| implementation of ``(uint8 / 255) - per-image-channel mean`` for RGB-like camera | ||
| observations. Supports both ``(B, H, W, C)`` and ``(B, C, H, W)`` inputs via a | ||
| ``channel_dim`` argument (``-1`` / ``3`` for BHWC, ``-3`` / ``1`` for BCHW); the | ||
| argument is also forwarded by :func:`~isaaclab.utils.images.normalize_camera_image`. | ||
| * Added a ``clone`` kwarg to :func:`isaaclab.envs.mdp.observations.image`; callers that | ||
| immediately copy the result into their own storage (e.g. a frame-stack buffer) can pass | ||
| ``clone=False`` to skip the redundant allocation. | ||
|
|
||
| Changed | ||
| ^^^^^^^ | ||
|
|
||
| * Changed :class:`~isaaclab.envs.mdp.observations.stacked_image` to use the new ``stack_dim`` | ||
| ``CircularBuffer`` layout and defer normalization past the frame-stack buffer for RGB-like | ||
| data types, eliminating a per-frame float32 upcast and large transpose. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-review (4df4101): New commit is a minor docstring fix (
:paramref:→ inline code formatting incircular_buffer.py). No new issues introduced.✅ Previous P1 concern (misleading RuntimeError) was already addressed.
ℹ️ Previous P2 suggestion (factoring
_get_observations) remains open as a non-blocking style note.LGTM — no further action needed from my side.