diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b66f8bc33ebad368a3849b9047a671c085c021ff..5b1eff0e1a39695126ef8c8f607c8ee5111cb094 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,10 +13,10 @@ ops_test: stage: ops_test script: - 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: stage: ops_benchmark script: - 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.*" diff --git a/tools/bazel_adb_run.py b/tools/bazel_adb_run.py index 68896b980e8ea88b2b2462559c6ce09e757acd00..185167673aca32cc1b188234892ae98d551d329d 100644 --- a/tools/bazel_adb_run.py +++ b/tools/bazel_adb_run.py @@ -94,13 +94,16 @@ def main(unused_args): sh_commands.bazel_build(target, abi=target_abi) if FLAGS.run_target: 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, args=FLAGS.args, opencl_profiling=1, vlog_level=0, device_bin_path="/data/local/tmp/mace", out_of_range_check=1) + device_properties = sh_commands.adb_getprop_by_serialno(serialno) globals()[FLAGS.stdout_processor](stdouts, device_properties, target_abi) if __name__ == "__main__": diff --git a/tools/sh_commands.py b/tools/sh_commands.py index a021f9b7ddd48afa0da34a15528a1e0a5fc5879a..21dcef8be73707f3e32a6ba7ca3ba9d2b598c28c 100644 --- a/tools/sh_commands.py +++ b/tools/sh_commands.py @@ -49,6 +49,12 @@ def adb_getprop_by_serialno(serialno): props[m.group(1)] = m.group(2) 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(): socs = [] for d in adb_devices(): @@ -89,6 +95,7 @@ def adb_run(serialno, host_bin_path, bin_name, # bazel commands ################################ def bazel_build(target, strip="always", abi="armeabi-v7a"): + print("Build %s with ABI %s" % (target, abi)) stdout_buff=[] process_output = make_output_processor(stdout_buff) p= sh.bazel("build",