-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add aten::trunc, aten::xlogy and thieir variants #697
Conversation
yaml/xpu_functions.yaml
Outdated
@@ -45,6 +45,13 @@ supported: | |||
- remainder_.Tensor | |||
- remainder.Tensor_out | |||
- remainder.Scalar_Tensor | |||
- xlogy.OutScalar_Self |
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.
no need to register
yaml/xpu_functions.yaml
Outdated
@@ -45,6 +45,13 @@ supported: | |||
- remainder_.Tensor | |||
- remainder.Tensor_out | |||
- remainder.Scalar_Tensor | |||
- xlogy.OutScalar_Self | |||
- xlogy.OutScalar_Other |
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.
ditto
yaml/xpu_functions.yaml
Outdated
- xlogy.OutScalar_Self | ||
- xlogy.OutScalar_Other | ||
- xlogy.OutTensor | ||
- xlogy.Scalar_Other |
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.
ditto
yaml/xpu_functions.yaml
Outdated
- xlogy.OutScalar_Other | ||
- xlogy.OutTensor | ||
- xlogy.Scalar_Other | ||
- xlogy.Scalar_Self |
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.
ditto
yaml/xpu_functions.yaml
Outdated
- xlogy.Scalar_Other | ||
- xlogy.Scalar_Self | ||
- xlogy.Tensor | ||
- xlogy_.Scalar_Other |
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.
ditto
please double check the auto gen file build/aten/src/ATen/RegisterCUDA.cpp for which operator should be registered
m.impl("xlogy.Tensor", TORCH_FN(wrapper_CUDA_xlogy_Tensor));
m.impl("xlogy.OutTensor", TORCH_FN(wrapper_CUDA_xlogy_out_OutTensor));
m.impl("xlogy_.Tensor", TORCH_FN(wrapper_CUDA_xlogy__Tensor));
src/ATen/native/xpu/BinaryOps.cpp
Outdated
return out; | ||
} | ||
|
||
Tensor& XPUNativeFunctions::xlogy_out( |
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.
ditto
src/ATen/native/xpu/BinaryOps.cpp
Outdated
return at::xlogy_out(result, native::wrapped_scalar_tensor(self), other); | ||
} | ||
|
||
Tensor& XPUNativeFunctions::xlogy_out( |
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.
ditto
src/ATen/native/xpu/BinaryOps.cpp
Outdated
return at::xlogy_out(result, self, native::wrapped_scalar_tensor(other)); | ||
} | ||
|
||
Tensor XPUNativeFunctions::xlogy(const Scalar& x, const Tensor& y) { |
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.
ditto
src/ATen/native/xpu/BinaryOps.cpp
Outdated
return at::xlogy(native::wrapped_scalar_tensor(x), y); | ||
} | ||
|
||
Tensor XPUNativeFunctions::xlogy(const Tensor& x, const Scalar& y) { |
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.
ditto
yaml/xpu_functions.yaml
Outdated
@@ -36,6 +36,9 @@ supported: | |||
- remainder_.Tensor | |||
- remainder.Tensor_out | |||
- remainder.Scalar_Tensor | |||
- xlogy.Tensor |
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 these lines and add schemas in native_functions.yaml
only.
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.
Done.
src/ATen/native/xpu/BinaryOps.cpp
Outdated
@@ -51,6 +52,7 @@ REGISTER_XPU_DISPATCH(fmax_stub, &xpu::fmax_kernel); | |||
REGISTER_XPU_DISPATCH(fmin_stub, &xpu::fmin_kernel); | |||
REGISTER_XPU_DISPATCH(lshift_stub, &xpu::lshift_kernel); | |||
REGISTER_XPU_DISPATCH(rshift_stub, &xpu::rshift_kernel); | |||
REGISTER_XPU_DISPATCH(xlogy, &xpu::xlogy_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.
xlogy_stub?
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.
Done.
No description provided.