Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
孤小逸
Mace
提交
734b5ca5
Mace
项目概览
孤小逸
/
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,发现更多精彩内容 >>
提交
734b5ca5
编写于
4月 28, 2018
作者:
Y
yejianwu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update benchmark and build mace_run flow
上级
99261b26
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
10 deletion
+21
-10
tools/mace_tools.py
tools/mace_tools.py
+12
-5
tools/sh_commands.py
tools/sh_commands.py
+9
-5
未找到文件。
tools/mace_tools.py
浏览文件 @
734b5ca5
...
...
@@ -217,15 +217,15 @@ def build_mace_run_prod(hexagon_mode, runtime, target_abi,
tuning_run
(
runtime
,
target_abi
,
serialno
,
vlog_level
,
embed_model_data
,
model_output_dir
,
input_nodes
,
output_nodes
,
input_shapes
,
output_shapes
,
model_name
,
device_type
,
running_round
=
0
,
restart_round
=
1
,
out_of_range_check
=
True
,
phone_data_dir
=
phone_data_dir
,
tuning
=
False
)
restart_round
=
1
,
out_of_range_check
=
False
,
phone_data_dir
=
phone_data_dir
,
tuning
=
tuning
,
limit_opencl_kernel_time
=
limit_opencl_kernel_time
)
tuning_run
(
runtime
,
target_abi
,
serialno
,
vlog_level
,
embed_model_data
,
model_output_dir
,
input_nodes
,
output_nodes
,
input_shapes
,
output_shapes
,
model_name
,
device_type
,
running_round
=
0
,
restart_round
=
1
,
out_of_range_check
=
False
,
phone_data_dir
=
phone_data_dir
,
tuning
=
tuning
,
limit_opencl_kernel_time
=
limit_opencl_kernel_time
)
restart_round
=
1
,
out_of_range_check
=
True
,
phone_data_dir
=
phone_data_dir
,
tuning
=
False
)
gen_opencl_and_tuning_code
(
target_abi
,
serialno
,
[
model_output_dir
],
True
)
...
...
@@ -394,6 +394,9 @@ def process_models(project_name, configs, embed_model_data, vlog_level,
if
os
.
path
.
exists
(
model_output_dir
):
sh
.
rm
(
"-rf"
,
model_output_dir
)
os
.
makedirs
(
model_output_dir
)
if
FLAGS
.
mode
==
"build"
or
FLAGS
.
mode
==
"benchmark"
or
\
FLAGS
.
mode
==
"all"
:
sh_commands
.
clear_mace_run_data
(
target_abi
,
serialno
,
phone_data_dir
)
...
...
@@ -428,6 +431,8 @@ def process_models(project_name, configs, embed_model_data, vlog_level,
embed_model_data
,
model_config
[
"fast_conv"
],
model_config
[
"obfuscate"
])
if
FLAGS
.
mode
==
"build"
or
FLAGS
.
mode
==
"all"
:
build_mace_run_prod
(
hexagon_mode
,
model_config
[
"runtime"
],
target_abi
,
...
...
@@ -467,6 +472,8 @@ def process_models(project_name, configs, embed_model_data, vlog_level,
phone_data_dir
)
if
FLAGS
.
mode
==
"benchmark"
:
gen_opencl_and_tuning_code
(
target_abi
,
serialno
,
[
model_output_dir
],
False
)
sh_commands
.
benchmark_model
(
target_abi
,
serialno
,
vlog_level
,
...
...
tools/sh_commands.py
浏览文件 @
734b5ca5
...
...
@@ -528,8 +528,10 @@ def tuning_run(abi,
option_args
=
""
,
input_file_name
=
"model_input"
,
output_file_name
=
"model_out"
):
print
(
"* Run '%s' with round=%s, restart_round=%s, tuning=%s"
%
(
model_tag
,
running_round
,
restart_round
,
str
(
tuning
)))
print
(
"* Run '%s' with round=%s, restart_round=%s, tuning=%s, "
"out_of_range_check=%s"
%
(
model_tag
,
running_round
,
restart_round
,
str
(
tuning
),
str
(
out_of_range_check
)))
if
abi
==
"host"
:
p
=
subprocess
.
Popen
([
"env"
,
...
...
@@ -750,10 +752,9 @@ def merge_libs(target_soc,
sh
.
cp
(
"-f"
,
hexagon_lib_file
,
model_bin_dir
)
mri_stream
=
""
mri_stream
+=
"create %s/libmace_%s.%s.a
\n
"
%
\
(
model_bin_dir
,
project_name
,
target_soc
)
if
abi
==
"host"
:
mri_stream
+=
"create %s/libmace_%s.a
\n
"
%
\
(
model_bin_dir
,
project_name
)
mri_stream
+=
(
"addlib "
"bazel-bin/mace/codegen/libgenerated_opencl.pic.a
\n
"
)
...
...
@@ -761,6 +762,8 @@ def merge_libs(target_soc,
"addlib "
"bazel-bin/mace/codegen/libgenerated_tuning_params.pic.a
\n
"
)
else
:
mri_stream
+=
"create %s/libmace_%s.%s.a
\n
"
%
\
(
model_bin_dir
,
project_name
,
target_soc
)
mri_stream
+=
(
"addlib "
"bazel-bin/mace/codegen/libgenerated_opencl.a
\n
"
)
...
...
@@ -861,6 +864,7 @@ def benchmark_model(abi,
bazel_build
(
benchmark_target
,
abi
=
abi
,
model_tag
=
model_tag
,
production_mode
=
True
,
hexagon_mode
=
hexagon_mode
)
target_bin
=
"/"
.
join
(
bazel_target_to_bin
(
benchmark_target
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录