Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
8601859e
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2297
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
8601859e
编写于
4月 14, 2023
作者:
J
jjyaoao
提交者:
GitHub
4月 14, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete SupportNPU(), SupportMLU() (#52911)
* delete SupportNPU(), SupportMLU() * delete npu branch
上级
468869e4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
0 addition
and
56 deletion
+0
-56
paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc
...id/framework/new_executor/interpreter/interpreter_util.cc
+0
-15
paddle/fluid/framework/operator.cc
paddle/fluid/framework/operator.cc
+0
-27
paddle/fluid/framework/operator.h
paddle/fluid/framework/operator.h
+0
-14
未找到文件。
paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc
浏览文件 @
8601859e
...
...
@@ -385,21 +385,6 @@ void ApplyDeviceGuard(const OperatorBase* op_base,
}
VLOG
(
3
)
<<
"Switch into "
<<
expected_kernel_key
->
place_
<<
" by device_guard."
;
}
else
if
(
op_device
.
find
(
"npu"
)
!=
std
::
string
::
npos
&&
platform
::
is_npu_place
(
place
))
{
// when the Op that does not have NPUKernel is assigned to NPU, the
// CPUKernel will be executed and a warning will be given at the same
// time.
if
(
op_base
->
SupportNPU
())
{
expected_kernel_key
->
place_
=
place
;
}
else
{
expected_kernel_key
->
place_
=
platform
::
CPUPlace
();
LOG_FIRST_N
(
WARNING
,
1
)
<<
"Op("
<<
op_base
->
Type
()
<<
") has no NPU implementation. It will be assigned to CPUPlace."
;
}
VLOG
(
3
)
<<
"Switch into "
<<
expected_kernel_key
->
place_
<<
" by device_guard."
;
}
else
if
(
op_device
.
find
(
"xpu"
)
!=
std
::
string
::
npos
&&
platform
::
is_xpu_place
(
place
))
{
// when the Op that does not have XPUKernel is assigned to XPU, the
...
...
paddle/fluid/framework/operator.cc
浏览文件 @
8601859e
...
...
@@ -1326,33 +1326,6 @@ bool OperatorWithKernel::SupportGPU() const {
}
}
bool
OperatorWithKernel
::
SupportNPU
()
const
{
auto
phi_kernels
=
phi
::
KernelFactory
::
Instance
().
SelectKernelMap
(
phi
::
TransToPhiKernelName
(
type_
));
auto
has_phi_kernel
=
std
::
any_of
(
phi_kernels
.
begin
(),
phi_kernels
.
end
(),
[](
phi
::
KernelKeyMap
::
const_reference
kern_pair
)
{
return
kern_pair
.
first
.
backend
()
==
phi
::
Backend
::
NPU
;
});
if
(
has_phi_kernel
)
{
return
true
;
}
else
{
auto
kernel_iter
=
OperatorWithKernel
::
AllOpKernels
().
find
(
type_
);
if
(
kernel_iter
==
OperatorWithKernel
::
AllOpKernels
().
end
())
{
return
false
;
}
else
{
auto
&
op_kernels
=
kernel_iter
->
second
;
return
std
::
any_of
(
op_kernels
.
begin
(),
op_kernels
.
end
(),
[](
OpKernelMap
::
const_reference
kern_pair
)
{
return
platform
::
is_npu_place
(
kern_pair
.
first
.
place_
);
});
}
}
}
bool
OperatorWithKernel
::
SupportXPU
()
const
{
#ifdef PADDLE_WITH_XPU
auto
phi_kernels
=
phi
::
KernelFactory
::
Instance
().
SelectKernelMap
(
...
...
paddle/fluid/framework/operator.h
浏览文件 @
8601859e
...
...
@@ -285,8 +285,6 @@ class OperatorBase {
std
::
string
DebugString
()
const
{
return
DebugStringEx
(
nullptr
);
}
virtual
bool
SupportGPU
()
const
{
return
false
;
}
virtual
bool
SupportNPU
()
const
{
return
false
;
}
virtual
bool
SupportMLU
()
const
{
return
false
;
}
virtual
bool
SupportXPU
()
const
{
return
false
;
}
const
std
::
string
&
Type
()
const
{
return
type_
;
}
...
...
@@ -746,18 +744,6 @@ class OperatorWithKernel : public OperatorBase {
bool
SupportGPU
()
const
override
;
bool
SupportNPU
()
const
override
;
bool
SupportMLU
()
const
override
{
// TODO(zhiqiu): support phi if needed?
auto
&
op_kernels
=
OperatorWithKernel
::
AllOpKernels
().
at
(
type_
);
return
std
::
any_of
(
op_kernels
.
begin
(),
op_kernels
.
end
(),
[](
OpKernelMap
::
const_reference
kern_pair
)
{
return
platform
::
is_mlu_place
(
kern_pair
.
first
.
place_
);
});
}
bool
SupportXPU
()
const
override
;
bool
SupportsMKLDNN
(
phi
::
DataType
data_type
)
const
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录