提交 518ebbb5 编写于 作者: 叶剑武

Merge branch 'host_ci' into 'master'

Add non-neon CI

See merge request !519
......@@ -42,6 +42,7 @@ 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=unittest_stdout_processor --target_abis=armeabi-v7a,arm64-v8a --target_socs=$TARGET_SOCS
- python tools/bazel_adb_run.py --target="//mace/ops:ops_test" --run_target=True --stdout_processor=unittest_stdout_processor --target_abis=armeabi-v7a,arm64-v8a --target_socs=$TARGET_SOCS --enable_neon=false
api_test:
stage: api_test
......
......@@ -63,6 +63,17 @@ def ops_benchmark_stdout_processor(stdout, device_properties, abi):
# metrics, tags=tags, endpoint="mace_ops_benchmark")
# TODO: after merge mace/python/tools and tools are merged,
# define str2bool as common util
def str2bool(v):
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse.ArgumentTypeError('Boolean value expected.')
def parse_args():
"""Parses command line arguments."""
parser = argparse.ArgumentParser()
......@@ -81,7 +92,7 @@ def parse_args():
"--target", type=str, default="//...", help="Bazel target to build")
parser.add_argument(
"--run_target",
type=bool,
type=str2bool,
default=False,
help="Whether to run the target")
parser.add_argument(
......@@ -105,6 +116,11 @@ def parse_args():
type=str,
default="stdout_processor",
help="Stdout processing function, default: stdout_processor")
parser.add_argument(
"--enable_neon",
type=str2bool,
default=True,
help="Whether to use neon optimization")
return parser.parse_known_args()
......@@ -137,7 +153,8 @@ def main(unused_args):
debug = True
for target_abi in target_abis:
sh_commands.bazel_build(target, strip=strip, abi=target_abi,
disable_no_tuning_warning=True, debug=debug)
disable_no_tuning_warning=True, debug=debug,
enable_neon=FLAGS.enable_neon)
if FLAGS.run_target:
for serialno in target_devices:
if target_abi not in set(
......
......@@ -272,7 +272,8 @@ def bazel_build(target,
hexagon_mode=False,
disable_no_tuning_warning=False,
debug=False,
enable_openmp=True):
enable_openmp=True,
enable_neon=True):
print("* Build %s with ABI %s" % (target, abi))
stdout_buff = []
process_output = make_output_processor(stdout_buff)
......@@ -316,7 +317,7 @@ def bazel_build(target,
"--copt=-DMACE_OBFUSCATE_LITERALS",
"--copt=-O3",
"--define",
"neon=true",
"neon=%s" % str(enable_neon).lower(),
"--define",
"openmp=%s" % str(enable_openmp).lower(),
"--define",
......
......@@ -181,7 +181,6 @@ def validate(platform, model_file, weight_file, input_file, mace_out_file,
def parse_args():
"""Parses command line arguments."""
parser = argparse.ArgumentParser()
parser.register("type", "bool", lambda v: v.lower() == "true")
parser.add_argument(
"--platform", type=str, default="", help="Tensorflow or Caffe.")
parser.add_argument(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册