-
Notifications
You must be signed in to change notification settings - Fork 695
Metal backend: Add AOTI shims for memory management #15021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
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. |
| ET_LOG( | ||
| Debug, | ||
| "aoti_torch_delete_tensor_object: successfull (Metal GPU memory)"); | ||
| return Error::Ok; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
returning early causes memory leak, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe explicitly implement metal_free_buffer to properly clean up metal buffers and call the method whenever appropriate
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should error out if device_type is unexpected.
Implement the following shims: