“230f1425cb2e4d8ffa8a48541ca7679ff7284e05”上不存在“tools/python/micro/jinja2_files/micro_net_def.h.jinja2”
提交 fb84272e 编写于 作者: 李寅

Merge branch 'add_target_abis' into 'master'

Enable CI with different ABIs

See merge request !351
...@@ -13,10 +13,10 @@ ops_test: ...@@ -13,10 +13,10 @@ ops_test:
stage: ops_test stage: ops_test
script: script:
- if [ -z "$TARGET_SOCS" ]; then TARGET_SOCS=random; fi - if [ -z "$TARGET_SOCS" ]; then TARGET_SOCS=random; fi
- python tools/bazel_adb_run.py --target="//mace/ops:ops_test" --run_target=True --stdout_processor=ops_test_stdout_processor --target_socs=$TARGET_SOCS - python tools/bazel_adb_run.py --target="//mace/ops:ops_test" --run_target=True --stdout_processor=ops_test_stdout_processor --target_abis=armeabi-v7a,arm64-v8a --target_socs=$TARGET_SOCS
ops_benchmark: ops_benchmark:
stage: ops_benchmark stage: ops_benchmark
script: script:
- if [ -z "$TARGET_SOCS" ]; then TARGET_SOCS=random; fi - if [ -z "$TARGET_SOCS" ]; then TARGET_SOCS=random; fi
- python tools/bazel_adb_run.py --target="//mace/ops:ops_benchmark" --run_target=True --stdout_processor=ops_benchmark_stdout_processor --target_socs=$TARGET_SOCS - python tools/bazel_adb_run.py --target="//mace/ops:ops_benchmark" --run_target=True --stdout_processor=ops_benchmark_stdout_processor --target_abis=armeabi-v7a,arm64-v8a --target_socs=$TARGET_SOCS --args="--filter=.*CONV.*"
...@@ -94,12 +94,15 @@ def main(unused_args): ...@@ -94,12 +94,15 @@ def main(unused_args):
sh_commands.bazel_build(target, abi=target_abi) sh_commands.bazel_build(target, abi=target_abi)
if FLAGS.run_target: if FLAGS.run_target:
for serialno in target_devices: for serialno in target_devices:
device_properties = sh_commands.adb_getprop_by_serialno(serialno) if target_abi not in set(sh_commands.adb_supported_abis(serialno)):
print("Skip device %s which does not support ABI %s" % (serialno, target_abi))
continue
stdouts = sh_commands.adb_run(serialno, host_bin_path, bin_name, stdouts = sh_commands.adb_run(serialno, host_bin_path, bin_name,
args=FLAGS.args, args=FLAGS.args,
opencl_profiling=1, opencl_profiling=1,
vlog_level=0, vlog_level=0,
device_bin_path="/data/local/tmp/mace") device_bin_path="/data/local/tmp/mace")
device_properties = sh_commands.adb_getprop_by_serialno(serialno)
globals()[FLAGS.stdout_processor](stdouts, device_properties, target_abi) globals()[FLAGS.stdout_processor](stdouts, device_properties, target_abi)
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -49,6 +49,12 @@ def adb_getprop_by_serialno(serialno): ...@@ -49,6 +49,12 @@ def adb_getprop_by_serialno(serialno):
props[m.group(1)] = m.group(2) props[m.group(1)] = m.group(2)
return props return props
def adb_supported_abis(serialno):
props = adb_getprop_by_serialno(serialno)
abilist_str = props["ro.product.cpu.abilist"]
abis = [abi.strip() for abi in abilist_str.split(',')]
return abis
def adb_get_all_socs(): def adb_get_all_socs():
socs = [] socs = []
for d in adb_devices(): for d in adb_devices():
...@@ -88,6 +94,7 @@ def adb_run(serialno, host_bin_path, bin_name, ...@@ -88,6 +94,7 @@ def adb_run(serialno, host_bin_path, bin_name,
# bazel commands # bazel commands
################################ ################################
def bazel_build(target, strip="always", abi="armeabi-v7a"): def bazel_build(target, strip="always", abi="armeabi-v7a"):
print("Build %s with ABI %s" % (target, abi))
stdout_buff=[] stdout_buff=[]
process_output = make_output_processor(stdout_buff) process_output = make_output_processor(stdout_buff)
p= sh.bazel("build", p= sh.bazel("build",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册