Skip to content

Commit

Permalink
[CustomDevice] Allow registration of not ready kernels (PaddlePaddle#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ronny1996 authored and BeingGod committed Sep 9, 2023
1 parent 69a4d30 commit 3ecabe4
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions paddle/phi/core/custom_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

#include "glog/logging.h"

static std::vector<std::string> gpu_exclusive_kernels({"sync_batch_norm",
"sync_batch_norm_grad"});

namespace phi {

void CustomKernelMap::RegisterCustomKernel(const std::string& name,
Expand All @@ -44,16 +41,6 @@ void CustomKernelMap::RegisterCustomKernels() {
}
auto& kernels = KernelFactory::Instance().kernels();
for (auto& pair : kernels_) {
if (kernels.find(pair.first) == kernels.cend()) {
if (std::find(gpu_exclusive_kernels.cbegin(),
gpu_exclusive_kernels.cend(),
pair.first) == gpu_exclusive_kernels.cend()) {
PADDLE_THROW(phi::errors::InvalidArgument(
"The kernel %s is not ready for custom kernel registering.",
pair.first));
}
}

for (auto& info_pair : pair.second) {
PADDLE_ENFORCE_EQ(
kernels[pair.first].find(info_pair.first),
Expand Down

0 comments on commit 3ecabe4

Please sign in to comment.