Metal backend: Add AOTI shims for memory management#15021
Merged
manuelcandales merged 34 commits intomainfrom Oct 17, 2025
Merged
Metal backend: Add AOTI shims for memory management#15021manuelcandales merged 34 commits intomainfrom
manuelcandales merged 34 commits intomainfrom
Conversation
Contributor
Author
|
Stack from ghstack (oldest at bottom): |
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15021
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 1506e5f with merge base 6e0c9f6 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Oct 10, 2025
This was referenced Oct 10, 2025
| ET_LOG( | ||
| Debug, | ||
| "aoti_torch_delete_tensor_object: successfull (Metal GPU memory)"); | ||
| return Error::Ok; |
Contributor
There was a problem hiding this comment.
returning early causes memory leak, no?
Contributor
There was a problem hiding this comment.
Maybe explicitly implement metal_free_buffer to properly clean up metal buffers and call the method whenever appropriate
manuelcandales
added a commit
to manuelcandales/executorch-1
that referenced
this pull request
Oct 14, 2025
Implement the following shims: - aoti_torch_create_tensor_from_blob_v2 - aoti_torch_empty_strided - aoti_torch_delete_tensor_object - aoti_torch_copy_ - aoti_torch__reinterpret_tensor ghstack-source-id: e272dc3 ghstack-comment-id: 3392300212 Pull-Request: pytorch#15021
| int64_t opaque_metadata_size) { | ||
| ET_LOG(Debug, "aoti_torch_create_tensor_from_blob_v2: entered"); | ||
|
|
||
| (void)device_type; |
Contributor
There was a problem hiding this comment.
I think we should error out if device_type is unexpected.
larryliu0820
approved these changes
Oct 16, 2025
jirioc
pushed a commit
to nxp-upstream/executorch
that referenced
this pull request
Dec 19, 2025
Implement the following shims: - aoti_torch_create_tensor_from_blob_v2 - aoti_torch_empty_strided - aoti_torch_delete_tensor_object - aoti_torch_copy_ - aoti_torch__reinterpret_tensor
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implement the following shims: