-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Make storage access throw for meta tensors #53681
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
Without throwing, we can easily segfault trying to access nullptr storage. To do this I made set_storage_access_should_throw public so that you don't have to subclass TensorImpl to do it. An alternative is to just bite the bullet and add a MetaTensorImpl subclass. Let me know what is preferred. Signed-off-by: Edward Z. Yang <ezyang@fb.com> [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 3c77154 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. |
Without throwing, we can easily segfault trying to access nullptr storage. To do this I made set_storage_access_should_throw public so that you don't have to subclass TensorImpl to do it. An alternative is to just bite the bullet and add a MetaTensorImpl subclass. Let me know what is preferred. Signed-off-by: Edward Z. Yang <ezyang@fb.com> [ghstack-poisoned]
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.
This seems fine as a lightweight addition to the public API, since it can only go in the unsafe->safe direction.
Is a MetaTensorImpl inevitable and you just want to add safety in the meantime? Or are there reasons to avoid the subclass permanently?
It's not, in fact, I cannot think of any reason why I need to actually make a subclass and would prefer not to. |
Without throwing, we can easily segfault trying to access nullptr storage. To do this I made set_storage_access_should_throw public so that you don't have to subclass TensorImpl to do it. An alternative is to just bite the bullet and add a MetaTensorImpl subclass. Let me know what is preferred. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Differential Revision: [D26955540](https://our.internmc.facebook.com/intern/diff/D26955540) [ghstack-poisoned]
Without throwing, we can easily segfault trying to access nullptr storage. To do this I made set_storage_access_should_throw public so that you don't have to subclass TensorImpl to do it. An alternative is to just bite the bullet and add a MetaTensorImpl subclass. Let me know what is preferred. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Differential Revision: [D26955540](https://our.internmc.facebook.com/intern/diff/D26955540) [ghstack-poisoned]
Without throwing, we can easily segfault trying to access nullptr storage. To do this I made set_storage_access_should_throw public so that you don't have to subclass TensorImpl to do it. An alternative is to just bite the bullet and add a MetaTensorImpl subclass. Let me know what is preferred. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Differential Revision: [D26955540](https://our.internmc.facebook.com/intern/diff/D26955540) [ghstack-poisoned]
Summary: Pull Request resolved: pytorch#53681 Without throwing, we can easily segfault trying to access nullptr storage. To do this I made set_storage_access_should_throw public so that you don't have to subclass TensorImpl to do it. An alternative is to just bite the bullet and add a MetaTensorImpl subclass. Let me know what is preferred. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Test Plan: Imported from OSS Reviewed By: bhosmer Differential Revision: D26955540 Pulled By: ezyang fbshipit-source-id: 8ce22dd07ef1beb042f1d91de981954d59c2f84a
Stack from ghstack:
Without throwing, we can easily segfault trying to access nullptr
storage.
To do this I made set_storage_access_should_throw public so that you
don't have to subclass TensorImpl to do it. An alternative is
to just bite the bullet and add a MetaTensorImpl subclass. Let
me know what is preferred.
Signed-off-by: Edward Z. Yang ezyang@fb.com
Differential Revision: D26955540