Skip to content

Commit

Permalink
fix npu tipc scripts to reduce running time
Browse files Browse the repository at this point in the history
  • Loading branch information
YanhuiDua authored and cuicheng01 committed Jul 6, 2023
1 parent a29d489 commit a4db6f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test_tipc/test_train_inference_python.sh
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions test_tipc/test_train_inference_python_npu.sh
Expand Up @@ -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
Expand Down

0 comments on commit a4db6f1

Please sign in to comment.