Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
d5c002f7
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d5c002f7
编写于
4月 22, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
4月 22, 2020
浏览文件
操作
浏览文件
下载
差异文件
!426 add log when opinfo register error
Merge pull request !426 from dengwentao/opinfo_log
上级
4516b8fe
5072ae8f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
19 deletion
+19
-19
mindspore/ccsrc/kernel/oplib/oplib.cc
mindspore/ccsrc/kernel/oplib/oplib.cc
+19
-19
未找到文件。
mindspore/ccsrc/kernel/oplib/oplib.cc
浏览文件 @
d5c002f7
...
...
@@ -83,13 +83,13 @@ bool OpLib::RegOp(const std::string &json_string, const std::string &impl_path)
OpImplyType
imply_type
=
kAICPU
;
ret
=
DecodeOpInfo
(
op_json
,
imply_type
,
impl_path
);
}
else
{
MS_LOG
(
DEBUG
)
<<
"Not support imply_type"
;
MS_LOG
(
ERROR
)
<<
"Not support imply_type"
;
}
if
(
!
ret
)
{
MS_LOG
(
DEBUG
)
<<
"RegOp failed: opname:"
<<
op_name
<<
"imply_type
"
<<
imply_type_string
;
MS_LOG
(
ERROR
)
<<
"RegOp failed: op_name: "
<<
op_name
<<
" imply_type
"
<<
imply_type_string
;
}
}
catch
(
const
std
::
exception
&
e
)
{
MS_LOG
(
DEBUG
)
<<
"get op_json elements failed:
"
<<
e
.
what
();
MS_LOG
(
ERROR
)
<<
"get op json elements failed:
"
<<
e
.
what
();
}
return
ret
;
}
...
...
@@ -122,7 +122,7 @@ bool OpLib::DecodeOpInfo(const nlohmann::json &obj, const mindspore::kernel::OpI
auto
attrs
=
obj
.
at
(
kAttr
);
for
(
const
auto
&
attr
:
attrs
)
{
if
(
!
DecodeAttr
(
attr
,
imply_type
,
op_info
))
{
MS_LOG
(
DEBUG
)
<<
"DecodeAttr Failed"
;
MS_LOG
(
ERROR
)
<<
"DecodeAttr Failed"
;
return
false
;
}
}
...
...
@@ -133,23 +133,23 @@ bool OpLib::DecodeOpInfo(const nlohmann::json &obj, const mindspore::kernel::OpI
auto
inputs
=
obj
.
at
(
kIputs
);
for
(
const
auto
&
input
:
inputs
)
{
if
(
!
DecodeInputOutput
(
input
,
imply_type
,
kInput
,
op_info
,
dtype_format
))
{
MS_LOG
(
DEBUG
)
<<
"DecodeInputOutput Failed"
;
MS_LOG
(
ERROR
)
<<
"DecodeInputOutput Failed"
;
return
false
;
}
}
auto
outputs
=
obj
.
at
(
kOutputs
);
for
(
const
auto
&
output
:
outputs
)
{
if
(
!
DecodeInputOutput
(
output
,
imply_type
,
kOutput
,
op_info
,
dtype_format
))
{
MS_LOG
(
DEBUG
)
<<
"DecodeInputOutput Failed"
;
MS_LOG
(
ERROR
)
<<
"DecodeInputOutput Failed"
;
return
false
;
}
}
if
(
!
GetRefInfo
(
op_info
))
{
MS_LOG
(
DEBUG
)
<<
"GetRefInfo Failed"
;
MS_LOG
(
ERROR
)
<<
"GetRefInfo Failed"
;
return
false
;
}
if
(
!
CheckRepetition
(
op_info
))
{
MS_LOG
(
DEBUG
)
<<
"CheckRepetition Failed"
;
MS_LOG
(
ERROR
)
<<
"CheckRepetition Failed"
;
return
false
;
}
op_info_
.
push_back
(
op_info
);
...
...
@@ -176,7 +176,7 @@ bool OpLib::DecodeAttr(const nlohmann::json &obj, const OpImplyType imply_type,
}
op_info
->
add_attrs_ptr
(
op_attr
);
}
catch
(
const
std
::
exception
&
e
)
{
MS_LOG
(
DEBUG
)
<<
"DecodeAttr failed:"
<<
e
.
what
();
MS_LOG
(
ERROR
)
<<
"DecodeAttr failed:"
<<
e
.
what
();
ret
=
false
;
}
return
ret
;
...
...
@@ -219,8 +219,8 @@ bool OpLib::DecodeInputOutput(const nlohmann::json &obj, const OpImplyType imply
op_io
->
set_formats
(
obj
.
at
(
kFormat
));
}
if
(
op_io
->
dtypes
().
size
()
!=
op_io
->
formats
().
size
())
{
MS_LOG
(
DEBUG
)
<<
"op"
<<
op_io
->
name
()
<<
"dtype size:
"
<<
op_io
->
dtypes
()
<<
"
is not equal to format size:
"
<<
op_io
->
formats
();
MS_LOG
(
ERROR
)
<<
"op "
<<
op_io
->
name
()
<<
" dtype size:
"
<<
op_io
->
dtypes
()
<<
"
is not equal to format size:
"
<<
op_io
->
formats
();
return
false
;
}
if
(
obj
.
find
(
kParamType
)
!=
obj
.
end
())
{
...
...
@@ -244,7 +244,7 @@ bool OpLib::DecodeInputOutput(const nlohmann::json &obj, const OpImplyType imply
op_info
->
add_outputs_ptr
(
op_io
);
}
}
catch
(
const
std
::
exception
&
e
)
{
MS_LOG
(
DEBUG
)
<<
"DecodeInputOutput failed"
<<
e
.
what
();
MS_LOG
(
ERROR
)
<<
"DecodeInputOutput failed"
<<
e
.
what
();
ret
=
false
;
}
return
ret
;
...
...
@@ -256,8 +256,8 @@ std::shared_ptr<OpInfo> OpLib::FindOp(const std::string &op_name, OpImplyType im
bool
is_gpu
=
(
context
->
device_target
()
==
kGPUDevice
);
if
((
is_gpu
&&
(
imply_type
==
kTBE
||
imply_type
==
kAICPU
))
||
(
!
is_gpu
&&
(
imply_type
!=
kTBE
&&
imply_type
!=
kAICPU
)))
{
MS_LOG
(
ERROR
)
<<
"FindOp failed: opname:
"
<<
op_name
<<
", imply_type:
"
<<
ImplTypeToStr
(
imply_type
)
<<
", current op num:"
<<
op_info_
.
size
();
MS_LOG
(
ERROR
)
<<
"FindOp failed: opname:
"
<<
op_name
<<
", imply_type:
"
<<
ImplTypeToStr
(
imply_type
)
<<
", current op num:
"
<<
op_info_
.
size
();
return
nullptr
;
}
for
(
const
auto
&
op_info
:
op_info_
)
{
...
...
@@ -266,8 +266,8 @@ std::shared_ptr<OpInfo> OpLib::FindOp(const std::string &op_name, OpImplyType im
return
op_info
;
}
}
MS_LOG
(
DEBUG
)
<<
"FindOp failed: opname:
"
<<
op_name
<<
", imply_type:
"
<<
ImplTypeToStr
(
imply_type
)
<<
", current op num:"
<<
op_info_
.
size
();
MS_LOG
(
DEBUG
)
<<
"FindOp failed: opname:
"
<<
op_name
<<
", imply_type:
"
<<
ImplTypeToStr
(
imply_type
)
<<
", current op num:
"
<<
op_info_
.
size
();
return
nullptr
;
}
...
...
@@ -281,7 +281,7 @@ bool OpLib::GetRefInfo(const std::shared_ptr<OpInfo> &op_info) {
const
auto
&
in_name
=
input_infos
[
in_index
]
->
name
();
if
(
out_name
==
in_name
)
{
if
(
op_info
->
has_ref_index
(
out_index
))
{
MS_LOG
(
DEBUG
)
<<
"The out_index"
<<
out_index
<<
"
is already in ref_info"
;
MS_LOG
(
ERROR
)
<<
"The out_index "
<<
out_index
<<
"
is already in ref_info"
;
return
false
;
}
op_info
->
add_ref_pair
(
out_index
,
in_index
);
...
...
@@ -299,8 +299,8 @@ bool OpLib::CheckRepetition(const std::shared_ptr<OpInfo> &op_info) {
MS_EXCEPTION_IF_NULL
(
exist_op_info
);
if
(
exist_op_info
->
op_name
()
==
op_info
->
op_name
()
&&
exist_op_info
->
imply_type
()
==
op_info
->
imply_type
()
&&
exist_op_info
->
impl_path
()
!=
op_info
->
impl_path
())
{
MS_LOG
(
DEBUG
)
<<
"Has already exist, drop the latter one, op name:
"
<<
op_info
->
op_name
()
<<
"
op type:
"
<<
ImplTypeToStr
(
op_info
->
imply_type
());
MS_LOG
(
ERROR
)
<<
"Op has already exist, please use other name, op name:
"
<<
op_info
->
op_name
()
<<
"
op type:
"
<<
ImplTypeToStr
(
op_info
->
imply_type
());
return
false
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录