From c857dbb26f07265a74ad506911c96c748c733b57 Mon Sep 17 00:00:00 2001 From: felixhjh <852142024@qq.com> Date: Sun, 14 Nov 2021 03:52:27 +0000 Subject: [PATCH] move util to examples and modify benchmark.sh --- examples/C++/PaddleClas/imagenet/benchmark.sh | 2 +- examples/C++/PaddleClas/resnet_v2_50/benchmark.sh | 2 +- examples/C++/PaddleNLP/bert/benchmark.sh | 2 +- examples/C++/PaddleRec/criteo_ctr/benchmark.sh | 2 +- examples/C++/PaddleRec/criteo_ctr/benchmark_batch.sh | 2 +- examples/C++/fit_a_line/benchmark.sh | 2 +- examples/C++/imdb/benchmark.sh | 2 +- examples/Pipeline/PaddleOCR/ocr/benchmark.sh | 4 ++-- examples/{C++ => }/util/README.md | 0 examples/{C++ => }/util/README_CN.md | 0 examples/{C++ => }/util/get_acc.py | 0 examples/{C++ => }/util/show_profile.py | 0 examples/{C++ => }/util/timeline_trace.py | 0 13 files changed, 9 insertions(+), 9 deletions(-) rename examples/{C++ => }/util/README.md (100%) rename examples/{C++ => }/util/README_CN.md (100%) rename examples/{C++ => }/util/get_acc.py (100%) rename examples/{C++ => }/util/show_profile.py (100%) rename examples/{C++ => }/util/timeline_trace.py (100%) diff --git a/examples/C++/PaddleClas/imagenet/benchmark.sh b/examples/C++/PaddleClas/imagenet/benchmark.sh index 99bda3c8..5287337d 100644 --- a/examples/C++/PaddleClas/imagenet/benchmark.sh +++ b/examples/C++/PaddleClas/imagenet/benchmark.sh @@ -38,7 +38,7 @@ do awk 'BEGIN {max = 0} {if(NR>1){if ($1 > max) max=$1}} END {print "MAX_GPU_MEMORY:", max}' gpu_use.log >> profile_log_$1 awk 'BEGIN {max = 0} {if(NR>1){if ($1 > max) max=$1}} END {print "GPU_UTILIZATION:", max}' gpu_utilization.log >> profile_log_$1 rm -rf gpu_use.log gpu_utilization.log - $PYTHONROOT/bin/python ../util/show_profile.py profile $thread_num >> profile_log + $PYTHONROOT/bin/python ../../../util/show_profile.py profile $thread_num >> profile_log tail -n 8 profile >> profile_log echo "" >> profile_log_$1 done diff --git a/examples/C++/PaddleClas/resnet_v2_50/benchmark.sh b/examples/C++/PaddleClas/resnet_v2_50/benchmark.sh index 0f94276f..c098f8b1 100644 --- a/examples/C++/PaddleClas/resnet_v2_50/benchmark.sh +++ b/examples/C++/PaddleClas/resnet_v2_50/benchmark.sh @@ -46,7 +46,7 @@ do awk 'BEGIN {max = 0} {if(NR>1){if ($1 > max) max=$1}} END {print "MAX_GPU_MEMORY:", max}' gpu_memory_use.log >> profile_log_$1 awk -F" " '{sum+=$1} END {print "GPU_UTILIZATION:", sum/NR, sum, NR }' gpu_utilization.log.tmp >> profile_log_$1 rm -rf gpu_memory_use.log gpu_utilization.log gpu_utilization.log.tmp - python3.6 ../util/show_profile.py profile $thread_num >> profile_log_$1 + python3.6 ../../../util/show_profile.py profile $thread_num >> profile_log_$1 tail -n 10 profile >> profile_log_$1 echo "" >> profile_log_$1 done diff --git a/examples/C++/PaddleNLP/bert/benchmark.sh b/examples/C++/PaddleNLP/bert/benchmark.sh index 7e374db3..a898ef83 100644 --- a/examples/C++/PaddleNLP/bert/benchmark.sh +++ b/examples/C++/PaddleNLP/bert/benchmark.sh @@ -43,7 +43,7 @@ do awk 'BEGIN {max = 0} {if(NR>1){if ($1 > max) max=$1}} END {print "MAX_GPU_MEMORY:", max}' gpu_memory_use.log >> profile_log_$1 awk 'BEGIN {max = 0} {if(NR>1){if ($1 > max) max=$1}} END {print "GPU_UTILIZATION:", max}' gpu_utilization.log >> profile_log_$1 rm -rf gpu_use.log gpu_utilization.log - $PYTHONROOT/bin/python3 ../util/show_profile.py profile $thread_num >> profile_log_$1 + $PYTHONROOT/bin/python3 ../../../util/show_profile.py profile $thread_num >> profile_log_$1 tail -n 8 profile >> profile_log_$1 echo "" >> profile_log_$1 done diff --git a/examples/C++/PaddleRec/criteo_ctr/benchmark.sh b/examples/C++/PaddleRec/criteo_ctr/benchmark.sh index cf7bc6b3..d15fd560 100644 --- a/examples/C++/PaddleRec/criteo_ctr/benchmark.sh +++ b/examples/C++/PaddleRec/criteo_ctr/benchmark.sh @@ -4,6 +4,6 @@ do $PYTHONROOT/bin/python benchmark.py --thread $thread_num --model ctr_client_conf/serving_client_conf.prototxt --request rpc > profile 2>&1 echo "========================================" echo "batch size : $batch_size" >> profile_log - $PYTHONROOT/bin/python ../util/show_profile.py profile $thread_num >> profile_log + $PYTHONROOT/bin/python ../../../util/show_profile.py profile $thread_num >> profile_log tail -n 1 profile >> profile_log done diff --git a/examples/C++/PaddleRec/criteo_ctr/benchmark_batch.sh b/examples/C++/PaddleRec/criteo_ctr/benchmark_batch.sh index 46ba451d..71ce4764 100644 --- a/examples/C++/PaddleRec/criteo_ctr/benchmark_batch.sh +++ b/examples/C++/PaddleRec/criteo_ctr/benchmark_batch.sh @@ -6,7 +6,7 @@ do $PYTHONROOT/bin/python benchmark_batch.py --thread $thread_num --batch_size $batch_size --model serving_client_conf/serving_client_conf.prototxt --request rpc > profile 2>&1 echo "========================================" echo "batch size : $batch_size" >> profile_log - $PYTHONROOT/bin/python ../util/show_profile.py profile $thread_num >> profile_log + $PYTHONROOT/bin/python ../../../util/show_profile.py profile $thread_num >> profile_log tail -n 1 profile >> profile_log done done diff --git a/examples/C++/fit_a_line/benchmark.sh b/examples/C++/fit_a_line/benchmark.sh index 7e374db3..7e23f57c 100644 --- a/examples/C++/fit_a_line/benchmark.sh +++ b/examples/C++/fit_a_line/benchmark.sh @@ -43,7 +43,7 @@ do awk 'BEGIN {max = 0} {if(NR>1){if ($1 > max) max=$1}} END {print "MAX_GPU_MEMORY:", max}' gpu_memory_use.log >> profile_log_$1 awk 'BEGIN {max = 0} {if(NR>1){if ($1 > max) max=$1}} END {print "GPU_UTILIZATION:", max}' gpu_utilization.log >> profile_log_$1 rm -rf gpu_use.log gpu_utilization.log - $PYTHONROOT/bin/python3 ../util/show_profile.py profile $thread_num >> profile_log_$1 + $PYTHONROOT/bin/python3 ../../util/show_profile.py profile $thread_num >> profile_log_$1 tail -n 8 profile >> profile_log_$1 echo "" >> profile_log_$1 done diff --git a/examples/C++/imdb/benchmark.sh b/examples/C++/imdb/benchmark.sh index 7db9a108..33fc5dc8 100644 --- a/examples/C++/imdb/benchmark.sh +++ b/examples/C++/imdb/benchmark.sh @@ -30,7 +30,7 @@ do echo "model_name:$1" >> profile_log_$1 echo "batch_size:$batch_size" >> profile_log_$1 job_et=`date '+%Y%m%d%H%M%S'` - $PYTHONROOT/bin/python3 ../util/show_profile.py profile $thread_num >> profile_log_$1 + $PYTHONROOT/bin/python3 ../../util/show_profile.py profile $thread_num >> profile_log_$1 $PYTHONROOT/bin/python3 cpu_utilization.py >> profile_log_$1 tail -n 8 profile >> profile_log_$1 echo "" >> profile_log_$1 diff --git a/examples/Pipeline/PaddleOCR/ocr/benchmark.sh b/examples/Pipeline/PaddleOCR/ocr/benchmark.sh index e9f3b9eb..ae6027f5 100644 --- a/examples/Pipeline/PaddleOCR/ocr/benchmark.sh +++ b/examples/Pipeline/PaddleOCR/ocr/benchmark.sh @@ -34,7 +34,7 @@ do awk -F' ' '{sum+=$1} END {print "GPU_UTILIZATION:", sum/NR, sum, NR }' gpu_utilization.log.tmp >> profile_log_$modelname # Show profiles - python3 ../../util/show_profile.py profile $thread_num >> profile_log_$modelname + python3 ../../../util/show_profile.py profile $thread_num >> profile_log_$modelname tail -n 8 profile >> profile_log_$modelname echo '' >> profile_log_$modelname done @@ -78,7 +78,7 @@ do awk -F" " '{sum+=$1} END {print "GPU_UTILIZATION:", sum/NR, sum, NR }' gpu_utilization.log.tmp >> profile_log_$modelname # Show profiles - python3 ../../util/show_profile.py profile $thread_num >> profile_log_$modelname + python3 ../../../util/show_profile.py profile $thread_num >> profile_log_$modelname tail -n 8 profile >> profile_log_$modelname echo "" >> profile_log_$modelname done diff --git a/examples/C++/util/README.md b/examples/util/README.md similarity index 100% rename from examples/C++/util/README.md rename to examples/util/README.md diff --git a/examples/C++/util/README_CN.md b/examples/util/README_CN.md similarity index 100% rename from examples/C++/util/README_CN.md rename to examples/util/README_CN.md diff --git a/examples/C++/util/get_acc.py b/examples/util/get_acc.py similarity index 100% rename from examples/C++/util/get_acc.py rename to examples/util/get_acc.py diff --git a/examples/C++/util/show_profile.py b/examples/util/show_profile.py similarity index 100% rename from examples/C++/util/show_profile.py rename to examples/util/show_profile.py diff --git a/examples/C++/util/timeline_trace.py b/examples/util/timeline_trace.py similarity index 100% rename from examples/C++/util/timeline_trace.py rename to examples/util/timeline_trace.py -- GitLab