CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 24.7k
[PyTorch] Fix inductor CPU masked() body codegen when result dtype is bool and operator is where #138486
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
… bool and operator is where In this case, it looks like we expect the body to be a VecMask (unify_mask_base_type is called by where()), but we don't make it a VecMask. Differential Revision: [D64702918](https://our.internmc.facebook.com/intern/diff/D64702918/) [ghstack-poisoned]
đź”— Helpful Linksđź§Ş See artifacts and rendered test results at hud.pytorch.org/pr/138486
Note: Links to docs will display an error until the docs builds have been completed. âś… No FailuresAs of commit 83b08e8 with merge base fb0da32 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
… bool and operator is where In this case, it looks like we expect the body to be a VecMask (unify_mask_base_type is called by where()), but we don't make it a VecMask. Differential Revision: [D64702918](https://our.internmc.facebook.com/intern/diff/D64702918/) ghstack-source-id: 249157267 Pull Request resolved: #138486
This pull request was exported from Phabricator. Differential Revision: D64702918 |
this should fix one of the inductor failures on #137426 . I need to figure out how to repro this issue without that PR and add a regression test. |
…lt dtype is bool and operator is where" In this case, it looks like we expect the body to be a VecMask (unify_mask_base_type is called by where()), but we don't make it a VecMask. Differential Revision: [D64702918](https://our.internmc.facebook.com/intern/diff/D64702918/) cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang aakhundov [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D64702918 |
… bool and operator is where Pull Request resolved: #138486 In this case, it looks like we expect the body to be a VecMask (unify_mask_base_type is called by where()), but we don't make it a VecMask. ghstack-source-id: 249215767 @exported-using-ghexport Differential Revision: [D64702918](https://our.internmc.facebook.com/intern/diff/D64702918/)
I could use help adding a test here. The failing input to constant_pad_nd on #137426 is tensor size (0, 3, 3) and pad=(1, 1, 1, 1, 1, 1). I brute-forced all sizes in range(3, 10) for dim 1 and 2 on main without finding a repro. |
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.
Thanks for the fix. I think the changes in this PR looks good to me. But would like to study more about the failure.
It looks like body code generates a scalar var with bool dtype, and we mistake it as at::vec::Vectorized
instead of at::vec::VecMask
. It will be great to have a test case.
…lt dtype is bool and operator is where" In this case, it looks like we expect the body to be a VecMask (unify_mask_base_type is called by where()), but we didn't make it a VecMask. Now we do. Differential Revision: [D64702918](https://our.internmc.facebook.com/intern/diff/D64702918/) cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang aakhundov [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D64702918 |
… bool and operator is where Pull Request resolved: #138486 In this case, it looks like we expect the body to be a VecMask (unify_mask_base_type is called by where()), but we don't make it a VecMask. ghstack-source-id: 249286941 @exported-using-ghexport Differential Revision: [D64702918](https://our.internmc.facebook.com/intern/diff/D64702918/)
done! |
…lt dtype is bool and operator is where" In this case, it looks like we expect the body to be a VecMask (unify_mask_base_type is called by where()), but we didn't make it a VecMask. Now we do. Differential Revision: [D64702918](https://our.internmc.facebook.com/intern/diff/D64702918/) cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang aakhundov [ghstack-poisoned]
… bool and operator is where Pull Request resolved: #138486 In this case, it looks like we expect the body to be a VecMask (unify_mask_base_type is called by where()), but we don't make it a VecMask. ghstack-source-id: 249288078 @exported-using-ghexport Differential Revision: [D64702918](https://our.internmc.facebook.com/intern/diff/D64702918/)
This pull request was exported from Phabricator. Differential Revision: D64702918 |
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.
LGTM. Thanks for the fix.
…lt dtype is bool and operator is where" In this case, it looks like we expect the body to be a VecMask (unify_mask_base_type is called by where()), but we didn't make it a VecMask. Now we do. Differential Revision: [D64702918](https://our.internmc.facebook.com/intern/diff/D64702918/) cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang aakhundov [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D64702918 |
This issue is one of two inductor bugs blocking land of #137426. Turned out to be simple Differential Revision: [D64734116](https://our.internmc.facebook.com/intern/diff/D64734116/) Pull Request resolved: #138542 Approved by: https://github.com/jgong5, https://github.com/malfet ghstack dependencies: #138486 Co-authored-by: leslie-fang-intel <leslie.fang@intel.com>
These are ternary ops, not binary ops. Differential Revision: [D64794253](https://our.internmc.facebook.com/intern/diff/D64794253/) Pull Request resolved: #138655 Approved by: https://github.com/jgong5, https://github.com/malfet ghstack dependencies: #138486, #138542
The size of the destination array was too small. Differential Revision: [D64843491](https://our.internmc.facebook.com/intern/diff/D64843491/) Pull Request resolved: #138716 Approved by: https://github.com/jgong5, https://github.com/malfet ghstack dependencies: #138486, #138542, #138655
There is no guarantee that `len` here is enough for a full vector. This was causing at least one test failure on #137426. Differential Revision: [D64857786](https://our.internmc.facebook.com/intern/diff/D64857786/) Pull Request resolved: #138744 Approved by: https://github.com/jgong5, https://github.com/malfet ghstack dependencies: #138486, #138542, #138655, #138716
The correct vector length for ARM64 is 128 bits (16 bytes). We were previously using double this, apparently just because that would be the same length as AVX2. Differential Revision: [D63984039](https://our.internmc.facebook.com/intern/diff/D63984039/) Pull Request resolved: #137426 Approved by: https://github.com/jgong5, https://github.com/malfet ghstack dependencies: #138486, #138542, #138655, #138716, #138744
Stack from ghstack (oldest at bottom):
In this case, it looks like we expect the body to be a VecMask (unify_mask_base_type is called by where()), but we didn't make it a VecMask. Now we do.
Differential Revision: D64702918
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov