未验证 提交 f1d56b77 编写于 作者: C Chen Weihang 提交者: GitHub

remove npu related impl (#38428)

上级 1fb734d7
...@@ -33,8 +33,6 @@ function(kernel_declare TARGET_LIST) ...@@ -33,8 +33,6 @@ function(kernel_declare TARGET_LIST)
file(APPEND ${kernel_declare_file} "PT_DECLARE_KERNEL(${kernel_name}, GPU, ALL_LAYOUT);\n") file(APPEND ${kernel_declare_file} "PT_DECLARE_KERNEL(${kernel_name}, GPU, ALL_LAYOUT);\n")
elseif (${kernel_path} MATCHES "./xpu\/") elseif (${kernel_path} MATCHES "./xpu\/")
file(APPEND ${kernel_declare_file} "PT_DECLARE_KERNEL(${kernel_name}, XPU, ALL_LAYOUT);\n") 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 () else ()
# deal with device independent kernel, now we use CPU temporaary # deal with device independent kernel, now we use CPU temporaary
file(APPEND ${kernel_declare_file} "PT_DECLARE_KERNEL(${kernel_name}, CPU, ALL_LAYOUT);\n") file(APPEND ${kernel_declare_file} "PT_DECLARE_KERNEL(${kernel_name}, CPU, ALL_LAYOUT);\n")
...@@ -48,7 +46,6 @@ function(kernel_library TARGET) ...@@ -48,7 +46,6 @@ function(kernel_library TARGET)
set(cpu_srcs) set(cpu_srcs)
set(gpu_srcs) set(gpu_srcs)
set(xpu_srcs) set(xpu_srcs)
set(npu_srcs)
# parse and save the deps kerenl targets # parse and save the deps kerenl targets
set(all_srcs) set(all_srcs)
set(kernel_deps) set(kernel_deps)
...@@ -77,11 +74,6 @@ function(kernel_library TARGET) ...@@ -77,11 +74,6 @@ function(kernel_library TARGET)
list(APPEND xpu_srcs ${CMAKE_CURRENT_SOURCE_DIR}/xpu/${TARGET}.cc) list(APPEND xpu_srcs ${CMAKE_CURRENT_SOURCE_DIR}/xpu/${TARGET}.cc)
endif() endif()
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() else()
# TODO(chenweihang): impl compile by source later # TODO(chenweihang): impl compile by source later
endif() endif()
...@@ -107,7 +99,6 @@ function(kernel_library TARGET) ...@@ -107,7 +99,6 @@ function(kernel_library TARGET)
list(LENGTH cpu_srcs cpu_srcs_len) list(LENGTH cpu_srcs cpu_srcs_len)
list(LENGTH gpu_srcs gpu_srcs_len) list(LENGTH gpu_srcs gpu_srcs_len)
list(LENGTH xpu_srcs xpu_srcs_len) list(LENGTH xpu_srcs xpu_srcs_len)
list(LENGTH npu_srcs npu_srcs_len)
if (${common_srcs_len} GREATER 0) if (${common_srcs_len} GREATER 0)
# If the kernel has a device independent public implementation, # If the kernel has a device independent public implementation,
...@@ -124,7 +115,7 @@ function(kernel_library TARGET) ...@@ -124,7 +115,7 @@ function(kernel_library TARGET)
# If the kernel has a header file declaration, but no corresponding # If the kernel has a header file declaration, but no corresponding
# implementation can be found, this is not allowed # implementation can be found, this is not allowed
if (${cpu_srcs_len} EQUAL 0 AND ${gpu_srcs_len} EQUAL 0 AND 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}") message(FATAL_ERROR "Cannot find any implementation for ${TARGET}")
else() else()
if (WITH_GPU) if (WITH_GPU)
...@@ -136,15 +127,15 @@ function(kernel_library TARGET) ...@@ -136,15 +127,15 @@ function(kernel_library TARGET)
hip_library(${TARGET} SRCS ${cpu_srcs} ${gpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps}) hip_library(${TARGET} SRCS ${cpu_srcs} ${gpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
endif() endif()
else() else()
if (${cpu_srcs_len} GREATER 0 OR ${xpu_srcs_len} GREATER 0 OR ${npu_srcs_len} GREATER 0) if (${cpu_srcs_len} GREATER 0 OR ${xpu_srcs_len} GREATER 0)
cc_library(${TARGET} SRCS ${cpu_srcs} ${xpu_srcs} ${npu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps}) cc_library(${TARGET} SRCS ${cpu_srcs} ${xpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
endif() endif()
endif() endif()
endif() endif()
endif() endif()
if (${common_srcs_len} GREATER 0 OR ${cpu_srcs_len} GREATER 0 OR ${gpu_srcs_len} GREATER 0 OR if (${common_srcs_len} GREATER 0 OR ${cpu_srcs_len} GREATER 0 OR
${xpu_srcs_len} GREATER 0 OR ${npu_srcs_len} GREATER 0) ${gpu_srcs_len} GREATER 0 OR ${xpu_srcs_len} GREATER 0)
# append target into PTEN_KERNELS property # append target into PTEN_KERNELS property
get_property(pten_kernels GLOBAL PROPERTY PTEN_KERNELS) get_property(pten_kernels GLOBAL PROPERTY PTEN_KERNELS)
set(pten_kernels ${pten_kernels} ${TARGET}) set(pten_kernels ${pten_kernels} ${TARGET})
...@@ -166,9 +157,6 @@ function(kernel_library TARGET) ...@@ -166,9 +157,6 @@ function(kernel_library TARGET)
if (${xpu_srcs_len} GREATER 0) if (${xpu_srcs_len} GREATER 0)
kernel_declare(${xpu_srcs}) kernel_declare(${xpu_srcs})
endif() endif()
if (${npu_srcs_len} GREATER 0)
kernel_declare(${npu_srcs})
endif()
endfunction() endfunction()
function(register_kernels) function(register_kernels)
......
...@@ -22,7 +22,6 @@ limitations under the License. */ ...@@ -22,7 +22,6 @@ limitations under the License. */
#include "paddle/pten/backends/cpu/cpu_context.h" #include "paddle/pten/backends/cpu/cpu_context.h"
#include "paddle/pten/backends/gpu/gpu_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" #include "paddle/pten/backends/xpu/xpu_context.h"
namespace pten { namespace pten {
......
/* 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
...@@ -183,9 +183,6 @@ struct KernelImpl<Return (*)(DevCtx, Args...), kernel_fn> { ...@@ -183,9 +183,6 @@ struct KernelImpl<Return (*)(DevCtx, Args...), kernel_fn> {
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) #if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
PT_SPECIALIZE_KernelCallHelper_FOR_DEVICE_CONTEXT(GPUContext); PT_SPECIALIZE_KernelCallHelper_FOR_DEVICE_CONTEXT(GPUContext);
#endif #endif
#ifdef PADDLE_WITH_ASCEND_CL
PT_SPECIALIZE_KernelCallHelper_FOR_DEVICE_CONTEXT(NPUContext);
#endif
#ifdef PADDLE_WITH_XPU #ifdef PADDLE_WITH_XPU
PT_SPECIALIZE_KernelCallHelper_FOR_DEVICE_CONTEXT(XPUContext); PT_SPECIALIZE_KernelCallHelper_FOR_DEVICE_CONTEXT(XPUContext);
#endif #endif
......
...@@ -17,9 +17,6 @@ if(WITH_MKLDNN) ...@@ -17,9 +17,6 @@ if(WITH_MKLDNN)
# mkldnn will be deprecated and use the new name dnnl # mkldnn will be deprecated and use the new name dnnl
add_subdirectory(dnnl) add_subdirectory(dnnl)
endif() endif()
if(WITH_ASCEND_CL)
add_subdirectory(npu)
endif()
if(WITH_XPU) if(WITH_XPU)
add_subdirectory(xpu) add_subdirectory(xpu)
endif() endif()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册