-
Notifications
You must be signed in to change notification settings - Fork 70
Add ldexp implementation on XPU #2773
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
base: main
Are you sure you want to change the base?
Conversation
CuiYifeng
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.
@xiaowangintel Please check UT summary. I noticed that there are still ldexp related cases in failure list.
src/ATen/native/xpu/BinaryOps.cpp
Outdated
| REGISTER_XPU_DISPATCH( | ||
| shifted_chebyshev_polynomial_w_stub, | ||
| &xpu::shifted_chebyshev_polynomial_w_kernel); | ||
|
|
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.
Please remove this blank line.
Sync with @daisyden , we need to execute ci first and ensure the relevant test pass. Then we can consider removing items from the failure list. |
| template <typename scalar_t> | ||
| struct LdexpFunctor { | ||
| scalar_t operator()(scalar_t x, int exp) const { | ||
| return ::ldexp(x, exp); |
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.
One more question: which component provides ::ldexp?
Performance outliers, please check!
|
Related to #2772
The ldexp's implementation have been changed in pytorch/pytorch#168357. The new implementation involves adding a stub kernel to replace the decomposition. And we meets error as 'DispatchStub: missing kernel for xpu' when use ldexp operator with stock pytorch.