From a7eaef234d79d52cc48dbf3776a929e5b7cd3013 Mon Sep 17 00:00:00 2001 From: hanxiaoxuan Date: Fri, 30 Dec 2022 11:19:35 +0800 Subject: [PATCH] add compile time 1230 --- .../test/train_RT2_performance_1p.sh | 4 ++++ .../test/train_RT2_performance_1p.sh | 4 ++++ .../test/train_RT2_performance_1p.sh | 4 ++++ .../test/train_ID3057_FwFM_performance_1p_RT2.sh | 3 +++ .../test/train_ID3058_MMoE_performance_1p_RT2.sh | 2 +- .../test/train_RT2_performance_1p.sh | 4 ++++ 6 files changed, 20 insertions(+), 1 deletion(-) diff --git a/TensorFlow/built-in/cv/detection/OpenPose_ID0117_for_TensorFlow/test/train_RT2_performance_1p.sh b/TensorFlow/built-in/cv/detection/OpenPose_ID0117_for_TensorFlow/test/train_RT2_performance_1p.sh index b9c791e81..0b632417d 100644 --- a/TensorFlow/built-in/cv/detection/OpenPose_ID0117_for_TensorFlow/test/train_RT2_performance_1p.sh +++ b/TensorFlow/built-in/cv/detection/OpenPose_ID0117_for_TensorFlow/test/train_RT2_performance_1p.sh @@ -169,6 +169,9 @@ FPS=`awk 'BEGIN {printf "%.2f\n", '1000'*'${batch_size}'/'${step_sec}'}'` #打印,不需要修改 echo "Final Performance images/sec : $FPS" +#输出CompileTime +CompileTime=`grep 's/step' $cur_path/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log| head -n 2| awk '{print $4}' | awk -F 's' '{sum+=$1} END {print sum}'` + #输出训练精度,需要模型审视修改 train_accuracy=(`grep -r "/step" $cur_path/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log | awk -F : 'END {print $3}' | awk '{print $1}'`) #打印,不需要修改 @@ -203,3 +206,4 @@ echo "TrainingTime = ${TrainingTime}" >> $cur_path/output/$ASCEND_DEVICE_ID/${Ca echo "ActualLoss = ${ActualLoss}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log echo "E2ETrainingTime = ${e2e_time}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log echo "DynamicInput = ${dynamic_input}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log +echo "CompileTime = ${CompileTime}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log diff --git a/TensorFlow/built-in/nlp/FastText_ID0135_for_TensorFlow/test/train_RT2_performance_1p.sh b/TensorFlow/built-in/nlp/FastText_ID0135_for_TensorFlow/test/train_RT2_performance_1p.sh index c85d1c4fb..429be1fe1 100644 --- a/TensorFlow/built-in/nlp/FastText_ID0135_for_TensorFlow/test/train_RT2_performance_1p.sh +++ b/TensorFlow/built-in/nlp/FastText_ID0135_for_TensorFlow/test/train_RT2_performance_1p.sh @@ -153,6 +153,9 @@ FPS=`awk 'BEGIN {printf "%.2f\n", '1000'*'1000'*'${batch_size}'/'${TrainingTime} #打印,不需要修改 echo "Final Performance images/sec : $FPS" +#输出CompileTime +CompileTime=`grep 's/step' $cur_path/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log| head -n 2| awk '{print $4}' | awk -F 's' '{sum+=$1} END {print sum}'` + #输出训练精度,需要模型审视修改 train_accuracy=`grep "Accuracy:" $cur_path/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log | awk -F " " '{print $2}'` #打印,不需要修改 @@ -184,3 +187,4 @@ echo "ActualFPS = ${ActualFPS}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName echo "TrainingTime = ${TrainingTime}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log echo "ActualLoss = ${ActualLoss}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log echo "E2ETrainingTime = ${e2e_time}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log +echo "CompileTime = ${CompileTime}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log diff --git a/TensorFlow/built-in/nlp/Textcnn_ID0123_For_Tensorflow/test/train_RT2_performance_1p.sh b/TensorFlow/built-in/nlp/Textcnn_ID0123_For_Tensorflow/test/train_RT2_performance_1p.sh index a4e4401a5..243e5d7ee 100644 --- a/TensorFlow/built-in/nlp/Textcnn_ID0123_For_Tensorflow/test/train_RT2_performance_1p.sh +++ b/TensorFlow/built-in/nlp/Textcnn_ID0123_For_Tensorflow/test/train_RT2_performance_1p.sh @@ -143,6 +143,9 @@ FPS=`echo "$batch_size $train_time"|awk '{print $1*1000/$2}'` #打印,不需要修改 echo "Final Performance images/sec : $FPS" +#输出CompileTime +CompileTime=`grep 'Time' $cur_path/output/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log| grep "*" | head -n 2| awk '{if (NR>1) print $(NF)}' | cut -d '(' -f2| cut -d ')' -f1` + #输出训练精度,需要模型审视修改 train_accuracy="" #打印,不需要修改 @@ -178,3 +181,4 @@ echo "TrainingTime = ${TrainingTime}" >> $cur_path/output/$ASCEND_DEVICE_ID/${Ca #echo "TrainAccuracy = ${train_accuracy}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log echo "ActualLoss = ${ActualLoss}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log echo "E2ETrainingTime = ${e2e_time}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log +echo "CompileTime = ${CompileTime}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log diff --git a/TensorFlow/built-in/recommendation/DeepCTR_Series_for_TensorFlow/test/train_ID3057_FwFM_performance_1p_RT2.sh b/TensorFlow/built-in/recommendation/DeepCTR_Series_for_TensorFlow/test/train_ID3057_FwFM_performance_1p_RT2.sh index 1628b9c52..869c44ed0 100644 --- a/TensorFlow/built-in/recommendation/DeepCTR_Series_for_TensorFlow/test/train_ID3057_FwFM_performance_1p_RT2.sh +++ b/TensorFlow/built-in/recommendation/DeepCTR_Series_for_TensorFlow/test/train_ID3057_FwFM_performance_1p_RT2.sh @@ -129,6 +129,8 @@ FPS=`awk 'BEGIN{printf "%.2f\n", 1 /'${Time}'*1000000}'` #打印,不需要修改 echo "Final Performance item/sec : $FPS" +#输出CompileTime +CompileTime=`grep '/sample' $cur_path/output/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log| head -n 2| awk '{print $4}' | awk -F 's' '{sum+=$1} END {print sum}'` # #输出训练精度,需要模型审视修改 train_accuracy=`grep "test AUC" ${cur_path}/output/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log|awk '{print $3}'` @@ -166,4 +168,5 @@ echo "TrainAccuracy = ${train_accuracy}" >> $cur_path/output/$ASCEND_DEVICE_ID/$ echo "TrainingTime = ${TrainingTime}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log echo "ActualLoss = ${ActualLoss}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log echo "E2ETrainingTime = ${e2e_time}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log +echo "CompileTime = ${CompileTime}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log diff --git a/TensorFlow/built-in/recommendation/DeepCTR_Series_for_TensorFlow/test/train_ID3058_MMoE_performance_1p_RT2.sh b/TensorFlow/built-in/recommendation/DeepCTR_Series_for_TensorFlow/test/train_ID3058_MMoE_performance_1p_RT2.sh index 91918048a..6ea8b9c07 100644 --- a/TensorFlow/built-in/recommendation/DeepCTR_Series_for_TensorFlow/test/train_ID3058_MMoE_performance_1p_RT2.sh +++ b/TensorFlow/built-in/recommendation/DeepCTR_Series_for_TensorFlow/test/train_ID3058_MMoE_performance_1p_RT2.sh @@ -126,7 +126,7 @@ FPS=`awk 'BEGIN{printf "%.2f\n", 1 /'${Time}'*1000000}'` echo "Final Performance item/sec : $FPS" #输出CompileTime -CompileTime=`cat $cur_path/output/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log|tr -d '\b\r'|grep -Eo "[0-9]*ms/sample"|awk -F "ms/sample" '{print $1}'|awk '{sum+=$1} END {print"",sum/1000}'|awk '{print $1}'` +CompileTime=`grep '/sample' $cur_path/output/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log| head -n 2| awk '{print $4}' | awk -F 's' '{sum+=$1} END {print sum}'` # #输出训练精度,需要模型审视修改 train_accuracy=`grep "test marital AUC" ${cur_path}/output/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log|awk '{print $4}'` diff --git a/TensorFlow/contrib/nlp/texting/texting_ID0193_for_TensorFlow/test/train_RT2_performance_1p.sh b/TensorFlow/contrib/nlp/texting/texting_ID0193_for_TensorFlow/test/train_RT2_performance_1p.sh index 7dd277da3..72d475eeb 100644 --- a/TensorFlow/contrib/nlp/texting/texting_ID0193_for_TensorFlow/test/train_RT2_performance_1p.sh +++ b/TensorFlow/contrib/nlp/texting/texting_ID0193_for_TensorFlow/test/train_RT2_performance_1p.sh @@ -146,6 +146,9 @@ echo "------------------ Final result ------------------" TrainingTime=`grep "time=" $cur_path/output/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log | awk 'END {print $14}'` ActualFPS=`echo "scale=2;${batch_size} / ${TrainingTime}"|bc` +#输出CompileTime +CompileTime=`grep 'time=' $cur_path/output/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log| head -n 2| awk '{sum+=$14} END {print sum}'` + echo "E2E Training Duration sec : $e2e_time" #稳定性精度看护结果汇总 @@ -166,3 +169,4 @@ echo "ActualFPS = ${ActualFPS}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName echo "TrainingTime = ${TrainingTime}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log echo "ActualLoss = ${ActualLoss}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log echo "E2ETrainingTime = ${e2e_time}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log +echo "CompileTime = ${CompileTime}" >> $cur_path/output/$ASCEND_DEVICE_ID/${CaseName}.log -- Gitee