Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
6cfa7ab0
Mace
项目概览
Xiaomi
/
Mace
通知
106
Star
40
Fork
27
代码
文件
提交
分支
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6cfa7ab0
编写于
4月 10, 2018
作者:
L
Liangliang He
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'add_range_check_to_mace_tools' into 'master'
add range check to mace tools See merge request !366
上级
139d64bb
854a2baa
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
35 addition
and
6 deletion
+35
-6
tools/mace_tools.py
tools/mace_tools.py
+25
-4
tools/tuning_run.sh
tools/tuning_run.sh
+10
-2
未找到文件。
tools/mace_tools.py
浏览文件 @
6cfa7ab0
...
...
@@ -162,7 +162,8 @@ def tuning_run(model_name,
running_round
,
tuning
,
restart_round
,
option_args
=
''
):
option_args
=
''
,
out_of_range_check
=
False
):
# TODO(yejianwu) refactoring the hackish code
stdout_buff
=
[]
process_output
=
sh_commands
.
make_output_processor
(
stdout_buff
)
...
...
@@ -174,6 +175,7 @@ def tuning_run(model_name,
int
(
tuning
),
restart_round
,
option_args
,
int
(
out_of_range_check
),
_out
=
process_output
,
_bg
=
True
,
_err_to_out
=
True
)
...
...
@@ -209,10 +211,11 @@ def benchmark_model(target_soc, model_output_dir, option_args=''):
def
run_model
(
model_name
,
target_runtime
,
target_abi
,
target_soc
,
model_output_dir
,
running_round
,
restart_round
,
option_args
):
model_output_dir
,
running_round
,
restart_round
,
option_args
,
out_of_range_check
):
tuning_run
(
model_name
,
target_runtime
,
target_abi
,
target_soc
,
model_output_dir
,
running_round
,
False
,
restart_round
,
option_args
)
option_args
,
out_of_range_check
)
def
generate_production_code
(
target_soc
,
model_output_dirs
,
pull_or_not
):
...
...
@@ -235,6 +238,18 @@ def build_mace_run_prod(model_name, target_runtime, target_abi, target_soc,
generate_code
(
target_soc
,
[],
False
)
production_or_not
=
False
build_mace_run
(
production_or_not
,
model_output_dir
,
hexagon_mode
)
tuning_run
(
model_name
,
target_runtime
,
target_abi
,
target_soc
,
model_output_dir
,
running_round
=
0
,
tuning
=
False
,
restart_round
=
1
,
out_of_range_check
=
True
)
tuning_run
(
model_name
,
target_runtime
,
...
...
@@ -345,6 +360,11 @@ def parse_args():
type
=
str
,
default
=
"all"
,
help
=
"SoCs to build, comma seperated list (getprop ro.board.platform)"
)
parser
.
add_argument
(
"--out_of_range_check"
,
type
=
"bool"
,
default
=
"false"
,
help
=
"Enable out of range check for opencl."
)
return
parser
.
parse_known_args
()
...
...
@@ -454,7 +474,8 @@ def main(unused_args):
FLAGS
.
mode
==
"all"
:
run_model
(
model_name
,
global_runtime
,
target_abi
,
target_soc
,
model_output_dir
,
FLAGS
.
round
,
FLAGS
.
restart_round
,
option_args
)
FLAGS
.
restart_round
,
option_args
,
FLAGS
.
out_of_range_check
)
if
FLAGS
.
mode
==
"benchmark"
:
benchmark_model
(
target_soc
,
model_output_dir
,
option_args
)
...
...
tools/tuning_run.sh
浏览文件 @
6cfa7ab0
#!/bin/bash
Usage
()
{
echo
"Usage: bash tools/tuning_run.sh target_soc model_output_dir round tuning "
echo
"Usage: bash tools/tuning_run.sh target_soc model_output_dir round tuning
restart_round opt_args out_of_range_check
"
}
if
[
$#
-lt
6
]
;
then
if
[
$#
-lt
7
]
;
then
Usage
exit
1
fi
...
...
@@ -18,6 +18,7 @@ ROUND=$3
TUNING_OR_NOT
=
$4
RESTART_ROUND
=
$5
OPTION_ARGS
=
$6
OUT_OF_RANGE_CHECK_OR_NOT
=
$7
echo
$OPTION_ARGS
...
...
@@ -49,6 +50,12 @@ else
else
tuning_flag
=
0
fi
if
[[
"
${
OUT_OF_RANGE_CHECK_OR_NOT
}
"
!=
"0"
]]
;
then
out_of_range_check_flag
=
1
else
out_of_range_check_flag
=
0
fi
adb
-s
$DEVICE_ID
shell
"mkdir -p
${
PHONE_DATA_DIR
}
"
||
exit
1
adb
-s
$DEVICE_ID
shell
"mkdir -p
${
COMPILED_PROGRAM_DIR
}
"
||
exit
1
...
...
@@ -67,6 +74,7 @@ else
ADB_CMD_STR
=
"LD_LIBRARY_PATH=
${
PHONE_DATA_DIR
}
\
MACE_TUNING=
${
tuning_flag
}
\
MACE_OUT_OF_RANGE_CHECK=
${
out_of_range_check_flag
}
\
MACE_CPP_MIN_VLOG_LEVEL=
$VLOG_LEVEL
\
MACE_RUN_PARAMETER_PATH=
${
PHONE_DATA_DIR
}
/mace_run.config
\
MACE_CL_PROGRAM_PATH=
$COMPILED_PROGRAM_DIR
\
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录