Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIPC]update xpu tipc script #8546

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions test_tipc/test_train_inference_python_xpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand All @@ -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

Expand Down