diff --git a/paddle/fluid/framework/operator.cc b/paddle/fluid/framework/operator.cc index 0fca87df34f5a500a630c7023c11ed50d0f7ec73..83521be98fc172ae5315b9c36177160f37902d39 100644 --- a/paddle/fluid/framework/operator.cc +++ b/paddle/fluid/framework/operator.cc @@ -2103,7 +2103,9 @@ Scope* OperatorWithKernel::PrepareData( auto tensor_backend = phi::TransToPhiBackend(tensor_in->place()); if ((in_def->backend != tensor_backend && (in_def->backend != phi::Backend::GPUDNN || - tensor_backend != phi::Backend::GPU)) || + tensor_backend != phi::Backend::GPU) && + (in_def->backend != phi::Backend::KPS || + tensor_backend != phi::Backend::XPU)) || tensor_in->place().GetType() == AllocationType::GPUPINNED) { new_expected_kernel_key = std::make_unique( expected_kernel_key.data_type_,