Skip to content
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

Merged
merged 11 commits into from
Sep 30, 2024
Merged

Add aten::trunc, aten::xlogy and thieir variants #697

merged 11 commits into from
Sep 30, 2024

Conversation

yucai-intel
Copy link
Contributor

No description provided.

@yucai-intel yucai-intel added this to the PT2.6 milestone Aug 15, 2024
@@ -45,6 +45,13 @@ supported:
- remainder_.Tensor
- remainder.Tensor_out
- remainder.Scalar_Tensor
- xlogy.OutScalar_Self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to register

@@ -45,6 +45,13 @@ supported:
- remainder_.Tensor
- remainder.Tensor_out
- remainder.Scalar_Tensor
- xlogy.OutScalar_Self
- xlogy.OutScalar_Other
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

- xlogy.OutScalar_Self
- xlogy.OutScalar_Other
- xlogy.OutTensor
- xlogy.Scalar_Other
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

- xlogy.OutScalar_Other
- xlogy.OutTensor
- xlogy.Scalar_Other
- xlogy.Scalar_Self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

- xlogy.Scalar_Other
- xlogy.Scalar_Self
- xlogy.Tensor
- xlogy_.Scalar_Other
Copy link
Contributor

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));

return out;
}

Tensor& XPUNativeFunctions::xlogy_out(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

return at::xlogy_out(result, native::wrapped_scalar_tensor(self), other);
}

Tensor& XPUNativeFunctions::xlogy_out(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

return at::xlogy_out(result, self, native::wrapped_scalar_tensor(other));
}

Tensor XPUNativeFunctions::xlogy(const Scalar& x, const Tensor& y) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

return at::xlogy(native::wrapped_scalar_tensor(x), y);
}

Tensor XPUNativeFunctions::xlogy(const Tensor& x, const Scalar& y) {
Copy link
Contributor

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/ReduceOps.cpp Outdated Show resolved Hide resolved
@@ -36,6 +36,9 @@ supported:
- remainder_.Tensor
- remainder.Tensor_out
- remainder.Scalar_Tensor
- xlogy.Tensor
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xlogy_stub?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@fengyuan14 fengyuan14 added this pull request to the merge queue Sep 30, 2024
Merged via the queue into main with commit 9d5ed2e Sep 30, 2024
3 checks passed
@fengyuan14 fengyuan14 deleted the trunc branch September 30, 2024 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants