Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
Mace
提交
4937a2ef
Mace
项目概览
慢慢CG
/
Mace
与 Fork 源项目一致
Fork自
Xiaomi / Mace
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Mace
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
4937a2ef
编写于
3月 12, 2018
作者:
李
李寅
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add stress (restart) test
上级
f6ccc534
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
9 deletion
+16
-9
mace_tools.py
mace_tools.py
+11
-7
tuning_run.sh
tuning_run.sh
+5
-2
未找到文件。
mace_tools.py
浏览文件 @
4937a2ef
...
...
@@ -80,9 +80,9 @@ def build_mace_run(production_mode, model_output_dir, hexagon_mode):
run_command
(
command
)
def
tuning_run
(
model_output_dir
,
running_round
,
tuning
,
production_mode
):
command
=
"bash tools/tuning_run.sh {} {} {} {}"
.
format
(
model_output_dir
,
running_round
,
int
(
tuning
),
int
(
production_mode
))
def
tuning_run
(
model_output_dir
,
running_round
,
tuning
,
production_mode
,
restart_round
):
command
=
"bash tools/tuning_run.sh {} {} {} {}
{}
"
.
format
(
model_output_dir
,
running_round
,
int
(
tuning
),
int
(
production_mode
)
,
restart_round
)
run_command
(
command
)
...
...
@@ -91,8 +91,8 @@ def benchmark_model(model_output_dir):
run_command
(
command
)
def
run_model
(
model_output_dir
,
running_round
):
tuning_run
(
model_output_dir
,
running_round
,
False
,
False
)
def
run_model
(
model_output_dir
,
running_round
,
restart_round
):
tuning_run
(
model_output_dir
,
running_round
,
False
,
False
,
restart_round
)
def
generate_production_code
(
model_output_dirs
,
pull_or_not
):
...
...
@@ -117,7 +117,8 @@ def build_mace_run_prod(model_output_dir, tuning, libmace_name):
model_output_dir
,
running_round
=
0
,
tuning
=
tuning
,
production_mode
=
production_or_not
)
production_mode
=
production_or_not
,
restart_round
=
1
)
production_or_not
=
True
pull_or_not
=
True
...
...
@@ -175,6 +176,8 @@ def parse_args():
"--round"
,
type
=
int
,
default
=
1
,
help
=
"The model running round."
)
parser
.
add_argument
(
"--run_seconds"
,
type
=
int
,
default
=
10
,
help
=
"The model throughput test running seconds."
)
parser
.
add_argument
(
"--restart_round"
,
type
=
int
,
default
=
1
,
help
=
"The model restart round."
)
parser
.
add_argument
(
"--tuning"
,
type
=
"bool"
,
default
=
"true"
,
help
=
"Tune opencl params."
)
parser
.
add_argument
(
"--mode"
,
type
=
str
,
default
=
"all"
,
...
...
@@ -194,6 +197,7 @@ def main(unused_args):
if
FLAGS
.
mode
==
"validate"
:
FLAGS
.
round
=
1
FLAGS
.
restart_round
=
1
# target_abi = configs["target_abi"]
# libmace_name = get_libs(target_abi, configs)
...
...
@@ -252,7 +256,7 @@ def main(unused_args):
build_mace_run_prod
(
model_output_dir
,
FLAGS
.
tuning
,
libmace_name
)
if
FLAGS
.
mode
==
"run"
or
FLAGS
.
mode
==
"validate"
or
FLAGS
.
mode
==
"all"
:
run_model
(
model_output_dir
,
FLAGS
.
round
)
run_model
(
model_output_dir
,
FLAGS
.
round
,
FLAGS
.
restart_round
)
if
FLAGS
.
mode
==
"benchmark"
:
benchmark_model
(
model_output_dir
)
...
...
tuning_run.sh
浏览文件 @
4937a2ef
...
...
@@ -16,6 +16,7 @@ MODEL_OUTPUT_DIR=$1
ROUND
=
$2
TUNING_OR_NOT
=
$3
PRODUCTION_MODE
=
$4
RESTART_ROUND
=
$5
if
[
x
"
$TARGET_ABI
"
=
x
"host"
]
;
then
MACE_CPP_MIN_VLOG_LEVEL
=
$VLOG_LEVEL
\
...
...
@@ -28,7 +29,8 @@ if [ x"$TARGET_ABI" = x"host" ]; then
--output_file
=
${
MODEL_OUTPUT_DIR
}
/
${
OUTPUT_FILE_NAME
}
\
--model_data_file
=
${
MODEL_OUTPUT_DIR
}
/
${
MODEL_TAG
}
.data
\
--device
=
${
DEVICE_TYPE
}
\
--round
=
1
||
exit
1
--round
=
1
\
--restart_round
=
1
||
exit
1
else
if
[[
"
${
TUNING_OR_NOT
}
"
!=
"0"
&&
"
$PRODUCTION_MODE
"
!=
1
]]
;
then
tuning_flag
=
1
...
...
@@ -69,7 +71,8 @@ else
--output_file=
${
PHONE_DATA_DIR
}
/
${
OUTPUT_FILE_NAME
}
\
--model_data_file=
${
PHONE_DATA_DIR
}
/
${
MODEL_TAG
}
.data
\
--device=
${
DEVICE_TYPE
}
\
--round=
$ROUND
; echo
\\
$?
"
`
||
exit
1
--round=
$ROUND
\
--restart_round=
$RESTART_ROUND
; echo
\\
$?
"
`
||
exit
1
echo
"
$mace_adb_output
"
|
head
-n
-1
mace_adb_return_code
=
`
echo
"
$mace_adb_output
"
|
tail
-1
`
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录