提交 a74fa412 编写于 作者: Y yejianwu

fix benchmark

上级 61bd1d3b
......@@ -112,10 +112,6 @@ There are two common advanced use cases:
* **Convert model(s) to C++ code**
.. warning::
If you want to use this case, you can just use static mace library.
* **1. Change the model deployment file(.yml)**
If you want to protect your model, you can convert model to C++ code. there are also two cases:
......@@ -379,7 +375,8 @@ Reduce Library Size
will reduce half of library size to about ``700KB`` for ``armeabi-v7a`` and ``1000KB`` for ``arm64-v8a``
- About ``300KB`` can be reduced when add ``--config symbol_hidden`` building option. It will change
the visibility of inner apis of libmace.so and lead to linking error when load model(s) in ``code``.
the visibility of inner apis in libmace.so and lead to linking error when load model(s) in ``code``
but no effection for ``file`` mode.
* **static library**
......
......@@ -65,6 +65,7 @@ cc_binary(
":statistics",
"//external:gflags_nothreads",
"//mace/codegen:generated_mace_engine_factory",
"//mace/codegen:generated_models",
"//mace/libmace:libmace_dynamic",
],
)
......
......@@ -1387,8 +1387,10 @@ def build_benchmark_model(configs, target_abi, enable_openmp, mace_lib_type):
link_dynamic = mace_lib_type == MACELibType.dynamic
if link_dynamic:
symbol_hidden = False
benchmark_target = BM_MODEL_DYNAMIC_TARGET
else:
symbol_hidden = True
benchmark_target = BM_MODEL_STATIC_TARGET
build_arg = ""
......@@ -1403,6 +1405,7 @@ def build_benchmark_model(configs, target_abi, enable_openmp, mace_lib_type):
enable_openmp=enable_openmp,
enable_opencl=get_opencl_mode(configs),
hexagon_mode=hexagon_mode,
symbol_hidden=symbol_hidden,
extra_args=build_arg)
# clear tmp binary dir
build_tmp_binary_dir = get_build_binary_dir(library_name, target_abi)
......@@ -1514,11 +1517,6 @@ def bm_specific_target(flags, configs, target_abi, target_soc, serial_num):
def benchmark_model(flags):
configs = format_model_config(flags)
if flags.mace_lib_type == MACELibType.dynamic and \
configs[YAMLKeyword.model_graph_format] == ModelFormat.code:
MaceLogger.error(ModuleName.YAML_CONFIG,
"If you want to link MACE dynamic library, "
"you must use file-type MACE model.")
clear_build_dirs(configs[YAMLKeyword.library_name])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册