From 48fc521e6122ed33889bdb487ce38e7dd95bbf45 Mon Sep 17 00:00:00 2001 From: duanyanhui Date: Tue, 4 Jul 2023 15:45:54 +0800 Subject: [PATCH] fix npu tipc scripts to reduce running time --- test_tipc/test_train_inference_python.sh | 2 +- test_tipc/test_train_inference_python_npu.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test_tipc/test_train_inference_python.sh b/test_tipc/test_train_inference_python.sh index 4e216997..b5563d71 100644 --- a/test_tipc/test_train_inference_python.sh +++ b/test_tipc/test_train_inference_python.sh @@ -91,7 +91,7 @@ infer_value1=$(func_parser_value "${lines[50]}") if [ ! $epoch_num ]; then epoch_num=2 fi -if [[ $MODE = 'benchmark_train' ]]; then +if [[ $MODE = 'benchmark_train' ]] || [[ $train_use_gpu_value = 'npu' ]]; then epoch_num=1 fi diff --git a/test_tipc/test_train_inference_python_npu.sh b/test_tipc/test_train_inference_python_npu.sh index e933eff5..60071197 100644 --- a/test_tipc/test_train_inference_python_npu.sh +++ b/test_tipc/test_train_inference_python_npu.sh @@ -21,6 +21,15 @@ FILENAME=$1 # change gpu to npu in tipc txt configs sed -i "s/Global.device:gpu/Global.device:npu/g" $FILENAME sed -i "s/Global.use_gpu/Global.use_npu/g" $FILENAME +sed -i "s/Global.use_tensorrt:True|False/Global.use_tensorrt:False/g" $FILENAME +sed -i "s/Global.save_interval=2/Global.save_interval=1/g" $FILENAME +sed -i "s/-o Global.epochs:lite_train_lite_infer=2/-o Global.epochs:lite_train_lite_infer=1/g" $FILENAME + +modelname=$(echo $FILENAME | cut -d '/' -f4) +if [ $modelname == "PVTV2" ] || [ $modelname == "Twins" ] || [ $modelname == "SwinTransformer" ]; then + sed -i "s/gpu_list:0|0,1/gpu_list:0,1/g" $FILENAME +fi + dataline=`cat $FILENAME` # parser params -- GitLab