-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[PyTorch] Make TensorImpl::sizes() customizable and disable it for NestedTensorImpl #73817
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
…stedTensorImpl NestedTensorImpl doesn't have sizes(). Silently getting wrong results back from it is not conducive to efficient software development. Make it throw while allowing sizes() to be inlined in the common case anyway, just like is_contiguous(). Thanks @ezyang for the reminder that we could do this. Differential Revision: [D34660829](https://our.internmc.facebook.com/intern/diff/D34660829/) [ghstack-poisoned]
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit f95919d (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).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
CI Flow Status⚛️ CI FlowRuleset - Version:
|
…stedTensorImpl NestedTensorImpl doesn't have sizes(). Silently getting wrong results back from it is not conducive to efficient software development. Make it throw while allowing sizes() to be inlined in the common case anyway, just like is_contiguous(). Thanks ezyang for the reminder that we could do this. Differential Revision: [D34660829](https://our.internmc.facebook.com/intern/diff/D34660829/) ghstack-source-id: 150608338 Pull Request resolved: #73817
ezyang
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.
Approving for speed. I'm wondering how much we actually want to use two bits on the policy; maybe we can do the error case by just going to the dynamic dispatch (and then having that raise the error).
I don't think we have a use case for the dynamic dispatch yet, which is why it's not even implemented. I could make it 1 bit but I think that would raise bc issues if we add the dynamic dispatch? We can always make the storage 1 bit despite having the 3 cases in the policy if we need the bit back. |
…e it for NestedTensorImpl" NestedTensorImpl doesn't have sizes(). Silently getting wrong results back from it is not conducive to efficient software development. Make it throw while allowing sizes() to be inlined in the common case anyway, just like is_contiguous(). Thanks ezyang for the reminder that we could do this. Differential Revision: [D34660829](https://our.internmc.facebook.com/intern/diff/D34660829/) [ghstack-poisoned]
…stedTensorImpl Pull Request resolved: #73817 NestedTensorImpl doesn't have sizes(). Silently getting wrong results back from it is not conducive to efficient software development. Make it throw while allowing sizes() to be inlined in the common case anyway, just like is_contiguous(). Thanks @ezyang for the reminder that we could do this. ghstack-source-id: 150814799 Differential Revision: [D34660829](https://our.internmc.facebook.com/intern/diff/D34660829/)
…e it for NestedTensorImpl" NestedTensorImpl doesn't have sizes(). Silently getting wrong results back from it is not conducive to efficient software development. Make it throw while allowing sizes() to be inlined in the common case anyway, just like is_contiguous(). Thanks ezyang for the reminder that we could do this. Differential Revision: [D34660829](https://our.internmc.facebook.com/intern/diff/D34660829/) [ghstack-poisoned]
…stedTensorImpl Pull Request resolved: #73817 NestedTensorImpl doesn't have sizes(). Silently getting wrong results back from it is not conducive to efficient software development. Make it throw while allowing sizes() to be inlined in the common case anyway, just like is_contiguous(). Thanks @ezyang for the reminder that we could do this. ghstack-source-id: 151302903 Differential Revision: [D34660829](https://our.internmc.facebook.com/intern/diff/D34660829/)
…stedTensorImpl (#73817) Summary: Pull Request resolved: #73817 NestedTensorImpl doesn't have sizes(). Silently getting wrong results back from it is not conducive to efficient software development. Make it throw while allowing sizes() to be inlined in the common case anyway, just like is_contiguous(). Thanks ezyang for the reminder that we could do this. ghstack-source-id: 151302903 Test Plan: Updated test_nestedtensor.py Reviewed By: ezyang Differential Revision: D34660829 fbshipit-source-id: 1289f21127d6a8359893f9174f3c430a290f2c7f
|
Hey @swolchok. |
Stack from ghstack (oldest at bottom):
NestedTensorImpl doesn't have sizes(). Silently getting wrong results back from it is not conducive to efficient software development. Make it throw while allowing sizes() to be inlined in the common case anyway, just like is_contiguous(). Thanks @ezyang for the reminder that we could do this.
Differential Revision: D34660829