From adb4a9b478488d1176f99cfe0f7685b5ce5271ff Mon Sep 17 00:00:00 2001 From: Bin Li Date: Fri, 24 Apr 2020 18:14:15 +0800 Subject: [PATCH] Support HTA code/code --- .gitlab-ci.yml | 7 +++++++ mace/core/runtime/hexagon/hexagon_hta_transformer.cc | 1 - mace/python/tools/operator.jinja2 | 2 +- tools/python/template/operator.jinja2 | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 48921247..77c8ff31 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -168,6 +168,13 @@ quantization_tests: python tools/converter.py convert --config=${CONF_FILE} --target_socs=$TARGET_SOCS --model_graph_format=file --model_data_format=file || exit 1; python tools/converter.py run --config=${CONF_FILE} --target_socs=$TARGET_SOCS --device_yml=${DEVICE_CONF_FILE} --round=1 --validate --model_graph_format=file --model_data_format=file || exit 1; done + - > + CONF_FILE=mace-models/mobilenet-v1/mobilenet-v1-quantize-retrain-hta.yml; + GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git clone --single-branch --branch hta git@v9.git.n.xiaomi.com:deep-computing/mace.git mace_hta --depth 1; + mv mace_hta/third_party/hta/ third_party/; + python tools/converter.py convert --config=${CONF_FILE} --model_graph_format=file --model_data_format=file || exit 1; + python tools/converter.py run --config=${CONF_FILE} --round=1 --validate --model_graph_format=file --model_data_format=file || exit 1; + rm -rf mace_hta third_party/hta; - rm -rf mace-models dynamic_linking_test: diff --git a/mace/core/runtime/hexagon/hexagon_hta_transformer.cc b/mace/core/runtime/hexagon/hexagon_hta_transformer.cc index cf0b7531..a3c144c0 100644 --- a/mace/core/runtime/hexagon/hexagon_hta_transformer.cc +++ b/mace/core/runtime/hexagon/hexagon_hta_transformer.cc @@ -19,7 +19,6 @@ #include #include -#include "mace/core/op_context.h" #include "mace/core/quantize.h" #include "mace/core/tensor.h" #include "mace/core/types.h" diff --git a/mace/python/tools/operator.jinja2 b/mace/python/tools/operator.jinja2 index c1cea9a6..92c5cd71 100644 --- a/mace/python/tools/operator.jinja2 +++ b/mace/python/tools/operator.jinja2 @@ -138,7 +138,7 @@ void CreateOperator{{i}}(mace::OperatorDef *op) { quantize_info{{j}}->set_maxval({{ net.op[i].quantize_info[j].maxval }}); {% endfor %} - {% if device == 3 %} + {% if device == 3 or device == 4 %} op->set_padding({{ net.op[i].padding }}); {% if net.op[i].node_input | length > 0 %} std::vector input_node_ids({ {{ net.op[i].node_input | map(attribute='node_id') | join(', ') }} }); diff --git a/tools/python/template/operator.jinja2 b/tools/python/template/operator.jinja2 index c899f3f3..4b5dc4cd 100644 --- a/tools/python/template/operator.jinja2 +++ b/tools/python/template/operator.jinja2 @@ -138,7 +138,7 @@ void CreateOperator{{i}}(mace::OperatorDef *op) { quantize_info{{j}}->set_maxval({{ net.op[i].quantize_info[j].maxval }}); {% endfor %} - {% if device == 3 %} + {% if device == 3 or device == 4 %} op->set_padding({{ net.op[i].padding }}); {% if net.op[i].node_input | length > 0 %} std::vector input_node_ids({ {{ net.op[i].node_input | map(attribute='node_id') | join(', ') }} }); -- GitLab