From ccf7d419cf6da40fff7c9351ee2cb47ceb459264 Mon Sep 17 00:00:00 2001 From: Kai Song <50285351+USTCKAY@users.noreply.github.com> Date: Wed, 11 Oct 2023 10:12:00 +0800 Subject: [PATCH] cherry-pick TIPC scripts update from release/2.6 to release/2.6.1 (#8661) --- test_tipc/test_train_inference_python_npu.sh | 2 ++ test_tipc/test_train_inference_python_xpu.sh | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/test_tipc/test_train_inference_python_npu.sh b/test_tipc/test_train_inference_python_npu.sh index 13fa7114380..8255b611bc4 100644 --- a/test_tipc/test_train_inference_python_npu.sh +++ b/test_tipc/test_train_inference_python_npu.sh @@ -40,6 +40,8 @@ FILENAME=$1 sed -i "s/--slim_config _template_pact/ /g" $FILENAME sed -i "s/--slim_config _template_fpgm/ /g" $FILENAME sed -i "s/--slim_config _template_kl_quant/ /g" $FILENAME + # python has been updated to version 3.9 for npu backend + sed -i "s/python3.7/python3.9/g" $FILENAME sed -i 's/\"gpu\"/\"npu\"/g' test_tipc/test_train_inference_python.sh # parser params diff --git a/test_tipc/test_train_inference_python_xpu.sh b/test_tipc/test_train_inference_python_xpu.sh index b020377f1e7..23ef31ad187 100644 --- a/test_tipc/test_train_inference_python_xpu.sh +++ b/test_tipc/test_train_inference_python_xpu.sh @@ -39,11 +39,15 @@ # change gpu to xpu in tipc txt configs sed -i "s/use_gpu:True/use_xpu:True/g" $FILENAME sed -i "s/--device:gpu|cpu/--device:xpu|cpu/g" $FILENAME + sed -i "s/--device:gpu/--device:xpu/g" $FILENAME + sed -i "s/--device:cpu|gpu/--device:cpu|xpu/g" $FILENAME sed -i "s/trainer:pact_train/trainer:norm_train/g" $FILENAME sed -i "s/trainer:fpgm_train/trainer:norm_train/g" $FILENAME sed -i "s/--slim_config _template_pact/ /g" $FILENAME sed -i "s/--slim_config _template_fpgm/ /g" $FILENAME sed -i "s/--slim_config _template_kl_quant/ /g" $FILENAME + # python has been updated to version 3.9 for npu backend + sed -i "s/python3.7/python3.9/g" $FILENAME sed -i 's/\"gpu\"/\"xpu\"/g' test_tipc/test_train_inference_python.sh # parser params @@ -58,6 +62,7 @@ trainer_config=$(func_parser_config ${train_cmd}) echo ${trainer_config} sed -i 's/use_gpu/use_xpu/g' "$REPO_ROOT_PATH/$trainer_config" + sed -i 's/aligned: True/aligned: False/g' "$REPO_ROOT_PATH/$trainer_config" # fine use_gpu in those included yaml sub_datalinee=`cat $REPO_ROOT_PATH/$trainer_config` IFS=$'\n' @@ -67,9 +72,11 @@ sub_config=${sub_lines[sub_line_num-1]} dst=${#sub_config}-5 sub_path=$(func_parser_dir "${trainer_config}") + sub_config_name=$(echo "$sub_config" | awk -F"'" '{ print $2 }') sub_config_path="${REPO_ROOT_PATH}${sub_path}/${sub_config:3:${dst}}" echo ${sub_config_path} sed -i 's/use_gpu/use_xpu/g' "$sub_config_path" + sed -i 's/aligned: True/aligned: False/g' "$sub_config_path" done done