-
Notifications
You must be signed in to change notification settings - Fork 26.3k
autograd codegen: bump VC properly for mutable ops with no returns #133044
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
[ghstack-poisoned]
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.
Nice fix
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. [ghstack-poisoned]
| at::TensorList tensors = {first, first}; | ||
| at::TensorList undefined_tensors = {first, second}; | ||
| at::TensorList steps = {step, step}; | ||
| return at::_fused_adamw_(tensors, tensors, tensors, tensors, undefined_tensors, |
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.
so calling _fused_adamw_ here with undefined inputs feels like it was just wrong (we now error because you are passing in a mutable, undefined tensor, which autograd is not allowed to bump the VC on).
To make the test a bit more realistic I updated it to use aten::index(). which accepts undefined tensor indices (which are not mutated)
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
albanD
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.
Nice!
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. [ghstack-poisoned]
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. [ghstack-poisoned]
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. [ghstack-poisoned]
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. cc XilunWu H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec [ghstack-poisoned]
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. cc XilunWu H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec [ghstack-poisoned]
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. cc XilunWu H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec [ghstack-poisoned]
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. cc XilunWu H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec [ghstack-poisoned]
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. cc XilunWu H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec [ghstack-poisoned]
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. cc XilunWu H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec [ghstack-poisoned]
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. cc XilunWu H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec [ghstack-poisoned]
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. cc XilunWu H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec [ghstack-poisoned]
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. cc XilunWu H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec [ghstack-poisoned]
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. cc XilunWu H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec [ghstack-poisoned]
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. cc XilunWu H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec [ghstack-poisoned]
… returns" Fixes #132014 In particular, this PR should: (1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like `split_with_sizes_copy.out`) (2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names. cc XilunWu H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec [ghstack-poisoned]
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
Fixes #132014
In particular, this PR should:
(1) start generating and registering kernels to the ADInplaceOrView dispatch key, for mutable ops that have no returns (like
split_with_sizes_copy.out)(2) prevously, the codegen would loop over mutable return names to decide which tensors to codegen VC bumps for. Now, we just loop over mutable input argument names.
Stack from ghstack (oldest at bottom):
cc @XilunWu @H-Huang @awgu @kwen2501 @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @c-p-i-o @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames @rec