Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
f1d56b77
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
f1d56b77
编写于
12月 26, 2021
作者:
C
Chen Weihang
提交者:
GitHub
12月 27, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove npu related impl (#38428)
上级
1fb734d7
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
5 addition
and
50 deletion
+5
-50
cmake/pten_kernel.cmake
cmake/pten_kernel.cmake
+5
-17
paddle/pten/backends/all_context.h
paddle/pten/backends/all_context.h
+0
-1
paddle/pten/backends/npu/npu_context.h
paddle/pten/backends/npu/npu_context.h
+0
-26
paddle/pten/core/kernel_utils.h
paddle/pten/core/kernel_utils.h
+0
-3
paddle/pten/kernels/CMakeLists.txt
paddle/pten/kernels/CMakeLists.txt
+0
-3
paddle/pten/kernels/npu/CMakeLists.txt
paddle/pten/kernels/npu/CMakeLists.txt
+0
-0
未找到文件。
cmake/pten_kernel.cmake
浏览文件 @
f1d56b77
...
...
@@ -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
${
n
pu_srcs_len
}
GREATER 0
)
if
(
${
common_srcs_len
}
GREATER 0 OR
${
cpu_srcs_len
}
GREATER 0 OR
${
gpu_srcs_len
}
GREATER 0 OR
${
x
pu_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
)
...
...
paddle/pten/backends/all_context.h
浏览文件 @
f1d56b77
...
...
@@ -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
{
...
...
paddle/pten/backends/npu/npu_context.h
已删除
100644 → 0
浏览文件 @
1fb734d7
/* 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
paddle/pten/core/kernel_utils.h
浏览文件 @
f1d56b77
...
...
@@ -183,9 +183,6 @@ struct KernelImpl<Return (*)(DevCtx, Args...), kernel_fn> {
#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
...
...
paddle/pten/kernels/CMakeLists.txt
浏览文件 @
f1d56b77
...
...
@@ -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
()
...
...
paddle/pten/kernels/npu/CMakeLists.txt
已删除
100644 → 0
浏览文件 @
1fb734d7
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录