Skip to content

Conversation

larryliu0820
Copy link
Contributor

@larryliu0820 larryliu0820 commented Sep 30, 2025

Stack from ghstack (oldest at bottom):

Summary:

this is a comprehensive update to use ET_CHECK macro to replace original if..else check for better follow et's law

Reviewed By:

Differential Revision:

Summary:

This diff introduce `aoti_torch_delete_tensor_object` for deleting tensors created during cuda backend inference.

Reviewed By:

[ghstack-poisoned]
Summary:

This function introduce aoti_torch_create_tensor_from_blob_v2, a function that create tensor from data blob and custom stride and size.

Worth to notice that unlike aoti_torch_empty_strided, the tensor created by aoti_torch_create_tensor_from_blob_v2 will not have the control of the memory blob. Therefore when we delete it, the memory will not be freed.

Reviewed By:

Differential Revision:

[ghstack-poisoned]
Summary:

Introduced aoti_torch__reinterpret_tensor, which creates a new tensor view that reinterprets the same underlying memory with custom shape and strides.

Reviewed By:

Differential Revision:

[ghstack-poisoned]
Summary:

This diff introduce `aoti_torch_copy_`, the function for copying tensor inside cuda backend.

Right now it only support copy between tensors with same dtype.

Reviewed By:

Differential Revision:

[ghstack-poisoned]
Summary:

this is a comprehensive update to use ET_CHECK macro to replace original if..else check for better follow et's law

Reviewed By:

Differential Revision:

[ghstack-poisoned]
@larryliu0820 larryliu0820 mentioned this pull request Sep 30, 2025
Copy link

pytorch-bot bot commented Sep 30, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 8 Pending

As of commit 9f1fb01 with merge base 65100f6 (image):

NEW FAILURE - The following job has failed:

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

larryliu0820 added a commit that referenced this pull request Sep 30, 2025
Summary:

this is a comprehensive update to use ET_CHECK macro to replace original if..else check for better follow et's law

Reviewed By:

Differential Revision:

ghstack-source-id: 3e820e1
Pull Request resolved: #14690
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.

@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 Sep 30, 2025
larryliu0820 added a commit that referenced this pull request Sep 30, 2025
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at
bottom):
* #14690
* #14689
* #14688
* #14687
* __->__ #14686

Summary:

This diff introduce `aoti_torch_delete_tensor_object` for deleting
tensors created during cuda backend inference.

Reviewed By:
larryliu0820 added a commit that referenced this pull request Sep 30, 2025
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at
bottom):
* #14690
* #14689
* #14688
* __->__ #14687
* #14686

Summary:

This function introduce aoti_torch_create_tensor_from_blob_v2, a
function that create tensor from data blob and custom stride and size.

Worth to notice that unlike aoti_torch_empty_strided, the tensor created
by aoti_torch_create_tensor_from_blob_v2 will not have the control of
the memory blob. Therefore when we delete it, the memory will not be
freed.

Reviewed By:

Differential Revision:
larryliu0820 added a commit that referenced this pull request Sep 30, 2025
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at
bottom):
* #14690
* #14689
* #14688
* __->__ #14700
* #14686

Summary:
This is a manual cherry pick of #14687 

This function introduce aoti_torch_create_tensor_from_blob_v2, a
function that create tensor from data blob and custom stride and size.

Worth to notice that unlike aoti_torch_empty_strided, the tensor created
by aoti_torch_create_tensor_from_blob_v2 will not have the control of
the memory blob. Therefore when we delete it, the memory will not be
freed.

Reviewed By:

Differential Revision:
larryliu0820 added a commit that referenced this pull request Sep 30, 2025
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at
bottom):
* #14690
* #14689
* __->__ #14688
* #14687
* #14686

Summary:

Introduced aoti_torch__reinterpret_tensor, which creates a new tensor
view that reinterprets the same underlying memory with custom shape and
strides.

Reviewed By:

Differential Revision:
larryliu0820 added a commit that referenced this pull request Sep 30, 2025
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at
bottom):
* #14690
* __->__ #14689
* #14688
* #14687
* #14686

Summary:

This diff introduce `aoti_torch_copy_`, the function for copying tensor
inside cuda backend.

Right now it only support copy between tensors with same dtype.

Reviewed By:

Differential Revision:
@larryliu0820 larryliu0820 changed the base branch from gh/larryliu0820/80/base to main September 30, 2025 22:05
@larryliu0820 larryliu0820 merged commit 258bce3 into main Sep 30, 2025
129 of 130 checks passed
@larryliu0820 larryliu0820 deleted the gh/larryliu0820/80/head branch September 30, 2025 23:25
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