diff --git a/cmake/pten_kernel.cmake b/cmake/pten_kernel.cmake index 23d8ca7dffc8d559b769bbb626b552161f8389fc..947defcea4a61419e9d874428838edacec9cfbac 100644 --- a/cmake/pten_kernel.cmake +++ b/cmake/pten_kernel.cmake @@ -33,8 +33,6 @@ function(kernel_declare TARGET_LIST) file(APPEND ${kernel_declare_file} "PT_DECLARE_KERNEL(${kernel_name}, GPU, ALL_LAYOUT);\n") elseif (${kernel_path} MATCHES "./xpu\/") file(APPEND ${kernel_declare_file} "PT_DECLARE_KERNEL(${kernel_name}, XPU, ALL_LAYOUT);\n") - elseif (${kernel_path} MATCHES "./npu\/*") - file(APPEND ${kernel_declare_file} "PT_DECLARE_KERNEL(${kernel_name}, NPU, ALL_LAYOUT);\n") else () # deal with device independent kernel, now we use CPU temporaary file(APPEND ${kernel_declare_file} "PT_DECLARE_KERNEL(${kernel_name}, CPU, ALL_LAYOUT);\n") @@ -48,7 +46,6 @@ function(kernel_library TARGET) set(cpu_srcs) set(gpu_srcs) set(xpu_srcs) - set(npu_srcs) # parse and save the deps kerenl targets set(all_srcs) set(kernel_deps) @@ -77,11 +74,6 @@ function(kernel_library TARGET) list(APPEND xpu_srcs ${CMAKE_CURRENT_SOURCE_DIR}/xpu/${TARGET}.cc) endif() endif() - if (WITH_ASCEND_CL) - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/npu/${TARGET}.cc) - list(APPEND npu_srcs ${CMAKE_CURRENT_SOURCE_DIR}/npu/${TARGET}.cc) - endif() - endif() else() # TODO(chenweihang): impl compile by source later endif() @@ -107,7 +99,6 @@ function(kernel_library TARGET) list(LENGTH cpu_srcs cpu_srcs_len) list(LENGTH gpu_srcs gpu_srcs_len) list(LENGTH xpu_srcs xpu_srcs_len) - list(LENGTH npu_srcs npu_srcs_len) if (${common_srcs_len} GREATER 0) # If the kernel has a device independent public implementation, @@ -124,7 +115,7 @@ function(kernel_library TARGET) # If the kernel has a header file declaration, but no corresponding # implementation can be found, this is not allowed if (${cpu_srcs_len} EQUAL 0 AND ${gpu_srcs_len} EQUAL 0 AND - ${xpu_srcs_len} EQUAL 0 AND ${npu_srcs_len} EQUAL 0) + ${xpu_srcs_len} EQUAL 0) message(FATAL_ERROR "Cannot find any implementation for ${TARGET}") else() if (WITH_GPU) @@ -136,15 +127,15 @@ function(kernel_library TARGET) hip_library(${TARGET} SRCS ${cpu_srcs} ${gpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps}) endif() else() - if (${cpu_srcs_len} GREATER 0 OR ${xpu_srcs_len} GREATER 0 OR ${npu_srcs_len} GREATER 0) - cc_library(${TARGET} SRCS ${cpu_srcs} ${xpu_srcs} ${npu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps}) + if (${cpu_srcs_len} GREATER 0 OR ${xpu_srcs_len} GREATER 0) + cc_library(${TARGET} SRCS ${cpu_srcs} ${xpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps}) endif() endif() endif() endif() - if (${common_srcs_len} GREATER 0 OR ${cpu_srcs_len} GREATER 0 OR ${gpu_srcs_len} GREATER 0 OR - ${xpu_srcs_len} GREATER 0 OR ${npu_srcs_len} GREATER 0) + if (${common_srcs_len} GREATER 0 OR ${cpu_srcs_len} GREATER 0 OR + ${gpu_srcs_len} GREATER 0 OR ${xpu_srcs_len} GREATER 0) # append target into PTEN_KERNELS property get_property(pten_kernels GLOBAL PROPERTY PTEN_KERNELS) set(pten_kernels ${pten_kernels} ${TARGET}) @@ -166,9 +157,6 @@ function(kernel_library TARGET) if (${xpu_srcs_len} GREATER 0) kernel_declare(${xpu_srcs}) endif() - if (${npu_srcs_len} GREATER 0) - kernel_declare(${npu_srcs}) - endif() endfunction() function(register_kernels) diff --git a/paddle/pten/backends/all_context.h b/paddle/pten/backends/all_context.h index a7cb4abc2f242ec213dfee9cf7e39777ec3cdcb2..8cc07d216c02cf5631624927a7d74c0ce1e77340 100644 --- a/paddle/pten/backends/all_context.h +++ b/paddle/pten/backends/all_context.h @@ -22,7 +22,6 @@ limitations under the License. */ #include "paddle/pten/backends/cpu/cpu_context.h" #include "paddle/pten/backends/gpu/gpu_context.h" -#include "paddle/pten/backends/npu/npu_context.h" #include "paddle/pten/backends/xpu/xpu_context.h" namespace pten { diff --git a/paddle/pten/backends/npu/npu_context.h b/paddle/pten/backends/npu/npu_context.h deleted file mode 100644 index bb17a1bea6df3c958a199b726f7f7679a6d0fcae..0000000000000000000000000000000000000000 --- a/paddle/pten/backends/npu/npu_context.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. */ - -#pragma once - -#ifdef PADDLE_WITH_ASCEND_CL - -// See Note [ Why still include the fluid headers? ] -#include "paddle/fluid/platform/device_context.h" - -namespace pten { -using NPUContext = paddle::platform::NPUDeviceContext; -} // namespace pten - -#endif // PADDLE_WITH_ASCEND_CL diff --git a/paddle/pten/core/kernel_utils.h b/paddle/pten/core/kernel_utils.h index 7a7ae283304bf426145d7fc88f4b6317964eadfd..5087d912ed525d6c0fe3fc6b95ac7b55bf151609 100644 --- a/paddle/pten/core/kernel_utils.h +++ b/paddle/pten/core/kernel_utils.h @@ -183,9 +183,6 @@ struct KernelImpl { #if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) PT_SPECIALIZE_KernelCallHelper_FOR_DEVICE_CONTEXT(GPUContext); #endif -#ifdef PADDLE_WITH_ASCEND_CL - PT_SPECIALIZE_KernelCallHelper_FOR_DEVICE_CONTEXT(NPUContext); -#endif #ifdef PADDLE_WITH_XPU PT_SPECIALIZE_KernelCallHelper_FOR_DEVICE_CONTEXT(XPUContext); #endif diff --git a/paddle/pten/kernels/CMakeLists.txt b/paddle/pten/kernels/CMakeLists.txt index 27d274a5b34ad51663414b9571a465d72a5c8df7..4d72d00a40af1be71739ca52ef49274cbf336925 100644 --- a/paddle/pten/kernels/CMakeLists.txt +++ b/paddle/pten/kernels/CMakeLists.txt @@ -17,9 +17,6 @@ if(WITH_MKLDNN) # mkldnn will be deprecated and use the new name dnnl add_subdirectory(dnnl) endif() -if(WITH_ASCEND_CL) - add_subdirectory(npu) -endif() if(WITH_XPU) add_subdirectory(xpu) endif() diff --git a/paddle/pten/kernels/npu/CMakeLists.txt b/paddle/pten/kernels/npu/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000