-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Add decompositions for copy variants of view ops #128416
base: gh/rec/14/base
Are you sure you want to change the base?
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/128416
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 118 PendingAs of commit b5d251b with merge base 1e61cb8 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
ghstack-source-id: a290ff22d81cdf09038063a6bd2b5c47e103b460 Pull Request resolved: #128416
ghstack-source-id: a290ff22d81cdf09038063a6bd2b5c47e103b460 Pull Request resolved: pytorch#128416
ghstack-source-id: a290ff22d81cdf09038063a6bd2b5c47e103b460 Pull Request resolved: pytorch#128416
ghstack-source-id: a290ff22d81cdf09038063a6bd2b5c47e103b460 Pull Request resolved: pytorch#128416
ghstack-source-id: a290ff22d81cdf09038063a6bd2b5c47e103b460 Pull Request resolved: pytorch#128416
[ghstack-poisoned]
ghstack-source-id: 32dce226e1e801cc8278a3dbe985e22d0292f039 Pull Request resolved: #128416
[ghstack-poisoned]
ghstack-source-id: 32dce226e1e801cc8278a3dbe985e22d0292f039 Pull Request resolved: #128416
[ghstack-poisoned]
ghstack-source-id: 8e4e90c06a7b861eec2ee10f0b0eee11496df8b2 Pull Request resolved: #128416
[ghstack-poisoned]
ghstack-source-id: 8e4e90c06a7b861eec2ee10f0b0eee11496df8b2 Pull Request resolved: pytorch#128416
The single ❌ seems to be caused by the SEV, so this is ready to go. |
ghstack-source-id: 8e4e90c06a7b861eec2ee10f0b0eee11496df8b2 Pull Request resolved: pytorch#128416
[ghstack-poisoned]
ghstack-source-id: 90438a927c50ab4ab31c12e18f11846af0423723 Pull Request resolved: pytorch#128416
ghstack-source-id: 90438a927c50ab4ab31c12e18f11846af0423723 Pull Request resolved: pytorch#128416
[ghstack-poisoned]
@pytorchbot: merge |
❌ 🤖 pytorchbot command failed:
Try |
@pytorchbot merge |
Merge failedReason: Approvers from one of the following sets are needed:
|
cc mrshenli pritamdamania87 zhaojuanmao satgera gqchen aazzolini osalpekar jiayisuse H-Huang kwen2501 awgu fegin XilunWu wanchaol fduwjj wz337 tianyu-l wconstab chauhang d4l3k voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire [ghstack-poisoned]
ghstack-source-id: 4eba26fa68813477bd7eb7620e23dd2c8bb1f413 Pull Request resolved: #128416
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.
Just one minor point, otherwise looks good.
Thank you for the comprehensive PR!
ghstack-source-id: 4eba26fa68813477bd7eb7620e23dd2c8bb1f413 Pull Request resolved: pytorch#128416
cc mrshenli pritamdamania87 zhaojuanmao satgera gqchen aazzolini osalpekar jiayisuse H-Huang kwen2501 awgu fegin XilunWu wanchaol fduwjj wz337 tianyu-l wconstab chauhang d4l3k voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire [ghstack-poisoned]
ghstack-source-id: 3053377639c5a5bcf864bf8e13aa298b10b053e0 Pull Request resolved: #128416
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.
A couple nits
torch/_prims_common/wrappers.py
Outdated
params = *sig.parameters.values(), out_param | ||
params = sorted(params, key=lambda p: p.kind) |
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.
Why is this change necessary?
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.
Without that line, if there's a **kwds
parameter, it's placed before the out=
parameter, and you get an exception ValueError: wrong parameter order: variadic keyword parameter before keyword-only parameter
.
I added a comment to this effect.
torch/_prims_common/wrappers.py
Outdated
|
||
from typing import Callable, NamedTuple, Optional, overload, Sequence, Tuple | ||
from typing import Callable, Dict, NamedTuple, Optional, overload, Sequence, Tuple |
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.
from typing import Callable, Dict, NamedTuple, Optional, overload, Sequence, Tuple | |
from typing import Callable, NamedTuple, Optional, overload, Sequence, Tuple |
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.
Done.
torch/_refs/__init__.py
Outdated
aten_fn = getattr(aten, fn.__name__) | ||
annotations = fn.__annotations__ | ||
fn = out_wrapper()(aten_fn) | ||
fn.__annotations__.update(annotations) |
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.
nit. Move it to after _fn.__name__
to keep all the metaprogramming together.
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.
Done.
ghstack-source-id: 3053377639c5a5bcf864bf8e13aa298b10b053e0 Pull Request resolved: pytorch#128416
cc mrshenli pritamdamania87 zhaojuanmao satgera gqchen aazzolini osalpekar jiayisuse H-Huang kwen2501 awgu fegin XilunWu wanchaol fduwjj wz337 tianyu-l wconstab chauhang d4l3k voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire [ghstack-poisoned]
ghstack-source-id: ac370ec2fd6d0dffe0e79a6a24b836af869f05d1 Pull Request resolved: #128416
Nits are good to find - they decrease the difficulty of the code for the next programmer! |
Stack from ghstack (oldest at bottom):
cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @fegin @XilunWu @wanchaol @fduwjj @wz337 @tianyu-l @wconstab @chauhang @d4l3k @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire