-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Devirtualize numel() #27294
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
Devirtualize numel() #27294
Conversation
Fixes #27291 I think this deletes at::numel function too, making it technically BC-breaking, but I don't think we intended to generate that function in the first place. Signed-off-by: Edward Z. Yang <[email protected]> [ghstack-poisoned]
Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> [ghstack-poisoned]
Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> ghstack-source-id: 53d0e3e Pull Request resolved: #27294
Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> [ghstack-poisoned]
|
@ailzhang this one breaks xla but it should be a pretty simple fix; just delete the numel() implementation. (This is under the assumption that your TensorImpl::numel implementation does the right thing. Which it should.) |
|
Thanks @ezyang , I'm starting a local run to verify the change. :D Will report back once it's finished. |
Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> [ghstack-poisoned]
Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> ghstack-source-id: 9ce95a1 Pull Request resolved: #27294
| return [sorted(g, key=declkey) for g in grouped_decls] | ||
|
|
||
| # We need to add methods implemented manually in TensorImpl | ||
| # TODO: This seems to claim sizes() returns an int64_t. Really? |
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.
our Tensor::sizes() does return a int64_t iirc. It's number of dimensions. And yes I agree it's confusing :P
ailzhang
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.
Fix is in pytorch/xla#1136
Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> [ghstack-poisoned]
Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> ghstack-source-id: e65c8ab Pull Request resolved: #27294
Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> Differential Revision: [D17763486](https://our.internmc.facebook.com/intern/diff/D17763486) [ghstack-poisoned]
Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> ghstack-source-id: 74091b8 Pull Request resolved: #27294
Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> Differential Revision: [D17763486](https://our.internmc.facebook.com/intern/diff/D17763486) [ghstack-poisoned]
Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> ghstack-source-id: 7b0973e Pull Request resolved: #27294
Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> Differential Revision: [D17763486](https://our.internmc.facebook.com/intern/diff/D17763486) [ghstack-poisoned]
Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> ghstack-source-id: 71653a9 Pull Request resolved: #27294
Summary: Pull Request resolved: pytorch/pytorch#27294 Fixes #27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> Test Plan: Imported from OSS Differential Revision: D17763486 Pulled By: ezyang fbshipit-source-id: 5793b53e2db80b044e57faae325a95c649d9d459
Summary: Pull Request resolved: pytorch#27294 Fixes pytorch#27291 I'm a little annoyed that I have to reintroduce manual binding code. But it's probably not a good idea to teach the codegen how to do fastpath functions (is it?) Signed-off-by: Edward Z. Yang <[email protected]> Test Plan: Imported from OSS Differential Revision: D17763486 Pulled By: ezyang fbshipit-source-id: 5793b53e2db80b044e57faae325a95c649d9d459
Stack from ghstack:
Fixes #27291
I'm a little annoyed that I have to reintroduce manual binding code. But it's
probably not a good idea to teach the codegen how to do fastpath functions
(is it?)
Signed-off-by: Edward Z. Yang [email protected]
Differential Revision: D17763486