Skip to content
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

[AOTI] Support InplaceBernoulliFallback in the ABI-compatible codegen #126183

Closed
wants to merge 6 commits into from

Conversation

Summary: Update the torchgen rule for inplace ops like bernoulli_, and update InplaceBernoulliFallback to codegen in the ABI-compatible mode.

[ghstack-poisoned]
Copy link

pytorch-bot bot commented May 14, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/126183

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 2ea22a7 with merge base ee8c155 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

desertfire added a commit that referenced this pull request May 14, 2024
Summary: Update the torchgen rule for inplace ops like bernoulli_, and update InplaceBernoulliFallback to codegen in the ABI-compatible mode.

ghstack-source-id: 244079be9160ce16845c7ce96d1f0fef0ed71793
Pull Request resolved: #126183
@desertfire desertfire added the topic: not user facing topic category label May 14, 2024
@@ -112,8 +114,8 @@ AOTI_TORCH_EXPORT AOTITorchError aoti_torch_cuda_randperm(int64_t n, int32_t* dt
AOTI_TORCH_EXPORT AOTITorchError aoti_torch_cuda_repeat_interleave_Tensor(AtenTensorHandle repeats, int64_t* output_size, AtenTensorHandle* ret0);
AOTI_TORCH_EXPORT AOTITorchError aoti_torch_cuda_replication_pad1d_backward(AtenTensorHandle grad_output, AtenTensorHandle self, const int64_t* padding, int64_t padding_len_, AtenTensorHandle* ret0);
AOTI_TORCH_EXPORT AOTITorchError aoti_torch_cuda_replication_pad2d_backward(AtenTensorHandle grad_output, AtenTensorHandle self, const int64_t* padding, int64_t padding_len_, AtenTensorHandle* ret0);
AOTI_TORCH_EXPORT AOTITorchError aoti_torch_cuda_resize_(AtenTensorHandle self, const int64_t* size, int64_t size_len_, int32_t* memory_format, AtenTensorHandle* ret0);
AOTI_TORCH_EXPORT AOTITorchError aoti_torch_cuda_resize_as_(AtenTensorHandle self, AtenTensorHandle the_template, int32_t* memory_format, AtenTensorHandle* ret0);
AOTI_TORCH_EXPORT AOTITorchError aoti_torch_cuda_resize_(AtenTensorHandle self, const int64_t* size, int64_t size_len_, int32_t* memory_format);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok to make this kind of one-time change, because aoti_torch_cuda_resize_ wasn't working properly previously.

…ble codegen"


Summary: Update the torchgen rule for inplace ops like bernoulli_, and update InplaceBernoulliFallback to codegen in the ABI-compatible mode. Fixes #121809

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames chauhang

[ghstack-poisoned]
desertfire added a commit that referenced this pull request May 14, 2024
Summary: Update the torchgen rule for inplace ops like bernoulli_, and update InplaceBernoulliFallback to codegen in the ABI-compatible mode.

ghstack-source-id: 81864809729cae55c4b103e1a352a4a81641f17b
Pull Request resolved: #126183
…ble codegen"


Summary: Update the torchgen rule for inplace ops like bernoulli_, and update InplaceBernoulliFallback to codegen in the ABI-compatible mode. Fixes #121809

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames chauhang

[ghstack-poisoned]
desertfire added a commit that referenced this pull request May 14, 2024
Summary: Update the torchgen rule for inplace ops like bernoulli_, and update InplaceBernoulliFallback to codegen in the ABI-compatible mode.

ghstack-source-id: 655783073c5060f429b5faf6ab62aaa38a37f14a
Pull Request resolved: #126183
args, callsite_exprs = gen_arguments(
[*schema.arguments.flat_non_out, *schema.arguments.out]
if "at::native" in backend_call
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This "at::native" logic is not needed anymore.

@chenyang78
Copy link
Contributor

The failure related to test_bernoulli1_cuda_cuda_wrapper seems to be real. Thanks.

…ble codegen"


Summary: Update the torchgen rule for inplace ops like bernoulli_, and update InplaceBernoulliFallback to codegen in the ABI-compatible mode. Fixes #121809

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames chauhang

[ghstack-poisoned]
desertfire added a commit that referenced this pull request May 15, 2024
Summary: Update the torchgen rule for inplace ops like bernoulli_, and update InplaceBernoulliFallback to codegen in the ABI-compatible mode.

ghstack-source-id: 373314464db98adf1af6c7150562b8026aa3449d
Pull Request resolved: #126183
…ble codegen"


Summary: Update the torchgen rule for inplace ops like bernoulli_, and update InplaceBernoulliFallback to codegen in the ABI-compatible mode. Fixes #121809

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames chauhang

[ghstack-poisoned]
…ble codegen"


Summary: Update the torchgen rule for inplace ops like bernoulli_, and update InplaceBernoulliFallback to codegen in the ABI-compatible mode. Fixes #121809

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames chauhang

[ghstack-poisoned]
desertfire added a commit that referenced this pull request May 15, 2024
Summary: Update the torchgen rule for inplace ops like bernoulli_, and update InplaceBernoulliFallback to codegen in the ABI-compatible mode.

ghstack-source-id: b0c362906d55bb62fa01a56d05151aff8ff3b7d6
Pull Request resolved: #126183
@desertfire
Copy link
Contributor Author

The failure related to test_bernoulli1_cuda_cuda_wrapper seems to be real. Thanks.

error fixed.

OnlyFor pushed a commit to OnlyFor/pytorch that referenced this pull request May 16, 2024
Summary: Update the torchgen rule for inplace ops like bernoulli_, and update InplaceBernoulliFallback to codegen in the ABI-compatible mode.

ghstack-source-id: b0c362906d55bb62fa01a56d05151aff8ff3b7d6
Pull Request resolved: pytorch#126183
Comment on lines +4791 to +4793
wrapper.writeline(
f"{self.get_kernel_name()}({x}, {', '.join(map(repr, self.constant_args))}, NULL){wrapper.ending}"
)
Copy link
Contributor

@angelayi angelayi May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that if user passes in a generator function, we won't use it and will just pass null? Should we put a warning here so that they know?

pytorchmergebot pushed a commit that referenced this pull request May 16, 2024
Summary: The logic has been repeated several times in the code, so it's worth to write a common util function.

Pull Request resolved: #126352
Approved by: https://github.com/chenyang78
ghstack dependencies: #126181, #126182, #126183
ZelboK pushed a commit to ZelboK/pytorch that referenced this pull request May 19, 2024
…pytorch#126183)

Summary: Update the torchgen rule for inplace ops like bernoulli_, and update InplaceBernoulliFallback to codegen in the ABI-compatible mode. Fixes pytorch#121809

Pull Request resolved: pytorch#126183
Approved by: https://github.com/angelayi
ghstack dependencies: pytorch#126181, pytorch#126182
ZelboK pushed a commit to ZelboK/pytorch that referenced this pull request May 19, 2024
Summary: The logic has been repeated several times in the code, so it's worth to write a common util function.

Pull Request resolved: pytorch#126352
Approved by: https://github.com/chenyang78
ghstack dependencies: pytorch#126181, pytorch#126182, pytorch#126183
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants