diff --git a/paddle/fluid/operators/reduce_ops/reduce_max_op_xpu.cc b/paddle/fluid/operators/reduce_ops/reduce_max_op_xpu.cc index 15d672da04bec5fa581c04fee9d3854b1cf61633..1c1269a08dbdc3d680dafb8494bf8b02f6f67416 100644 --- a/paddle/fluid/operators/reduce_ops/reduce_max_op_xpu.cc +++ b/paddle/fluid/operators/reduce_ops/reduce_max_op_xpu.cc @@ -105,11 +105,10 @@ class ReduceMaxGradXPUKernel : public framework::OpKernel { " wrong value[%d %s].", r, XPUAPIErrorMsg[r])); // step 2. comparse out_brocast and x - r = xpu::elementwise_equal(dev_ctx.x_context(), x_data, brocast1, equal, - x->numel()); + r = xpu::equal(dev_ctx.x_context(), x_data, brocast1, equal, x->numel()); PADDLE_ENFORCE_EQ( r == xpu::Error_t::SUCCESS, true, - platform::errors::External("XPU elementwise_equal in reduce_max_grad " + platform::errors::External("XPU equal in reduce_max_grad " "op return wrong value[%d %s].", r, XPUAPIErrorMsg[r])); // step 3. get x_grad diff --git a/paddle/fluid/platform/device/xpu/xpu2_op_list.h b/paddle/fluid/platform/device/xpu/xpu2_op_list.h index 357644b62d3ed3a37584ffdda611dceeb1d43404..583014b6f477361eefa6dbca5b5daf6f99fdf042 100644 --- a/paddle/fluid/platform/device/xpu/xpu2_op_list.h +++ b/paddle/fluid/platform/device/xpu/xpu2_op_list.h @@ -57,6 +57,9 @@ XPUOpMap& get_kl2_ops() { pOpKernelType(vartype::BOOL, XPUPlace()), pOpKernelType(vartype::INT64, XPUPlace()), pOpKernelType(vartype::INT32, XPUPlace())})}, + {"check_finite_and_unscale", + XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace()), + pOpKernelType(vartype::FP16, XPUPlace())})}, {"clip", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})}, {"concat_grad", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace()), pOpKernelType(vartype::FP16, XPUPlace())})},