Merge pull request #2284 from qili93/fix_tipc_npu_xpu
[TIPC] add more scripts change, test=developpull/2292/head
commit
a011ad63b0
|
@ -265,9 +265,9 @@ else
|
|||
if [ ${#gpu} -le 2 ]; then # train with cpu or single gpu
|
||||
cmd="${python} ${run_train} ${set_use_gpu} ${set_save_model} ${set_epoch} ${set_pretrain} ${set_autocast} ${set_batchsize} ${set_train_params1} "
|
||||
elif [ ${#ips} -le 15 ]; then # train with multi-gpu
|
||||
cmd="${python} -m paddle.distributed.launch --gpus=${gpu} ${run_train} ${set_use_gpu} ${set_save_model} ${set_epoch} ${set_pretrain} ${set_autocast} ${set_batchsize} ${set_train_params1}"
|
||||
cmd="${python} -m paddle.distributed.launch --devices=${gpu} ${run_train} ${set_use_gpu} ${set_save_model} ${set_epoch} ${set_pretrain} ${set_autocast} ${set_batchsize} ${set_train_params1}"
|
||||
else # train with multi-machine
|
||||
cmd="${python} -m paddle.distributed.launch --ips=${ips} --gpus=${gpu} ${run_train} ${set_use_gpu} ${set_save_model} ${set_pretrain} ${set_epoch} ${set_autocast} ${set_batchsize} ${set_train_params1}"
|
||||
cmd="${python} -m paddle.distributed.launch --ips=${ips} --devices=${gpu} ${run_train} ${set_use_gpu} ${set_save_model} ${set_pretrain} ${set_epoch} ${set_autocast} ${set_batchsize} ${set_train_params1}"
|
||||
fi
|
||||
# run train
|
||||
eval "unset CUDA_VISIBLE_DEVICES"
|
||||
|
|
|
@ -40,6 +40,9 @@ grep -n 'tools/.*yaml' $FILENAME | cut -d ":" -f 1 \
|
|||
sed -i 's/device: gpu/device: npu/g' "$REPO_ROOT_PATH/$trainer_config"
|
||||
done
|
||||
|
||||
# change gpu to npu in execution script
|
||||
sed -i "s/\"gpu\"/\"npu\"/g" test_tipc/test_train_inference_python.sh
|
||||
|
||||
# pass parameters to test_train_inference_python.sh
|
||||
cmd="bash test_tipc/test_train_inference_python.sh ${FILENAME} $2"
|
||||
echo $cmd
|
||||
|
|
|
@ -40,6 +40,9 @@ grep -n 'tools/.*yaml' $FILENAME | cut -d ":" -f 1 \
|
|||
sed -i 's/device: gpu/device: xpu/g' "$REPO_ROOT_PATH/$trainer_config"
|
||||
done
|
||||
|
||||
# change gpu to npu in execution script
|
||||
sed -i "s/\"gpu\"/\"npu\"/g" test_tipc/test_train_inference_python.sh
|
||||
|
||||
# pass parameters to test_train_inference_python.sh
|
||||
cmd="bash test_tipc/test_train_inference_python.sh ${FILENAME} $2"
|
||||
echo $cmd
|
||||
|
|
Loading…
Reference in New Issue