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 675a20dd79ac9a8349ad6514204b78168724e778..6e083de2c3ce118582bd7ff0bd8f065ee89730df 100644 --- a/tools/bazel_adb_run.py +++ b/tools/bazel_adb_run.py @@ -94,12 +94,15 @@ 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") + 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 d7e55e39d552f5c152568648069d40692eceb958..4b47544f751c1559512cf4dfc131accc6be90470 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(): @@ -88,6 +94,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",