Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
6b9a61ea
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看板
提交
6b9a61ea
编写于
7月 22, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
7月 22, 2020
浏览文件
操作
浏览文件
下载
差异文件
!3238 Clean codex
Merge pull request !3238 from caifubi/clean-codex
上级
ee49ee71
e870c3a7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
10 deletion
+22
-10
mindspore/ccsrc/debug/common.cc
mindspore/ccsrc/debug/common.cc
+2
-2
mindspore/ccsrc/debug/data_dump_parser.cc
mindspore/ccsrc/debug/data_dump_parser.cc
+6
-4
mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc
mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc
+10
-0
mindspore/ccsrc/runtime/device/ascend/profiling/profiling_manager.cc
...csrc/runtime/device/ascend/profiling/profiling_manager.cc
+3
-3
mindspore/ccsrc/runtime/device/ascend/profiling/profiling_manager.h
...ccsrc/runtime/device/ascend/profiling/profiling_manager.h
+1
-1
未找到文件。
mindspore/ccsrc/debug/common.cc
浏览文件 @
6b9a61ea
...
...
@@ -80,9 +80,9 @@ bool Common::CreateNotExistDirs(const std::string &path) {
char
tmp_char
=
temp_path
[
i
];
temp_path
[
i
]
=
'\0'
;
std
::
string
path_handle
(
temp_path
);
if
(
!
fs
->
FileExist
(
temp_path
))
{
if
(
!
fs
->
FileExist
(
path_handle
))
{
MS_LOG
(
INFO
)
<<
"Dir "
<<
path_handle
<<
" does not exit, creating..."
;
if
(
!
fs
->
CreateDir
(
temp_path
))
{
if
(
!
fs
->
CreateDir
(
path_handle
))
{
MS_LOG
(
ERROR
)
<<
"Create "
<<
path_handle
<<
" dir error"
;
return
false
;
}
...
...
mindspore/ccsrc/debug/data_dump_parser.cc
浏览文件 @
6b9a61ea
...
...
@@ -34,7 +34,7 @@ void DataDumpParser::ResetParam() {
bool
DataDumpParser
::
DumpEnabled
()
const
{
auto
enable_dump
=
std
::
getenv
(
kEnableDataDump
);
if
(
!
enable_dump
)
{
if
(
enable_dump
==
nullptr
)
{
MS_LOG
(
INFO
)
<<
"[DataDump] enable dump is null. Please export ENABLE_DATA_DUMP"
;
return
false
;
}
...
...
@@ -55,13 +55,15 @@ bool DataDumpParser::DumpEnabled() const {
std
::
optional
<
std
::
string
>
DataDumpParser
::
GetDumpPath
()
const
{
auto
dump_path
=
std
::
getenv
(
kDataDumpPath
);
if
(
!
dump_path
)
{
if
(
dump_path
==
nullptr
)
{
MS_LOG
(
ERROR
)
<<
"[DataDump] dump path is null. Please export DATA_DUMP_PATH"
;
return
{};
}
std
::
string
dump_path_str
(
dump_path
);
if
(
!
std
::
all_of
(
dump_path_str
.
begin
(),
dump_path_str
.
end
(),
::
isalpha
))
{
MS_LOG
(
EXCEPTION
)
<<
"[DataDump] dump path only support alphas, but got:"
<<
dump_path_str
;
if
(
!
std
::
all_of
(
dump_path_str
.
begin
(),
dump_path_str
.
end
(),
[](
char
c
)
{
return
::
isalpha
(
c
)
||
::
isdigit
(
c
)
||
c
==
'-'
||
c
==
'_'
||
c
==
'/'
;
}))
{
MS_LOG
(
EXCEPTION
)
<<
"[DataDump] dump path only support alphabets, digit or {'-', '_', '/'}, but got:"
<<
dump_path_str
;
}
return
dump_path_str
;
}
...
...
mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc
浏览文件 @
6b9a61ea
...
...
@@ -242,6 +242,11 @@ void DumpKernelOutput(const CNodePtr &kernel, void *args, NotNull<aicpu::dump::T
}
output
.
set_original_output_format
(
GetGeFormat
(
output_format
,
output_shape
.
size
()));
output
.
set_address
(
static_cast
<
uint64_t
>
(
reinterpret_cast
<
uintptr_t
>
(
args
))
+
offset
);
// device address data size
auto
address
=
AnfAlgo
::
GetOutputAddr
(
kernel
,
i
);
MS_EXCEPTION_IF_NULL
(
address
);
output
.
set_size
(
address
->
GetSize
());
MS_LOG
(
INFO
)
<<
"[DataDump] output "
<<
i
<<
" address size:"
<<
output
.
size
();
MS_EXCEPTION_IF_NULL
(
task
->
mutable_output
());
task
->
mutable_output
()
->
Add
(
std
::
move
(
output
));
offset
+=
sizeof
(
void
*
);
...
...
@@ -272,6 +277,11 @@ void DumpKernelInput(const CNodePtr &kernel, void *args, NotNull<aicpu::dump::Ta
input
.
mutable_shape
()
->
add_dim
(
dim
);
}
input
.
set_address
(
static_cast
<
uint64_t
>
(
reinterpret_cast
<
uintptr_t
>
(
args
))
+
offset
);
// device address data size
auto
address
=
AnfAlgo
::
GetPrevNodeOutputAddr
(
kernel
,
i
);
MS_EXCEPTION_IF_NULL
(
address
);
input
.
set_size
(
address
->
GetSize
());
MS_LOG
(
INFO
)
<<
"[DataDump] input "
<<
i
<<
" address size:"
<<
input
.
size
();
MS_EXCEPTION_IF_NULL
(
task
->
mutable_input
());
task
->
mutable_input
()
->
Add
(
std
::
move
(
input
));
offset
+=
sizeof
(
void
*
);
...
...
mindspore/ccsrc/runtime/device/ascend/profiling/profiling_manager.cc
浏览文件 @
6b9a61ea
...
...
@@ -144,17 +144,17 @@ bool ProfilingManager::StartupProfiling(uint32_t device_id) {
nlohmann
::
json
startCfg
;
startCfg
[
"startCfg"
]
=
devices
;
if
(
!
ProfStartUp
(
NOT_NULL
(
&
startCfg
)
))
{
if
(
!
ProfStartUp
(
startCfg
))
{
MS_LOG
(
ERROR
)
<<
"ProfMgrStartUp failed."
;
return
false
;
}
return
true
;
}
bool
ProfilingManager
::
ProfStartUp
(
NotNull
<
nlohmann
::
json
*>
startCfg
)
{
bool
ProfilingManager
::
ProfStartUp
(
const
nlohmann
::
json
&
startCfg
)
{
// convert json to string
std
::
stringstream
ss
;
ss
<<
*
startCfg
;
ss
<<
startCfg
;
std
::
string
cfg
=
ss
.
str
();
MS_LOG
(
INFO
)
<<
"profiling config "
<<
cfg
;
auto
ret
=
rtProfilerStart
();
...
...
mindspore/ccsrc/runtime/device/ascend/profiling/profiling_manager.h
浏览文件 @
6b9a61ea
...
...
@@ -49,7 +49,7 @@ class ProfilingManager {
~
ProfilingManager
()
{
prof_handle_
=
nullptr
;
}
private:
bool
ProfStartUp
(
NotNull
<
nlohmann
::
json
*>
json
);
bool
ProfStartUp
(
const
nlohmann
::
json
&
json
);
std
::
shared_ptr
<
ProfilingEngineImpl
>
engine_0_
;
uint32_t
device_id_
;
void
*
prof_handle_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录