-
Notifications
You must be signed in to change notification settings - Fork 25k
[Inductor][CPP] Support vectorization of bitwise fn #129733
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
[Inductor][CPP] Support vectorization of bitwise fn #129733
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/129733
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 1a8e791 with merge base 6120aa3 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
**Summary** When check the vectorization status among 3 test suit, we found some operators disabled vectorization due to `Disabled vectorization: op: bitwise_and`. In this PR, we add vectorization support of 6 bitwise functions. **Test Plan** ``` python -u -m pytest -s -v test/inductor/test_cpu_repro.py -k test_vec_bitwise ``` cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
**Summary** When check the vectorization status among 3 test suit, we found some operators disabled vectorization with message `Disabled vectorization: op: bitwise_and`. In this PR, we add vectorization support of 6 bitwise functions. In this PR, we also remove `bitwise_xor` from `ops_to_bool` list which sets output data type as bool in data type propagation. It seems wrong since according to this doc https://pytorch.org/docs/stable/generated/torch.bitwise_xor.html, it should return the same integral data type with input and the testcase `test_bitwise3` failed due to this issue. **Test Plan** ``` python -u -m pytest -s -v test/inductor/test_cpu_repro.py -k test_vec_bitwise python -u -m pytest -s -v test/inductor/test_torchinductor.py -k test_bitwise3 ``` cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
@pytorchbot merge |
Merge failedReason: Approvers from one of the following sets are needed:
|
Hi @lezcano, Could you kindly help to take a look of this PR? It looks like may need your approval to get landed. |
@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 |
**Summary** When check the vectorization status among 3 test suit, we found some operators disabled vectorization with message `Disabled vectorization: op: bitwise_and`. In this PR, we add vectorization support of 6 bitwise functions. In this PR, we also remove `bitwise_xor` from `ops_to_bool` list which sets output data type as bool in data type propagation. It seems wrong since according to this doc https://pytorch.org/docs/stable/generated/torch.bitwise_xor.html, it should return the same integral data type with input and the testcase `test_bitwise3` failed due to this issue. **Test Plan** ``` python -u -m pytest -s -v test/inductor/test_cpu_repro.py -k test_vec_bitwise python -u -m pytest -s -v test/inductor/test_torchinductor.py -k test_bitwise3 ``` Pull Request resolved: pytorch#129733 Approved by: https://github.com/jgong5, https://github.com/Skylion007
Stack from ghstack (oldest at bottom):
Summary
When check the vectorization status among 3 test suit, we found some operators disabled vectorization with message
Disabled vectorization: op: bitwise_and
. In this PR, we add vectorization support of 6 bitwise functions.In this PR, we also remove
bitwise_xor
fromops_to_bool
list which sets output data type as bool in data type propagation. It seems wrong since according to this dochttps://pytorch.org/docs/stable/generated/torch.bitwise_xor.html, it should return the same integral data type with input and the testcase
test_bitwise3
failed due to this issue.Test Plan
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang