From ba0423cfc5e2a1f6c721798598a5ebbb2adc545a Mon Sep 17 00:00:00 2001 From: zhengyuanhua Date: Sat, 8 Oct 2022 10:05:48 +0800 Subject: [PATCH] adapte lite ascend smoke --- mindspore/ccsrc/transform/graph_ir/graph_runner.cc | 12 ++++++------ mindspore/lite/test/config_level0/models_ascend.cfg | 4 ++-- mindspore/lite/test/st/run_benchmark_nets.sh | 2 +- mindspore/lite/test/st/scripts/ascend/run_ascend.sh | 12 ++++++++++-- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/mindspore/ccsrc/transform/graph_ir/graph_runner.cc b/mindspore/ccsrc/transform/graph_ir/graph_runner.cc index 9bf7d08d798..6dc9f849aca 100644 --- a/mindspore/ccsrc/transform/graph_ir/graph_runner.cc +++ b/mindspore/ccsrc/transform/graph_ir/graph_runner.cc @@ -40,7 +40,7 @@ namespace py = pybind11; namespace mindspore { namespace transform { std::shared_ptr<::ge::Session> GraphRunner::NewSession(const SessionOptions &sess_options) { -#if (defined ENABLE_D) || (defined ENABLE_LITE_ACL) +#if (defined ENABLE_D) || (defined ENABLE_HELPER) std::shared_ptr<::ge::Session> ret; auto ms_context = MsContext::GetInstance(); MS_EXCEPTION_IF_NULL(ms_context); @@ -63,14 +63,14 @@ GraphRunner::GraphRunner(const GraphRunnerOptions &options) if (ConfigManager::GetInstance().parallel_strategy() == ParallelStrategy::ONE_DEVICE) { MS_LOG(INFO) << "ME run in ONE_DEVICE strategy mode"; } -#if (defined ENABLE_D) || (defined ENABLE_LITE_ACL) +#if (defined ENABLE_D) || (defined ENABLE_HELPER) auto ms_context = MsContext::GetInstance(); MS_EXCEPTION_IF_NULL(ms_context); #endif if (options.sess_ptr != nullptr) { sess_ = options.sess_ptr; } else { -#if (defined ENABLE_D) || (defined ENABLE_LITE_ACL) +#if (defined ENABLE_D) || (defined ENABLE_HELPER) if (ms_context->backend_policy() == "ge") { sess_ = NewSession(options.options); if (sess_ == nullptr) { @@ -85,11 +85,11 @@ GraphRunner::GraphRunner(const GraphRunnerOptions &options) MS_LOG(INFO) << "The GraphManager is empty!!"; return; } -#if (defined ENABLE_D) || (defined ENABLE_LITE_ACL) +#if (defined ENABLE_D) || (defined ENABLE_HELPER) if (ms_context->backend_policy() != "ge") { return; } -#ifndef ENABLE_LITE_ACL +#ifndef ENABLE_HELPER // register the callback function if (sess_->RegisterCallBackFunc(callbacks::kCheckPoint, callbacks::CheckpointSaveCallback) != ::ge::GRAPH_SUCCESS) { MS_LOG(EXCEPTION) << "Register callback failed!"; @@ -145,7 +145,7 @@ Status GraphRunner::RunGraph(const RunOptions &options, const std::vectorbackend_policy() == "ge") { diff --git a/mindspore/lite/test/config_level0/models_ascend.cfg b/mindspore/lite/test/config_level0/models_ascend.cfg index 990deb84b4b..25d90258c91 100644 --- a/mindspore/lite/test/config_level0/models_ascend.cfg +++ b/mindspore/lite/test/config_level0/models_ascend.cfg @@ -19,8 +19,8 @@ mtk_face_recognition_v1 5 #tf cbg_ai_ocr_direction.pb;1:input;1,32,32,1;;offline_resize 2 -cbg_ai_ocr_detect_straight.pb;1:input;1,32,32,3;;offline_resize 5 -cbg_ai_ocr_inception_curve.pb;1:input;1,960,960,3;;offline_resize 5 +#cbg_ai_ocr_detect_straight.pb;1:input;1,32,32,3;;offline_resize 5 +#cbg_ai_ocr_inception_curve.pb;1:input;1,960,960,3;;offline_resize 5 cbg_ai_ocr_language_classify.pb;1:input_0;2,32,512,1;;offline_resize 5 cbg_ai_ocr_recognize_latin.pb;1:input_0;1,64,64,1;;offline_resize 5 open_source_inception_v3.pb;1:input;2,299,299,3;;offline_resize 5 diff --git a/mindspore/lite/test/st/run_benchmark_nets.sh b/mindspore/lite/test/st/run_benchmark_nets.sh index 0448412b91a..68baa50ade5 100644 --- a/mindspore/lite/test/st/run_benchmark_nets.sh +++ b/mindspore/lite/test/st/run_benchmark_nets.sh @@ -159,7 +159,7 @@ if [[ $backend == "all" || $backend == "x86_gpu" ]]; then fi fi -if [[ $backend == "all" || $backend == "x86_ascend310" || $backend == "x86_ascend710" ]]; then +if [[ $backend == "all" || $backend == "x86_ascend310" || $backend == "x86_ascend710" || $backend == "arm_ascend310" ]]; then sh $cur_path/scripts/ascend/run_ascend.sh -r $release_path -m $models_path -d $device_id -e $backend -l $level ascend_status=$? if [[ ascend_status -ne 0 ]]; then diff --git a/mindspore/lite/test/st/scripts/ascend/run_ascend.sh b/mindspore/lite/test/st/scripts/ascend/run_ascend.sh index 93e526350ba..eb079b335a4 100644 --- a/mindspore/lite/test/st/scripts/ascend/run_ascend.sh +++ b/mindspore/lite/test/st/scripts/ascend/run_ascend.sh @@ -10,7 +10,11 @@ function PrePareLocal() { cp ./scripts/ascend/run_converter_ascend.sh ${benchmark_test_path} || exit 1 cp ./scripts/ascend/run_benchmark_ascend.sh ${benchmark_test_path} || exit 1 cp ./../${config_folder}/models_ascend.cfg ${benchmark_test_path} || exit 1 - cp ${release_path}/centos_x86/ascend/*-linux-${arch}.tar.gz ${benchmark_test_path} || exit 1 + if [[ ${backend} =~ "arm" ]]; then + cp ${release_path}/linux_aarch64/ascend/*-linux-${arch}.tar.gz ${benchmark_test_path} || exit 1 + else + cp ${release_path}/centos_x86/ascend/*-linux-${arch}.tar.gz ${benchmark_test_path} || exit 1 + fi echo "Copy file success" } @@ -22,7 +26,11 @@ function PrePareRemote() { scp ./scripts/ascend/run_benchmark_ascend.sh ${user_name}@${device_ip}:${benchmark_test_path} || exit 1 scp ./scripts/base_functions.sh ${user_name}@${device_ip}:${benchmark_test_path} || exit 1 scp ./../${config_folder}/models_ascend.cfg ${user_name}@${device_ip}:${benchmark_test_path} || exit 1 - scp ${release_path}/centos_x86/ascend/*-linux-${arch}.tar.gz ${user_name}@${device_ip}:${benchmark_test_path} || exit 1 + if [[ ${backend} =~ "arm" ]]; then + scp ${release_path}/linux_aarch64/ascend/*-linux-${arch}.tar.gz ${user_name}@${device_ip}:${benchmark_test_path} || exit 1 + else + scp ${release_path}/centos_x86/ascend/*-linux-${arch}.tar.gz ${user_name}@${device_ip}:${benchmark_test_path} || exit 1 + fi echo "Copy file success" }