Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mr.Vain
Mace
提交
30418e13
Mace
项目概览
Mr.Vain
/
Mace
与 Fork 源项目一致
Fork自
Xiaomi / Mace
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
30418e13
编写于
2月 06, 2018
作者:
Y
yejianwu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add hexagon_mode params to 'build_mace_run.sh'
上级
848b0909
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
11 deletion
+19
-11
build_mace_run.sh
build_mace_run.sh
+4
-3
mace_tools.py
mace_tools.py
+15
-8
未找到文件。
build_mace_run.sh
浏览文件 @
30418e13
#!/bin/bash
Usage
()
{
echo
"Usage: bash tools/build_mace_run.sh production_mode model_output_dir"
echo
"Usage: bash tools/build_mace_run.sh production_mode model_output_dir
hexagon_mode
"
}
if
[
$#
-lt
2
]
;
then
if
[
$#
-lt
3
]
;
then
Usage
exit
1
fi
...
...
@@ -14,6 +14,7 @@ source ${CURRENT_DIR}/env.sh
PRODUCTION_MODE
=
$1
MODEL_OUTPUT_DIR
=
$2
HEXAGON_MODE
=
$3
if
[
"
$PRODUCTION_MODE
"
=
1
]
;
then
PRODUCTION_MODE_BUILD_FLAGS
=
"--define production=true"
...
...
@@ -36,7 +37,7 @@ if [ x"$RUNTIME" = x"local" ]; then
--define
openmp
=
true
\
$PRODUCTION_MODE_BUILD_FLAGS
||
exit
1
else
if
[
x
"
$RUNTIME
"
=
x
"dsp"
]
;
then
if
[
"
$HEXAGON_MODE
"
=
1
]
;
then
HEXAGON_MODE_BUILD_FLAG
=
"--define hexagon=true"
fi
...
...
mace_tools.py
浏览文件 @
30418e13
...
...
@@ -54,6 +54,8 @@ def get_libs(configs):
command
=
"bash tools/download_and_link_lib.sh "
+
libmace_name
run_command
(
command
)
return
libmace_name
def
clear_env
():
command
=
"bash tools/clear_env.sh"
...
...
@@ -72,9 +74,9 @@ def generate_model_code():
run_command
(
command
)
def
build_mace_run
(
production_mode
,
model_output_dir
):
command
=
"bash tools/build_mace_run.sh {} {}"
.
format
(
int
(
production_mode
),
model_output_dir
)
def
build_mace_run
(
production_mode
,
model_output_dir
,
hexagon_mode
):
command
=
"bash tools/build_mace_run.sh {} {}
{}
"
.
format
(
int
(
production_mode
),
model_output_dir
,
int
(
hexagon_mode
)
)
run_command
(
command
)
...
...
@@ -98,9 +100,14 @@ def generate_production_code(model_output_dirs, pull_or_not):
run_command
(
command
)
def
build_mace_run_prod
(
model_output_dir
,
tuning
):
def
build_mace_run_prod
(
model_output_dir
,
tuning
,
libmace_name
):
if
"dsp"
in
libmace_name
:
hexagon_mode
=
True
else
:
hexagon_mode
=
False
production_or_not
=
False
build_mace_run
(
production_or_not
,
model_output_dir
)
build_mace_run
(
production_or_not
,
model_output_dir
,
hexagon_mode
)
tuning_run
(
model_output_dir
,
running_round
=
0
,
...
...
@@ -110,7 +117,7 @@ def build_mace_run_prod(model_output_dir, tuning):
production_or_not
=
True
pull_or_not
=
True
generate_production_code
([
model_output_dir
],
pull_or_not
)
build_mace_run
(
production_or_not
,
model_output_dir
)
build_mace_run
(
production_or_not
,
model_output_dir
,
hexagon_mode
)
def
validate_model
(
model_output_dir
):
...
...
@@ -242,7 +249,7 @@ def main(unused_args):
elif
os
.
path
.
exists
(
os
.
path
.
join
(
FLAGS
.
output_dir
,
"libmace"
)):
shutil
.
rmtree
(
os
.
path
.
join
(
FLAGS
.
output_dir
,
"libmace"
))
get_libs
(
configs
)
libmace_name
=
get_libs
(
configs
)
if
FLAGS
.
mode
==
"run"
and
len
(
configs
)
>
1
:
raise
Exception
(
"Mode 'run' only can execute one model config, which have been built lastest"
)
...
...
@@ -266,7 +273,7 @@ def main(unused_args):
if
FLAGS
.
mode
==
"build"
or
FLAGS
.
mode
==
"all"
:
generate_model_code
()
build_mace_run_prod
(
model_output_dir
,
FLAGS
.
tuning
)
build_mace_run_prod
(
model_output_dir
,
FLAGS
.
tuning
,
libmace_name
)
if
FLAGS
.
mode
==
"run"
or
FLAGS
.
mode
==
"all"
:
run_model
(
model_output_dir
,
FLAGS
.
round
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录