-
Notifications
You must be signed in to change notification settings - Fork 767
Add device type validation in aoti_torch_create_tensor_from_blob_v2 #16344
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16344
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 11 Pending, 1 Unrelated FailureAs of commit 73efe12 with merge base 227ff2e ( NEW FAILURE - The following job has 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. |
Validate that the data pointer location matches the requested device_type. This prevents silent data corruption when tensors are created with mismatched data pointer and device type. Changes: - Add cudaPointerGetAttributes check to verify data pointer location - Error out if CPU data is provided but CUDA device is requested - Error out if CUDA data is provided but CPU device is requested - Add unit tests for device type mismatch scenarios ghstack-source-id: 7c05d4d ghstack-comment-id: 3676248526 Pull-Request: #16344
This PR needs a
|
Validate that the data pointer location matches the requested device_type. This prevents silent data corruption when tensors are created with mismatched data pointer and device type. Changes: - Add cudaPointerGetAttributes check to verify data pointer location - Error out if CPU data is provided but CUDA device is requested - Error out if CUDA data is provided but CPU device is requested - Add unit tests for device type mismatch scenarios ghstack-source-id: dcd2f99 ghstack-comment-id: 3676248526 Pull-Request: #16344
Gasoonjia
left a comment
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.
Thanks for adding the support and the tests!
Validate that the data pointer location matches the requested device_type.
This prevents silent data corruption when tensors are created with
mismatched data pointer and device type.
Changes: