From a454330fe14ecc38915492401b2cd405580dc020 Mon Sep 17 00:00:00 2001 From: lj970926 <1783973490@qq.com> Date: Fri, 10 Nov 2023 16:30:41 +0000 Subject: [PATCH 1/3] bind kernels --- paddle/phi/backends/xpu/xpu2_op_list.cc | 13 ++++++++-- paddle/phi/backends/xpu/xpu3_op_list.cc | 13 ++++++++-- .../phi/kernels/xpu/activation_grad_kernel.cc | 17 ++++++++++++ paddle/phi/kernels/xpu/activation_kernel.cc | 15 +++++++++++ paddle/phi/kernels/xpu/arange_kernel.cc | 20 +++++--------- paddle/phi/kernels/xpu/bitwise.cc | 10 +++++++ .../phi/kernels/xpu/embedding_grad_kernel.cc | 26 ++++++++++++------- 7 files changed, 86 insertions(+), 28 deletions(-) diff --git a/paddle/phi/backends/xpu/xpu2_op_list.cc b/paddle/phi/backends/xpu/xpu2_op_list.cc index 356ed02444d87..a1f8f59b04402 100644 --- a/paddle/phi/backends/xpu/xpu2_op_list.cc +++ b/paddle/phi/backends/xpu/xpu2_op_list.cc @@ -43,6 +43,10 @@ XPUOpMap& get_kl2_ops() { {"adagrad", XPUKernelSet({phi::DataType::FLOAT32})}, {"addcmul_xpu", XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, + {"arange_tensor", + XPUKernelSet({phi::DataType::FLOAT32, + phi::DataType::INT32, + phi::DataType::INT64})}, {"arg_max", XPUKernelSet({phi::DataType::INT32, phi::DataType::FLOAT32, @@ -98,6 +102,7 @@ XPUOpMap& get_kl2_ops() { {"bilinear_interp_v2_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"bitwise_not", XPUKernelSet({phi::DataType::BOOL})}, {"bitwise_and", XPUKernelSet({phi::DataType::BOOL})}, + {"bitwise_or", XPUKernelSet({phi::DataType::BOOL})}, {"broadcast", XPUKernelSet({phi::DataType::FLOAT32})}, {"c_allgather", XPUKernelSet({phi::DataType::FLOAT16, @@ -305,7 +310,8 @@ XPUOpMap& get_kl2_ops() { phi::DataType::FLOAT16, phi::DataType::FLOAT32, phi::DataType::FLOAT64})}, - {"embedding_grad", XPUKernelSet({phi::DataType::FLOAT32})}, + {"embedding_grad", + XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, {"embedding_sparse_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"equal", XPUKernelSet({phi::DataType::INT64, @@ -546,7 +552,8 @@ XPUOpMap& get_kl2_ops() { {"logical_not", XPUKernelSet({phi::DataType::BOOL})}, {"logical_or", XPUKernelSet({phi::DataType::BOOL})}, {"logical_xor", XPUKernelSet({phi::DataType::BOOL})}, - {"lookup_table_v2_grad", XPUKernelSet({phi::DataType::FLOAT32})}, + {"lookup_table_v2_grad", + XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, {"lookup_table_v2", XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, {"masked_select", @@ -715,6 +722,8 @@ XPUOpMap& get_kl2_ops() { {"roi_align_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"roll", XPUKernelSet({phi::DataType::FLOAT32})}, {"roll_grad", XPUKernelSet({phi::DataType::FLOAT32})}, + {"rsqrt", XPUKernelSet({phi::DataType::FLOAT32})}, + {"rsqrt_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"scale", XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16, diff --git a/paddle/phi/backends/xpu/xpu3_op_list.cc b/paddle/phi/backends/xpu/xpu3_op_list.cc index 0ba008a680d7b..67ac15139ebc5 100644 --- a/paddle/phi/backends/xpu/xpu3_op_list.cc +++ b/paddle/phi/backends/xpu/xpu3_op_list.cc @@ -38,6 +38,10 @@ XPUOpMap& get_kl3_ops() { {"adagrad", XPUKernelSet({phi::DataType::FLOAT32})}, {"addcmul_xpu", XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, + {"arange_tensor", + XPUKernelSet({phi::DataType::FLOAT32, + phi::DataType::INT32, + phi::DataType::INT64})}, {"arg_max", XPUKernelSet({phi::DataType::INT32, phi::DataType::FLOAT32, @@ -92,6 +96,7 @@ XPUOpMap& get_kl3_ops() { {"bilinear_interp_v2_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"bitwise_not", XPUKernelSet({phi::DataType::BOOL})}, {"bitwise_and", XPUKernelSet({phi::DataType::BOOL})}, + {"bitwise_or", XPUKernelSet({phi::DataType::BOOL})}, {"broadcast", XPUKernelSet({phi::DataType::FLOAT32})}, {"c_allgather", XPUKernelSet({phi::DataType::FLOAT16, @@ -283,7 +288,8 @@ XPUOpMap& get_kl3_ops() { phi::DataType::FLOAT16, phi::DataType::FLOAT32, phi::DataType::FLOAT64})}, - {"embedding_grad", XPUKernelSet({phi::DataType::FLOAT32})}, + {"embedding_grad", + XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, {"embedding_sparse_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"equal", XPUKernelSet({phi::DataType::INT64, @@ -513,7 +519,8 @@ XPUOpMap& get_kl3_ops() { {"logical_not", XPUKernelSet({phi::DataType::BOOL})}, {"logical_or", XPUKernelSet({phi::DataType::BOOL})}, {"logical_xor", XPUKernelSet({phi::DataType::BOOL})}, - {"lookup_table_v2_grad", XPUKernelSet({phi::DataType::FLOAT32})}, + {"lookup_table_v2_grad", + XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, {"lookup_table_v2", XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, {"masked_select", @@ -675,6 +682,8 @@ XPUOpMap& get_kl3_ops() { {"roi_align_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"roll", XPUKernelSet({phi::DataType::FLOAT32})}, {"roll_grad", XPUKernelSet({phi::DataType::FLOAT32})}, + {"rsqrt", XPUKernelSet({phi::DataType::FLOAT32})}, + {"rsqrt_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"scale", XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16, diff --git a/paddle/phi/kernels/xpu/activation_grad_kernel.cc b/paddle/phi/kernels/xpu/activation_grad_kernel.cc index a1b05366b56be..f9a7e8ed09050 100644 --- a/paddle/phi/kernels/xpu/activation_grad_kernel.cc +++ b/paddle/phi/kernels/xpu/activation_grad_kernel.cc @@ -611,6 +611,21 @@ struct XPUCosGradFunctor : public funcs::BaseActivationFunctor { } }; +template +struct XPURsqrtGradFunctor : public funcs::BaseActivationFunctor { + using XPUType = typename XPUTypeTrait::Type; + template + void operator()(const Context& dev_ctx, + const DenseTensor* x, + const DenseTensor* out, + const DenseTensor* dout, + DenseTensor* dx) const { + int r = xpu_activation_backward( + dev_ctx, x, out, dout, dx, xpu::rsqrt_grad); + PADDLE_ENFORCE_XDNN_SUCCESS(r, "rsqrt_grad"); + } +}; + DEFINE_XPU_ACTIVATION_GRAD_KERNEL_DEPOUT(Exp, XPUExpGradFunctor); DEFINE_XPU_ACTIVATION_GRAD_KERNEL_DEPOUT(Reciprocal, XPUReciprocalGradFunctor); DEFINE_XPU_ACTIVATION_GRAD_KERNEL_DEPOUT(Sigmoid, XPUSigmoidGradFunctor); @@ -618,6 +633,7 @@ DEFINE_XPU_ACTIVATION_GRAD_KERNEL_DEPOUT(Sqrt, XPUSqrtGradFunctor); DEFINE_XPU_ACTIVATION_GRAD_KERNEL_DEPOUT(Tanh, XPUTanhGradFunctor); DEFINE_XPU_ACTIVATION_GRAD_KERNEL_DEPOUT(Relu, XPUReluGradFunctor); DEFINE_XPU_ACTIVATION_GRAD_KERNEL_DEPOUT(Relu6, XPURelu6GradFunctor); +DEFINE_XPU_ACTIVATION_GRAD_KERNEL_DEPOUT(Rsqrt, XPURsqrtGradFunctor); DEFINE_XPU_ACTIVATION_GRAD_KERNEL_DEPX(Log, XPULogGradFunctor); DEFINE_XPU_ACTIVATION_GRAD_KERNEL_DEPX(Square, XPUSquareGradFunctor); @@ -721,5 +737,6 @@ PD_REGISTER_ACTIVATION_GRAD_KERNEL(mish_grad, MishGradKernel) PD_REGISTER_ACTIVATION_GRAD_KERNEL(softplus_grad, SoftplusGradKernel) PD_REGISTER_ACTIVATION_GRAD_KERNEL(sin_grad, SinGradKernel) PD_REGISTER_ACTIVATION_GRAD_KERNEL(cos_grad, CosGradKernel) +PD_REGISTER_ACTIVATION_GRAD_KERNEL(rsqrt_grad, RsqrtGradKernel) PD_REGISTER_KERNEL(pow_grad, XPU, ALL_LAYOUT, phi::PowGradKernel, float) {} diff --git a/paddle/phi/kernels/xpu/activation_kernel.cc b/paddle/phi/kernels/xpu/activation_kernel.cc index 4ab94cd52a4ea..2f6b142205451 100644 --- a/paddle/phi/kernels/xpu/activation_kernel.cc +++ b/paddle/phi/kernels/xpu/activation_kernel.cc @@ -514,6 +514,19 @@ struct XPUCosFunctor : public funcs::BaseActivationFunctor { } }; +template +struct XPURsqrtFunctor : public funcs::BaseActivationFunctor { + using XPUType = typename XPUTypeTrait::Type; + template + void operator()(const Context& dev_ctx, + const DenseTensor& x, + DenseTensor* out) const { + int ret = xpu_activation_func( + dev_ctx, x, out, xpu::rsqrt); + PADDLE_ENFORCE_XDNN_SUCCESS(ret, "rsqrt"); + } +}; + DEFINE_XPU_ACTIVATION_KERNEL(Exp, XPUExpFunctor) DEFINE_XPU_ACTIVATION_KERNEL(Floor, XPUFloorFunctor) DEFINE_XPU_ACTIVATION_KERNEL(Log, XPULogFunctor) @@ -526,6 +539,7 @@ DEFINE_XPU_ACTIVATION_KERNEL(Tanh, XPUTanhFunctor) DEFINE_XPU_ACTIVATION_KERNEL(Silu, XPUSiluFunctor) DEFINE_XPU_ACTIVATION_KERNEL(Sin, XPUSinFunctor) DEFINE_XPU_ACTIVATION_KERNEL(Cos, XPUCosFunctor) +DEFINE_XPU_ACTIVATION_KERNEL(Rsqrt, XPURsqrtFunctor) DEFINE_XPU_ACTIVATION_KERNEL_WITH_ONE_ATTRS(Mish, XPUMishFunctor, threshold) DEFINE_XPU_ACTIVATION_KERNEL_WITH_ONE_ATTRS(LeakyRelu, @@ -617,3 +631,4 @@ PD_REGISTER_ACTIVATION_KERNEL(reciprocal, ReciprocalKernel) PD_REGISTER_ACTIVATION_KERNEL(softplus, SoftplusKernel) PD_REGISTER_ACTIVATION_KERNEL(sin, SinKernel) PD_REGISTER_ACTIVATION_KERNEL(cos, CosKernel) +PD_REGISTER_ACTIVATION_KERNEL(rsqrt, RsqrtKernel) diff --git a/paddle/phi/kernels/xpu/arange_kernel.cc b/paddle/phi/kernels/xpu/arange_kernel.cc index af3abc19aaddc..7afdfcd60daf8 100644 --- a/paddle/phi/kernels/xpu/arange_kernel.cc +++ b/paddle/phi/kernels/xpu/arange_kernel.cc @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "paddle/phi/kernels/arange_kernel.h" +#include "paddle/phi/backends/xpu/enforce_xpu.h" #include "paddle/phi/core/kernel_registry.h" #include "paddle/phi/kernels/funcs/range_function.h" @@ -32,19 +33,11 @@ void ArangeTensorKernel(const Context& dev_ctx, int64_t size = 0; phi::funcs::GetSize(start_value, end_value, step_value, &size); out->Resize(phi::make_ddim({size})); - dev_ctx.template Alloc(out); - - DenseTensor out_cpu; - out_cpu.Resize({out->numel()}); - dev_ctx.template HostAlloc(&out_cpu); - T* out_cpu_data = out_cpu.data(); - - T value = start_value; - for (int64_t i = 0; i < size; ++i) { - out_cpu_data[i] = value; - value += step_value; - } - phi::Copy(dev_ctx, out_cpu, out->place(), true, out); + auto* out_data = dev_ctx.template Alloc(out); + + int ret = xpu::range( + dev_ctx.x_context(), out_data, start_value, step_value, size); + PADDLE_ENFORCE_XDNN_SUCCESS(ret, "range"); } } // namespace phi @@ -54,7 +47,6 @@ PD_REGISTER_KERNEL(arange_tensor, ALL_LAYOUT, phi::ArangeTensorKernel, float, - double, int, int64_t) { kernel->InputAt(0).SetBackend(phi::Backend::ALL_BACKEND); diff --git a/paddle/phi/kernels/xpu/bitwise.cc b/paddle/phi/kernels/xpu/bitwise.cc index 80cdd87c5a121..dee96be39e185 100644 --- a/paddle/phi/kernels/xpu/bitwise.cc +++ b/paddle/phi/kernels/xpu/bitwise.cc @@ -44,7 +44,17 @@ void BitwiseAndKernel(const Context& ctx, // counterpart. Need to be changed when adding support to other types. LogicalAndKernel(ctx, x, y, out); } + +template +void BitwiseOrKernel(const Context& ctx, + const DenseTensor& x, + const DenseTensor& y, + DenseTensor* out) { + // Same reason as bitwise_and + LogicalOrKernel(ctx, x, y, out); +} } // namespace phi PD_REGISTER_KERNEL(bitwise_not, XPU, ALL_LAYOUT, phi::BitwiseNotKernel, bool) {} PD_REGISTER_KERNEL(bitwise_and, XPU, ALL_LAYOUT, phi::BitwiseAndKernel, bool) {} +PD_REGISTER_KERNEL(bitwise_or, XPU, ALL_LAYOUT, phi::BitwiseOrKernel, bool) {} diff --git a/paddle/phi/kernels/xpu/embedding_grad_kernel.cc b/paddle/phi/kernels/xpu/embedding_grad_kernel.cc index 09497daa7cd2f..b6e280fbb4d0f 100644 --- a/paddle/phi/kernels/xpu/embedding_grad_kernel.cc +++ b/paddle/phi/kernels/xpu/embedding_grad_kernel.cc @@ -28,6 +28,7 @@ void EmbeddingGradKernel(const Context& ctx, const DenseTensor& out_grad, int64_t padding_idx, DenseTensor* weight_grad) { + using XPUT = typename XPUTypeTrait::Type; DDim table_dim; table_dim = weight.dims(); @@ -62,14 +63,15 @@ void EmbeddingGradKernel(const Context& ctx, int ym = static_cast(ids_numel); int n = d_table_t->dims()[1]; - int r = xpu::embedding_grad(dev_ctx.x_context(), - d_output_data, - ids_data, - d_table_data, - xm, - n, - ym, - padding_idx); + int r = xpu::embedding_grad( + dev_ctx.x_context(), + reinterpret_cast(d_output_data), + ids_data, + reinterpret_cast(d_table_data), + xm, + n, + ym, + padding_idx); PADDLE_ENFORCE_XDNN_SUCCESS(r, "embedding_grad"); } @@ -148,8 +150,12 @@ void EmbeddingSparseGradKernel(const Context& ctx, } } // namespace phi -PD_REGISTER_KERNEL( - embedding_grad, XPU, ALL_LAYOUT, phi::EmbeddingGradKernel, float) {} +PD_REGISTER_KERNEL(embedding_grad, + XPU, + ALL_LAYOUT, + phi::EmbeddingGradKernel, + float, + phi::dtype::float16) {} PD_REGISTER_KERNEL(embedding_sparse_grad, XPU, ALL_LAYOUT, From ec5a9265f7879c0d22e45d897ea4a29b2202c65c Mon Sep 17 00:00:00 2001 From: lj970926 <1783973490@qq.com> Date: Mon, 13 Nov 2023 08:29:09 +0000 Subject: [PATCH 2/3] add tests --- paddle/phi/backends/xpu/xpu2_op_list.cc | 3 +- paddle/phi/backends/xpu/xpu3_op_list.cc | 3 +- .../phi/kernels/xpu/embedding_grad_kernel.cc | 8 +--- test/xpu/test_activation_op_xpu.py | 46 +++++++++++++++++++ 4 files changed, 50 insertions(+), 10 deletions(-) diff --git a/paddle/phi/backends/xpu/xpu2_op_list.cc b/paddle/phi/backends/xpu/xpu2_op_list.cc index a1f8f59b04402..833ff7dc3067e 100644 --- a/paddle/phi/backends/xpu/xpu2_op_list.cc +++ b/paddle/phi/backends/xpu/xpu2_op_list.cc @@ -310,8 +310,7 @@ XPUOpMap& get_kl2_ops() { phi::DataType::FLOAT16, phi::DataType::FLOAT32, phi::DataType::FLOAT64})}, - {"embedding_grad", - XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, + {"embedding_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"embedding_sparse_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"equal", XPUKernelSet({phi::DataType::INT64, diff --git a/paddle/phi/backends/xpu/xpu3_op_list.cc b/paddle/phi/backends/xpu/xpu3_op_list.cc index 67ac15139ebc5..f55848de39ada 100644 --- a/paddle/phi/backends/xpu/xpu3_op_list.cc +++ b/paddle/phi/backends/xpu/xpu3_op_list.cc @@ -288,8 +288,7 @@ XPUOpMap& get_kl3_ops() { phi::DataType::FLOAT16, phi::DataType::FLOAT32, phi::DataType::FLOAT64})}, - {"embedding_grad", - XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, + {"embedding_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"embedding_sparse_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"equal", XPUKernelSet({phi::DataType::INT64, diff --git a/paddle/phi/kernels/xpu/embedding_grad_kernel.cc b/paddle/phi/kernels/xpu/embedding_grad_kernel.cc index b6e280fbb4d0f..57cb91664e4ef 100644 --- a/paddle/phi/kernels/xpu/embedding_grad_kernel.cc +++ b/paddle/phi/kernels/xpu/embedding_grad_kernel.cc @@ -150,12 +150,8 @@ void EmbeddingSparseGradKernel(const Context& ctx, } } // namespace phi -PD_REGISTER_KERNEL(embedding_grad, - XPU, - ALL_LAYOUT, - phi::EmbeddingGradKernel, - float, - phi::dtype::float16) {} +PD_REGISTER_KERNEL( + embedding_grad, XPU, ALL_LAYOUT, phi::EmbeddingGradKernel, float) {} PD_REGISTER_KERNEL(embedding_sparse_grad, XPU, ALL_LAYOUT, diff --git a/test/xpu/test_activation_op_xpu.py b/test/xpu/test_activation_op_xpu.py index 52a42cb4c3779..b754b431fa103 100644 --- a/test/xpu/test_activation_op_xpu.py +++ b/test/xpu/test_activation_op_xpu.py @@ -1373,5 +1373,51 @@ def init_config(self): for stype in support_types: create_test_class(globals(), XPUTestCosOP, stype) + +class XPUTestRsqrtOP(XPUOpTestWrapper): + def __init__(self): + self.op_name = "rsqrt" + self.use_dynamic_create_class = False + + class XPUTestRsqrtBase(TestActivationOPBase): + def set_case(self): + self.op_type = "rsqrt" + self.dtype = self.in_type + self.init_config() + out = np.reciprocal(np.sqrt(self.x)) + + self.inputs = {'X': self.x} + self.outputs = {'Out': out} + self.attrs = {'use_xpu': True} + + def init_config(self): + self.x = np.random.uniform(0.01, 4, [11, 17]).astype(self.dtype) + + class XPUTestRsqrt_ZeroDim(XPUTestRsqrtBase): + def init_config(self): + self.x = np.random.uniform(0.01, 4, []).astype(self.dtype) + + class XPUTestRsqrt2(XPUTestRsqrtBase): + def init_config(self): + self.x = np.random.uniform(0.01, 4, [1024, 8]).astype(self.dtype) + + class XPUTestRsqrt3(XPUTestRsqrtBase): + def init_config(self): + self.x = np.random.uniform(0.01, 4, [4, 512, 15, 15]).astype( + self.dtype + ) + + class XPUTestRsqrt4(XPUTestRsqrtBase): + def init_config(self): + self.x = np.random.uniform(0.01, 4, [4, 256, 22, 22]).astype( + self.dtype + ) + + +support_types = get_xpu_op_support_types('rsqrt') +for stype in support_types: + create_test_class(globals(), XPUTestRsqrtOP, stype) + + if __name__ == "__main__": unittest.main() From 0889feb7e173f884c25bee56da404303d014842d Mon Sep 17 00:00:00 2001 From: lj970926 <1783973490@qq.com> Date: Mon, 13 Nov 2023 08:31:46 +0000 Subject: [PATCH 3/3] bugfix --- paddle/phi/backends/xpu/xpu2_op_list.cc | 3 +-- paddle/phi/backends/xpu/xpu3_op_list.cc | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/paddle/phi/backends/xpu/xpu2_op_list.cc b/paddle/phi/backends/xpu/xpu2_op_list.cc index 833ff7dc3067e..6ad6dfbd574e7 100644 --- a/paddle/phi/backends/xpu/xpu2_op_list.cc +++ b/paddle/phi/backends/xpu/xpu2_op_list.cc @@ -551,8 +551,7 @@ XPUOpMap& get_kl2_ops() { {"logical_not", XPUKernelSet({phi::DataType::BOOL})}, {"logical_or", XPUKernelSet({phi::DataType::BOOL})}, {"logical_xor", XPUKernelSet({phi::DataType::BOOL})}, - {"lookup_table_v2_grad", - XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, + {"lookup_table_v2_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"lookup_table_v2", XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, {"masked_select", diff --git a/paddle/phi/backends/xpu/xpu3_op_list.cc b/paddle/phi/backends/xpu/xpu3_op_list.cc index f55848de39ada..9b555ead477d1 100644 --- a/paddle/phi/backends/xpu/xpu3_op_list.cc +++ b/paddle/phi/backends/xpu/xpu3_op_list.cc @@ -518,8 +518,7 @@ XPUOpMap& get_kl3_ops() { {"logical_not", XPUKernelSet({phi::DataType::BOOL})}, {"logical_or", XPUKernelSet({phi::DataType::BOOL})}, {"logical_xor", XPUKernelSet({phi::DataType::BOOL})}, - {"lookup_table_v2_grad", - XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, + {"lookup_table_v2_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"lookup_table_v2", XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, {"masked_select",