diff --git a/paddle/fluid/framework/new_executor/instruction/phi_kernel_instruction.cc b/paddle/fluid/framework/new_executor/instruction/phi_kernel_instruction.cc index 4121cded08991e293e5aaebabbe7aac0994f8f61..5d6ceb3759f1c8601af3c7e9bc8dd61ad641c09f 100644 --- a/paddle/fluid/framework/new_executor/instruction/phi_kernel_instruction.cc +++ b/paddle/fluid/framework/new_executor/instruction/phi_kernel_instruction.cc @@ -111,6 +111,15 @@ OpFuncType AnalyseOpFuncType(ir::Operation* op, const platform::Place& place) { return OpFuncType::kCpuSync; } + auto kernel_key = op->attributes() + .at("kernel_key") + .dyn_cast() + .data(); + if (phi::TransToPhiPlace(kernel_key.backend()).GetType() == + phi::AllocationType::CPU) { + return OpFuncType::kCpuSync; + } + PADDLE_ENFORCE_EQ(interpreter::IsSupportedHeterPlace(place), true, phi::errors::Fatal("Unsupported current place %s", place));