!42176 lite ascend smoke test

Merge pull request !42176 from zhengyuanhua/code_review
This commit is contained in:
i-robot 2022-10-12 10:52:35 +00:00 committed by Gitee
commit 1f0ee25d7b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 19 additions and 11 deletions

View File

@ -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::vector<GeTens
struct timeval start_time, end_time;
(void)gettimeofday(&start_time, nullptr);
#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);
if (ms_context->backend_policy() == "ge") {

View File

@ -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

View File

@ -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

View File

@ -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"
}