-
Notifications
You must be signed in to change notification settings - Fork 24k
Make at::vec::Vectorized ops work with scalars #150380
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/150380
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit ed186e4 with merge base caf8d9b ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
I noticed that I couldn't use `vec::Vectorized` operations with scalars, even though there is an implicit conversion from `T` to `vec::Vectorized<T>`, so I made it work. Test Plan: Added tests. Reverted vec_base.h, left the new tests in place, and confirmed that new tests don't compile in that state. ghstack-source-id: 6fce62e30b7ba4a6ad6f786c0412dcc046b0f4d8 Pull Request resolved: #150380
aten/src/ATen/cpu/vec/vec_base.h
Outdated
@@ -668,6 +680,8 @@ template <class T> Vectorized<T> inline operator+(const Vectorized<T> &a, const | |||
return c; | |||
} | |||
|
|||
VECTORIZED_SUPPORT_SCALARS_FOR_BINARY_OP(+) |
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.
What's with the indentation?
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.
it's what my editor wanted to do. this file isn't formatted by lintrunner :\
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.
sent PR to autoformat top-level vec headers
I noticed that I couldn't use `vec::Vectorized` operations with scalars, even though there is an implicit conversion from `T` to `vec::Vectorized<T>`, so I made it work. Test Plan: Added tests. Reverted vec_base.h, left the new tests in place, and confirmed that new tests don't compile in that state. ghstack-source-id: 1c229f424c6ccc72eb9d10a6c8e2293c7890dcc7 Pull Request resolved: #150380
I noticed that I couldn't use `vec::Vectorized` operations with scalars, even though there is an implicit conversion from `T` to `vec::Vectorized<T>`, so I made it work. Test Plan: Added tests. Reverted vec_base.h, left the new tests in place, and confirmed that new tests don't compile in that state. ghstack-source-id: b000faca381a09cae767a2751bce90cf8e11bc08 Pull Request resolved: #150380
ping |
I got a complaint about indentation on #150380. Make the machines fix it for us. Pull Request resolved: #150426 Approved by: https://github.com/aditew01, https://github.com/cyyever, https://github.com/frost-intel, https://github.com/Skylion007
Starting merge as part of PR stack under #150568 |
1 similar comment
Starting merge as part of PR stack under #150568 |
@Skylion007 can you please take another look? |
Starting merge as part of PR stack under #150568 |
1 similar comment
Starting merge as part of PR stack under #150568 |
Rebased |
Starting merge as part of PR stack under #150568 |
Makes Vectorized look even more like a scalar type, getting me closer to being able to use the same generic code with scalars and Vectorized (e.g., for sigmoid, which needs `exp(-x)`). Pull Request resolved: #150568 Approved by: https://github.com/Skylion007 ghstack dependencies: #150380
I got a complaint about indentation on pytorch#150380. Make the machines fix it for us. Pull Request resolved: pytorch#150426 Approved by: https://github.com/aditew01, https://github.com/cyyever, https://github.com/frost-intel, https://github.com/Skylion007
I noticed that I couldn't use `vec::Vectorized` operations with scalars, even though there is an implicit conversion from `T` to `vec::Vectorized<T>`, so I made it work. Test Plan: Added tests. Reverted vec_base.h, left the new tests in place, and confirmed that new tests don't compile in that state. Pull Request resolved: pytorch#150380 Approved by: https://github.com/Skylion007
…ch#150568) Makes Vectorized look even more like a scalar type, getting me closer to being able to use the same generic code with scalars and Vectorized (e.g., for sigmoid, which needs `exp(-x)`). Pull Request resolved: pytorch#150568 Approved by: https://github.com/Skylion007 ghstack dependencies: pytorch#150380
I got a complaint about indentation on pytorch#150380. Make the machines fix it for us. Pull Request resolved: pytorch#150426 Approved by: https://github.com/aditew01, https://github.com/cyyever, https://github.com/frost-intel, https://github.com/Skylion007
I noticed that I couldn't use `vec::Vectorized` operations with scalars, even though there is an implicit conversion from `T` to `vec::Vectorized<T>`, so I made it work. Test Plan: Added tests. Reverted vec_base.h, left the new tests in place, and confirmed that new tests don't compile in that state. Pull Request resolved: pytorch#150380 Approved by: https://github.com/Skylion007
…ch#150568) Makes Vectorized look even more like a scalar type, getting me closer to being able to use the same generic code with scalars and Vectorized (e.g., for sigmoid, which needs `exp(-x)`). Pull Request resolved: pytorch#150568 Approved by: https://github.com/Skylion007 ghstack dependencies: pytorch#150380
I noticed that I couldn't use `vec::Vectorized` operations with scalars, even though there is an implicit conversion from `T` to `vec::Vectorized<T>`, so I made it work. Test Plan: Added tests. Reverted vec_base.h, left the new tests in place, and confirmed that new tests don't compile in that state. ghstack-source-id: 8ae256b5f0a68bb8067116e7879fe47f3a00107a Pull Request resolved: pytorch/pytorch#150380
Stack from ghstack (oldest at bottom):
I noticed that I couldn't use
vec::Vectorized
operations with scalars, even though there is an implicit conversion fromT
tovec::Vectorized<T>
, so I made it work.Test Plan: Added tests. Reverted vec_base.h, left the new tests in place, and confirmed that new tests don't compile in that state.
cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10