From 75b0f7d26f65fbb94d84ec3ba2ece77bedd5c126 Mon Sep 17 00:00:00 2001 From: gaotingquan Date: Thu, 25 May 2023 06:30:39 +0000 Subject: [PATCH] fix fp32 invalid when amp used by default & support amp arg --- test_tipc/common_func.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test_tipc/common_func.sh b/test_tipc/common_func.sh index 0b8a660d..e0814448 100644 --- a/test_tipc/common_func.sh +++ b/test_tipc/common_func.sh @@ -29,9 +29,11 @@ function func_set_amp_params(){ value=$2 if [[ ${value} = "fp16" ]];then - echo "-o AMP.scale_loss=128 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2" + echo "-o AMP.use_amp=True -o AMP.scale_loss=128 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2" + elif [[ ${value} = "amp" ]];then + echo "-o AMP.use_amp=True -o AMP.scale_loss=128 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O1" else - echo " " + echo "-o AMP.use_amp=False" fi } @@ -42,7 +44,7 @@ function func_set_params(){ echo " " elif [[ ${value} = "null" ]] || [[ ${value} = " " ]] || [ ${#value} -le 0 ];then echo " " - else + else echo "${key}=${value}" fi } -- GitLab