Skip to content

Optimizes getters of data inside asset classes - #2118

Merged
kellyguo11 merged 29 commits into
mainfrom
feature/optimize-poses
Jun 7, 2025
Merged

kellyguo11 merged 29 commits into
mainfrom
feature/optimize-poses

Conversation

@Mayankm96

@Mayankm96 Mayankm96 commented Mar 19, 2025 •

Copy link
Copy Markdown
Contributor

Description

Previously the root positions was obtained by performing the following steps:

  1. Call PhysX getters to get transforms and velocities
  2. Concatenating the two to make a single state tensor
  3. Indexing this tensor to get the position

For applications where we only want the positions, the above is an expensive operation as we call CUDA-MemCpy twice and then do concatenation which adds overhead.

This MR simplifies the above process by having separate lazy buffers for poses, velocities and states.

Fixes # (issue)

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Screenshots

Please attach before and after screenshots of the change if applicable.

Checklist

  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@Mayankm96
Mayankm96 marked this pull request as ready for review March 20, 2025 04:48

@jtigue-bdai jtigue-bdai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its a good separation for the pose vs velocity buffers. The added lazy buffer layer in the update call is also a nice addition. Tests all pass (at least the ones I think are dependant) so I think its in good shape. Can you add the performance graphs to the PR description for reference when we look back?

@Mayankm96

Copy link
Copy Markdown
Contributor Author

Will share my logs here tomorrow. It's on a different PC. Might have made sense to run OSMO benchmarking but that seems like quite a bit of an effort.

@Mayankm96

Copy link
Copy Markdown
Contributor Author

@kellyguo11 @matthewtrepte could we run the perf benchmark on this? If it works then this should be merged. It cleans up stuff.

@kellyguo11

Copy link
Copy Markdown
Contributor

@kellyguo11 @matthewtrepte could we run the perf benchmark on this? If it works then this should be merged. It cleans up stuff.

Could you rebase the changes? Some of the regression tests should run automatically now as part of the CI, but we’ll need to update the branch to pick up the change for the tests.

@kellyguo11
kellyguo11 merged commit c984604 into main Jun 7, 2025
@kellyguo11
kellyguo11 deleted the feature/optimize-poses branch June 7, 2025 22:24
yrh012 pushed a commit to aica-technology/isaac-lab that referenced this pull request Jun 16, 2025
# Description

Previously the root positions was obtained by performing the following
steps:

1. Call PhysX getters to get transforms and velocities
2. Concatenating the two to make a single state tensor
3. Indexing this tensor to get the position

For applications where we only want the positions, the above is an
expensive operation as we call CUDA-MemCpy twice and then do
concatenation which adds overhead.

This MR simplifies the above process by having separate lazy buffers for
poses, velocities and states.

Fixes # (issue)

<!-- As a practice, it is recommended to open an issue to have
discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being
developed or added, and if a given feature
is demanded by more than one party. -->

## Type of change

- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- This change requires a documentation update

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## Checklist

- [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
- [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 updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Signed-off-by: Kelly Guo <[email protected]>
Co-authored-by: Kelly Guo <[email protected]>
harry-wf-cheung pushed a commit to harry-wf-cheung/IsaacLab-Harry that referenced this pull request Jul 30, 2025
# Description

Previously the root positions was obtained by performing the following
steps:

1. Call PhysX getters to get transforms and velocities
2. Concatenating the two to make a single state tensor
3. Indexing this tensor to get the position

For applications where we only want the positions, the above is an
expensive operation as we call CUDA-MemCpy twice and then do
concatenation which adds overhead.

This MR simplifies the above process by having separate lazy buffers for
poses, velocities and states.

Fixes # (issue)

<!-- As a practice, it is recommended to open an issue to have
discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being
developed or added, and if a given feature
is demanded by more than one party. -->

## Type of change

- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- This change requires a documentation update

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## Checklist

- [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
- [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 updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Signed-off-by: Kelly Guo <[email protected]>
Co-authored-by: Kelly Guo <[email protected]>
LJones-alt pushed a commit to LJones-alt/IsaacLab-Laura that referenced this pull request Jul 1, 2026
# Description

Previously the root positions was obtained by performing the following
steps:

1. Call PhysX getters to get transforms and velocities
2. Concatenating the two to make a single state tensor
3. Indexing this tensor to get the position

For applications where we only want the positions, the above is an
expensive operation as we call CUDA-MemCpy twice and then do
concatenation which adds overhead.

This MR simplifies the above process by having separate lazy buffers for
poses, velocities and states.

Fixes # (issue)

<!-- As a practice, it is recommended to open an issue to have
discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being
developed or added, and if a given feature
is demanded by more than one party. -->

## Type of change

- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- This change requires a documentation update

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## Checklist

- [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
- [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 updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Signed-off-by: Kelly Guo <[email protected]>
Co-authored-by: Kelly Guo <[email protected]>
csj-275 pushed a commit to csj-275/IsaacLab that referenced this pull request Jul 8, 2026
# Description

Previously the root positions was obtained by performing the following
steps:

1. Call PhysX getters to get transforms and velocities
2. Concatenating the two to make a single state tensor
3. Indexing this tensor to get the position

For applications where we only want the positions, the above is an
expensive operation as we call CUDA-MemCpy twice and then do
concatenation which adds overhead.

This MR simplifies the above process by having separate lazy buffers for
poses, velocities and states.

Fixes # (issue)

<!-- As a practice, it is recommended to open an issue to have
discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being
developed or added, and if a given feature
is demanded by more than one party. -->

## Type of change

- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- This change requires a documentation update

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## Checklist

- [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
- [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 updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Signed-off-by: Kelly Guo <[email protected]>
Co-authored-by: Kelly Guo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants