Skip to content

Commit

Permalink
add snpe squeezenet and ncnn inception benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
lydoc committed Jul 17, 2018
1 parent 9d54ca2 commit 3e3eebf
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions aibench/benchmark/benchmark_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ int main(int argc, char **argv) {
(std::vector<std::vector<int64_t>>{{224, 224, 3}}),
(std::vector<std::string>{}),
(std::vector<std::vector<int64_t>>{}));
AIBENCH_BENCHMARK(snpe_cpu_executor.get(), SqueezeNetV11, SNPE, CPU,
squeezenet_v11.dlc, (std::vector<std::string>{"data"}),
(std::vector<std::string>{}),
(std::vector<std::vector<int64_t>>{{227, 227, 3}}),
(std::vector<std::string>{}),
(std::vector<std::vector<int64_t>>{}));

std::unique_ptr<aibench::SnpeExecutor>
snpe_gpu_executor(new aibench::SnpeExecutor(aibench::GPU));
Expand All @@ -205,6 +211,12 @@ int main(int argc, char **argv) {
(std::vector<std::vector<int64_t>>{{224, 224, 3}}),
(std::vector<std::string>{}),
(std::vector<std::vector<int64_t>>{}));
AIBENCH_BENCHMARK(snpe_gpu_executor.get(), SqueezeNetV11, SNPE, GPU,
squeezenet_v11.dlc, (std::vector<std::string>{"data"}),
(std::vector<std::string>{}),
(std::vector<std::vector<int64_t>>{{227, 227, 3}}),
(std::vector<std::string>{}),
(std::vector<std::vector<int64_t>>{}));
// TODO(wuchenghui): benchmark snpe + gpu + vgg16

std::unique_ptr<aibench::SnpeExecutor>
Expand Down Expand Up @@ -250,6 +262,12 @@ int main(int argc, char **argv) {
(std::vector<std::vector<int64_t>>{{224, 224, 3}}),
(std::vector<std::string>{}),
(std::vector<std::vector<int64_t>>{}));
AIBENCH_BENCHMARK(ncnn_executor.get(), InceptionV3, NCNN, CPU,
inception_v3.param, (std::vector<std::string>{"data"}),
(std::vector<std::string>{}),
(std::vector<std::vector<int64_t>>{{299, 299, 3}}),
(std::vector<std::string>{}),
(std::vector<std::vector<int64_t>>{}));
#endif
#ifdef AIBENCH_ENABLE_TFLITE
std::unique_ptr<aibench::TfLiteExecutor>
Expand Down
5 changes: 5 additions & 0 deletions tools/model_and_input.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ models_and_inputs:
mobilenet-v1.dlc_md5_checksum: a8f669ab3cfbbbf9162ea63c5f99c6c3
mobilenet-v2.dlc: http://cnbj1.fds.api.xiaomi.com/aibench/models/mobilenet-v2-1.0.dlc
mobilenet-v2.dlc_md5_checksum: ec7ca4679714ecb16c5b5696b9b65e9c
squeezenet_v11.dlc: https://cnbj1.fds.api.xiaomi.com/aibench/models/squeezenet_v11.dlc
squeezenet_v11.dlc_md5_checksum: 7fd8d3554136b6c62a5299c20b95da7f
# vgg16 model file converted from tensorflow graph
vgg16.dlc: https://cnbj1-fds.api.xiaomi.net/aibench/models/vgg16.dlc
vgg16.dlc_md5_checksum: ca57f67905fbfaf5cf1755286970646a
Expand All @@ -59,6 +61,9 @@ models_and_inputs:
mobilenet_v1_1.0_224.tflite_md5_checksum: 8ac1abc6bb388135b8ae9343460482fe
mobilenet_quant_v1_224.tflite: https://cnbj1.fds.api.xiaomi.com/aibench/models/mobilenet_quant_v1_224.tflite
mobilenet_quant_v1_224.tflite_md5_checksum: 9002c7725ac251d0b7ae189924daadba
NCNN:
inception_v3.param: https://cnbj1.fds.api.xiaomi.com/aibench/models/inception_v3.param
inception_v3.param_md5_checksum: d618cff6b34f8b447fa0a7e861175540

# libs:
tensorflow-1.9.0-rc1.zip: https://cnbj1.fds.api.xiaomi.com/aibench/third_party/tensorflow-1.9.0-rc1.zip
Expand Down
2 changes: 2 additions & 0 deletions tools/sh_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ def prepare_all_model_and_input(serialno, configs, device_bin_path, output_dir,
if "NCNN" in frameworks:
ncnn_model_path = "bazel-genfiles/external/ncnn/models/"
adb_push(ncnn_model_path, device_bin_path, serialno)
prepare_model_and_input(serialno, models_inputs["NCNN"],
device_bin_path, output_dir)


def adb_run(abi,
Expand Down

0 comments on commit 3e3eebf

Please sign in to comment.