Skip to content

Conversation

@larryliu0820
Copy link
Contributor

Add two new shim implementations for the CUDA AOTI backend:

  1. aoti_torch_item_bool: Extracts a boolean value from a 0D boolean tensor.
    Handles both CPU and CUDA tensors by using cudaPointerGetAttributes to
    determine the memory location and copying from device if needed.

  2. aoti_torch_assign_tensors_out: Creates a new tensor view that shares the
    same underlying data as the source tensor. The new tensor has the same
    shape, strides, and dtype as the source.

Also adds:

  • Declaration of aoti_torch_dtype_bool() in common_shims.h
  • Unit tests for both new functions
  • Update CMakeLists.txt with new test targets
  • Update targets.bzl with new test targets

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@larryliu0820
Copy link
Contributor Author

larryliu0820 commented Dec 19, 2025

@pytorch-bot
Copy link

pytorch-bot bot commented Dec 19, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16345

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 1 Unrelated Failure

As of commit d5c53ec with merge base 0f5a252 (image):

NEW FAILURES - The following jobs have failed:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

larryliu0820 added a commit that referenced this pull request Dec 19, 2025
Add two new shim implementations for the CUDA AOTI backend:

1. aoti_torch_item_bool: Extracts a boolean value from a 0D boolean tensor.
   Handles both CPU and CUDA tensors by using cudaPointerGetAttributes to
   determine the memory location and copying from device if needed.

2. aoti_torch_assign_tensors_out: Creates a new tensor view that shares the
   same underlying data as the source tensor. The new tensor has the same
   shape, strides, and dtype as the source.

Also adds:
- Declaration of aoti_torch_dtype_bool() in common_shims.h
- Unit tests for both new functions
- Update CMakeLists.txt with new test targets
- Update targets.bzl with new test targets


ghstack-source-id: de89b09
ghstack-comment-id: 3676249127
Pull-Request: #16345
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 19, 2025
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Dec 22, 2025
Add two new shim implementations for the CUDA AOTI backend:

1. aoti_torch_item_bool: Extracts a boolean value from a 0D boolean tensor.
   Handles both CPU and CUDA tensors by using cudaPointerGetAttributes to
   determine the memory location and copying from device if needed.

2. aoti_torch_assign_tensors_out: Creates a new tensor view that shares the
   same underlying data as the source tensor. The new tensor has the same
   shape, strides, and dtype as the source.

Also adds:
- Declaration of aoti_torch_dtype_bool() in common_shims.h
- Unit tests for both new functions
- Update CMakeLists.txt with new test targets
- Update targets.bzl with new test targets

ghstack-source-id: 4aaf6d8
ghstack-comment-id: 3676249127
Pull-Request: #16345
[ghstack-poisoned]
[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Dec 22, 2025
Add two new shim implementations for the CUDA AOTI backend:

1. aoti_torch_item_bool: Extracts a boolean value from a 0D boolean tensor.
   Handles both CPU and CUDA tensors by using cudaPointerGetAttributes to
   determine the memory location and copying from device if needed.

2. aoti_torch_assign_tensors_out: Creates a new tensor view that shares the
   same underlying data as the source tensor. The new tensor has the same
   shape, strides, and dtype as the source.

Also adds:
- Declaration of aoti_torch_dtype_bool() in common_shims.h
- Unit tests for both new functions
- Update CMakeLists.txt with new test targets
- Update targets.bzl with new test targets

ghstack-source-id: 74b9474
ghstack-comment-id: 3676249127
Pull-Request: #16345
[ghstack-poisoned]
[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Dec 22, 2025
Add two new shim implementations for the CUDA AOTI backend:

1. aoti_torch_item_bool: Extracts a boolean value from a 0D boolean tensor.
   Handles both CPU and CUDA tensors by using cudaPointerGetAttributes to
   determine the memory location and copying from device if needed.

2. aoti_torch_assign_tensors_out: Creates a new tensor view that shares the
   same underlying data as the source tensor. The new tensor has the same
   shape, strides, and dtype as the source.

Also adds:
- Declaration of aoti_torch_dtype_bool() in common_shims.h
- Unit tests for both new functions
- Update CMakeLists.txt with new test targets
- Update targets.bzl with new test targets

ghstack-source-id: 845c6fa
ghstack-comment-id: 3676249127
Pull-Request: #16345
Copy link
Contributor

@Gasoonjia Gasoonjia left a comment

Choose a reason for hiding this comment

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

LGTM!

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Base automatically changed from gh/larryliu0820/83/head to main December 23, 2025 00:49
[ghstack-poisoned]
@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@larryliu0820 larryliu0820 merged commit a5799b4 into main Dec 23, 2025
161 of 164 checks passed
@larryliu0820 larryliu0820 deleted the gh/larryliu0820/84/head branch December 23, 2025 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants