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]
@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.

❌ 4 New Failures, 1 Unrelated Failure

As of commit 9a7aa91 with merge base 78c6b42 (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
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.

2 participants