Skip to content

Commit 0942bcf

Browse files
authored
[XPU] fix registration of elementwise_add (#60252)
1 parent 8f4c811 commit 0942bcf

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

paddle/phi/backends/xpu/xpu3_op_list.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ XPUOpMap& get_kl3_ops() {
256256
{"elementwise_add_grad",
257257
XPUKernelSet({phi::DataType::FLOAT32,
258258
phi::DataType::FLOAT16,
259-
phi::DataType::BFLOAT16})},
259+
phi::DataType::BFLOAT16,
260+
phi::DataType::INT64,
261+
phi::DataType::INT32})},
260262
{"elementwise_add",
261263
XPUKernelSet({phi::DataType::FLOAT32,
262264
phi::DataType::FLOAT16,

paddle/phi/kernels/legacy/xpu/elementwise_add_kernel.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ PD_REGISTER_KERNEL(add_raw,
5555
ALL_LAYOUT,
5656
phi::AddRawKernel,
5757
phi::dtype::float16,
58+
phi::dtype::bfloat16,
5859
float,
5960
int,
6061
int64_t) {}

paddle/phi/kernels/xpu/elementwise_add_grad_kernel.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,7 @@ PD_REGISTER_KERNEL(add_grad,
104104
ALL_LAYOUT,
105105
phi::AddGradKernel,
106106
phi::dtype::float16,
107+
phi::dtype::bfloat16,
107108
float,
108-
phi::dtype::bfloat16) {}
109+
int,
110+
int64_t) {}

0 commit comments

Comments
 (0)