From 58ba6828f099fff7059df711db9f26efb4986832 Mon Sep 17 00:00:00 2001 From: Stinky-Tofu Date: Fri, 24 Mar 2023 06:28:44 +0000 Subject: [PATCH 01/13] [Benchmark] Stabilize the training speed of bisenetv2 fcn_hrnetw18 ocrnet_hrnetw18 pp_liteseg_stdc1 pp_liteseg_stdc2 --- .gitmodules | 4 ++-- ...etv2_bs2_fp16_DP.sh => bisenetv2_bs4_fp16_DP.sh} | 2 +- ...etv2_bs2_fp32_DP.sh => bisenetv2_bs4_fp32_DP.sh} | 2 +- ...etv2_bs2_fp16_DP.sh => bisenetv2_bs4_fp16_DP.sh} | 2 +- ...etv2_bs2_fp32_DP.sh => bisenetv2_bs4_fp32_DP.sh} | 2 +- ...etv2_bs2_fp16_DP.sh => bisenetv2_bs4_fp16_DP.sh} | 2 +- ...etv2_bs2_fp32_DP.sh => bisenetv2_bs4_fp32_DP.sh} | 2 +- ...etv2_bs2_fp16_DP.sh => bisenetv2_bs4_fp16_DP.sh} | 2 +- ...etv2_bs2_fp32_DP.sh => bisenetv2_bs4_fp32_DP.sh} | 2 +- .../scripts/bisenetv2/benchmark_common/prepare.sh | 13 ++++++++++--- .../scripts/fastscnn/benchmark_common/prepare.sh | 13 ++++++++++--- ...8_bs2_fp16_DP.sh => fcn_hrnetw18_bs4_fp16_DP.sh} | 2 +- ...8_bs2_fp32_DP.sh => fcn_hrnetw18_bs4_fp32_DP.sh} | 2 +- ...8_bs2_fp16_DP.sh => fcn_hrnetw18_bs4_fp16_DP.sh} | 2 +- ...8_bs2_fp32_DP.sh => fcn_hrnetw18_bs4_fp32_DP.sh} | 2 +- ...8_bs2_fp16_DP.sh => fcn_hrnetw18_bs4_fp16_DP.sh} | 2 +- ...8_bs2_fp32_DP.sh => fcn_hrnetw18_bs4_fp32_DP.sh} | 2 +- ...8_bs2_fp16_DP.sh => fcn_hrnetw18_bs4_fp16_DP.sh} | 2 +- ...8_bs2_fp32_DP.sh => fcn_hrnetw18_bs4_fp32_DP.sh} | 2 +- .../fcn_hrnetw18/benchmark_common/prepare.sh | 13 ++++++++++--- .../scripts/mask2former/benchmark_common/prepare.sh | 10 +++++++++- .../scripts/maskformer/benchmark_common/prepare.sh | 9 ++++++++- ...s2_fp16_DP.sh => ocrnet_hrnetw48_bs4_fp16_DP.sh} | 2 +- ...s2_fp32_DP.sh => ocrnet_hrnetw48_bs4_fp32_DP.sh} | 2 +- ...s2_fp16_DP.sh => ocrnet_hrnetw48_bs4_fp16_DP.sh} | 2 +- ...s2_fp32_DP.sh => ocrnet_hrnetw48_bs4_fp32_DP.sh} | 2 +- ...s2_fp16_DP.sh => ocrnet_hrnetw48_bs4_fp16_DP.sh} | 2 +- ...s2_fp32_DP.sh => ocrnet_hrnetw48_bs4_fp32_DP.sh} | 2 +- ...s2_fp16_DP.sh => ocrnet_hrnetw48_bs4_fp16_DP.sh} | 2 +- ...s2_fp32_DP.sh => ocrnet_hrnetw48_bs4_fp32_DP.sh} | 2 +- .../ocrnet_hrnetw48/benchmark_common/prepare.sh | 13 ++++++++++--- .../scripts/stdc_stdc1/benchmark_common/prepare.sh | 13 ++++++++++--- 32 files changed, 93 insertions(+), 43 deletions(-) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/{bisenetv2_bs2_fp16_DP.sh => bisenetv2_bs4_fp16_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/{bisenetv2_bs2_fp32_DP.sh => bisenetv2_bs4_fp32_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/{bisenetv2_bs2_fp16_DP.sh => bisenetv2_bs4_fp16_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/{bisenetv2_bs2_fp32_DP.sh => bisenetv2_bs4_fp32_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/{bisenetv2_bs2_fp16_DP.sh => bisenetv2_bs4_fp16_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/{bisenetv2_bs2_fp32_DP.sh => bisenetv2_bs4_fp32_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/{bisenetv2_bs2_fp16_DP.sh => bisenetv2_bs4_fp16_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/{bisenetv2_bs2_fp32_DP.sh => bisenetv2_bs4_fp32_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/{fcn_hrnetw18_bs2_fp16_DP.sh => fcn_hrnetw18_bs4_fp16_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/{fcn_hrnetw18_bs2_fp32_DP.sh => fcn_hrnetw18_bs4_fp32_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/{fcn_hrnetw18_bs2_fp16_DP.sh => fcn_hrnetw18_bs4_fp16_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/{fcn_hrnetw18_bs2_fp32_DP.sh => fcn_hrnetw18_bs4_fp32_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/{fcn_hrnetw18_bs2_fp16_DP.sh => fcn_hrnetw18_bs4_fp16_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/{fcn_hrnetw18_bs2_fp32_DP.sh => fcn_hrnetw18_bs4_fp32_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/{fcn_hrnetw18_bs2_fp16_DP.sh => fcn_hrnetw18_bs4_fp16_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/{fcn_hrnetw18_bs2_fp32_DP.sh => fcn_hrnetw18_bs4_fp32_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/{ocrnet_hrnetw48_bs2_fp16_DP.sh => ocrnet_hrnetw48_bs4_fp16_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/{ocrnet_hrnetw48_bs2_fp32_DP.sh => ocrnet_hrnetw48_bs4_fp32_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/{ocrnet_hrnetw48_bs2_fp16_DP.sh => ocrnet_hrnetw48_bs4_fp16_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/{ocrnet_hrnetw48_bs2_fp32_DP.sh => ocrnet_hrnetw48_bs4_fp32_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/{ocrnet_hrnetw48_bs2_fp16_DP.sh => ocrnet_hrnetw48_bs4_fp16_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/{ocrnet_hrnetw48_bs2_fp32_DP.sh => ocrnet_hrnetw48_bs4_fp32_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/{ocrnet_hrnetw48_bs2_fp16_DP.sh => ocrnet_hrnetw48_bs4_fp16_DP.sh} (95%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/{ocrnet_hrnetw48_bs2_fp32_DP.sh => ocrnet_hrnetw48_bs4_fp32_DP.sh} (95%) diff --git a/.gitmodules b/.gitmodules index 9032c6cfc5..93ed35b1a1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -124,10 +124,10 @@ branch = main [submodule "frame_benchmark/pytorch/dynamic/PaddleSeg/models/Mask2Former"] path = frame_benchmark/pytorch/dynamic/PaddleSeg/models/Mask2Former - url = git@github.com:facebookresearch/Mask2Former.git + url = https://github.com/facebookresearch/Mask2Former.git [submodule "frame_benchmark/pytorch/dynamic/PaddleSeg/models/MaskFormer"] path = frame_benchmark/pytorch/dynamic/PaddleSeg/models/MaskFormer - url = git@github.com:facebookresearch/MaskFormer.git + url = https://github.com/facebookresearch/MaskFormer.git [submodule "frame_benchmark/pytorch/dynamic/PaddleDetection/models/detrex"] path = frame_benchmark/pytorch/dynamic/PaddleDetection/models/detrex url = https://github.com/PaddleBenchmark/detrex.git diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp16_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp16_DP.sh index 81f08e3afd..6da871cf28 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp16_DP.sh @@ -1,5 +1,5 @@ model_item="bisenetv2" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C1 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp32_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp32_DP.sh index 3b21a31082..2396333b5f 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp32_DP.sh @@ -1,5 +1,5 @@ model_item="bisenetv2" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C1 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp16_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp16_DP.sh index 6601841b6a..e2ee1b2ad6 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp16_DP.sh @@ -1,5 +1,5 @@ model_item="bisenetv2" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C4 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp32_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp32_DP.sh index 7d09d29fcf..1b957dd62d 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp32_DP.sh @@ -1,5 +1,5 @@ model_item="bisenetv2" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C4 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp16_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp16_DP.sh index 69bcf082d8..de9619fb87 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp16_DP.sh @@ -1,5 +1,5 @@ model_item="bisenetv2" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C8 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp32_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp32_DP.sh index be46a1143d..eb46596e8e 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp32_DP.sh @@ -1,5 +1,5 @@ model_item="bisenetv2" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C8 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp16_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp16_DP.sh index 96c6ace954..5b69dad1cc 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp16_DP.sh @@ -1,5 +1,5 @@ model_item="bisenetv2" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N4C32 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp32_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp32_DP.sh index 540b07c958..13d4b725ec 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp32_DP.sh @@ -1,5 +1,5 @@ model_item="bisenetv2" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N4C32 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh index f9b7e125d1..835f7ebe32 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh @@ -4,13 +4,20 @@ echo "******* install enviroments for benchmark ***********" echo `pip --version` if [ ! -f "torch_dev_whls.tar" ];then + unset https_proxy && unset http_proxy wget ${FLAG_TORCH_WHL_URL} fi tar -xf torch_dev_whls.tar -pip install torch_dev_whls/* -pip install mmcv-full==1.7.1 -i https://pypi.tuna.tsinghua.edu.cn/simple +export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +for whl_file in torch_dev_whls/* +do + pip install ${whl_file} +done +unset https_proxy && unset http_proxy +pip install ninja -i https://pypi.tuna.tsinghua.edu.cn/simple +pip install -v mmcv-full==1.7.1 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple -pip install -e . +pip install -v -e . echo "******* prepare dataset for benchmark ***********" if [ ! -f "mmseg_benchmark_configs.zip" ];then diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/prepare.sh index f9b7e125d1..835f7ebe32 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/prepare.sh @@ -4,13 +4,20 @@ echo "******* install enviroments for benchmark ***********" echo `pip --version` if [ ! -f "torch_dev_whls.tar" ];then + unset https_proxy && unset http_proxy wget ${FLAG_TORCH_WHL_URL} fi tar -xf torch_dev_whls.tar -pip install torch_dev_whls/* -pip install mmcv-full==1.7.1 -i https://pypi.tuna.tsinghua.edu.cn/simple +export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +for whl_file in torch_dev_whls/* +do + pip install ${whl_file} +done +unset https_proxy && unset http_proxy +pip install ninja -i https://pypi.tuna.tsinghua.edu.cn/simple +pip install -v mmcv-full==1.7.1 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple -pip install -e . +pip install -v -e . echo "******* prepare dataset for benchmark ***********" if [ ! -f "mmseg_benchmark_configs.zip" ];then diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/fcn_hrnetw18_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/fcn_hrnetw18_bs4_fp16_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/fcn_hrnetw18_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/fcn_hrnetw18_bs4_fp16_DP.sh index 1b37762dcf..c6a6e1c55e 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/fcn_hrnetw18_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/fcn_hrnetw18_bs4_fp16_DP.sh @@ -1,5 +1,5 @@ model_item="fcn_hrnetw18" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C1 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/fcn_hrnetw18_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/fcn_hrnetw18_bs4_fp32_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/fcn_hrnetw18_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/fcn_hrnetw18_bs4_fp32_DP.sh index 261daa6fb9..e9819b8d11 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/fcn_hrnetw18_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C1/fcn_hrnetw18_bs4_fp32_DP.sh @@ -1,5 +1,5 @@ model_item="fcn_hrnetw18" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C1 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/fcn_hrnetw18_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/fcn_hrnetw18_bs4_fp16_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/fcn_hrnetw18_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/fcn_hrnetw18_bs4_fp16_DP.sh index 4707a6d55c..0fe80ddd5c 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/fcn_hrnetw18_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/fcn_hrnetw18_bs4_fp16_DP.sh @@ -1,5 +1,5 @@ model_item="fcn_hrnetw18" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C4 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/fcn_hrnetw18_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/fcn_hrnetw18_bs4_fp32_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/fcn_hrnetw18_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/fcn_hrnetw18_bs4_fp32_DP.sh index 8f9b73a2f5..04fd35df66 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/fcn_hrnetw18_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C4/fcn_hrnetw18_bs4_fp32_DP.sh @@ -1,5 +1,5 @@ model_item="fcn_hrnetw18" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C4 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/fcn_hrnetw18_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/fcn_hrnetw18_bs4_fp16_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/fcn_hrnetw18_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/fcn_hrnetw18_bs4_fp16_DP.sh index f961490b85..2ec82a9124 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/fcn_hrnetw18_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/fcn_hrnetw18_bs4_fp16_DP.sh @@ -1,5 +1,5 @@ model_item="fcn_hrnetw18" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C8 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/fcn_hrnetw18_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/fcn_hrnetw18_bs4_fp32_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/fcn_hrnetw18_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/fcn_hrnetw18_bs4_fp32_DP.sh index 596286745e..2b35a4fd6a 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/fcn_hrnetw18_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N1C8/fcn_hrnetw18_bs4_fp32_DP.sh @@ -1,5 +1,5 @@ model_item="fcn_hrnetw18" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C8 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/fcn_hrnetw18_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/fcn_hrnetw18_bs4_fp16_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/fcn_hrnetw18_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/fcn_hrnetw18_bs4_fp16_DP.sh index 31a77dad58..ddc0e0e0af 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/fcn_hrnetw18_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/fcn_hrnetw18_bs4_fp16_DP.sh @@ -1,5 +1,5 @@ model_item="fcn_hrnetw18" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N4C32 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/fcn_hrnetw18_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/fcn_hrnetw18_bs4_fp32_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/fcn_hrnetw18_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/fcn_hrnetw18_bs4_fp32_DP.sh index 9eff0a2386..4a44437835 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/fcn_hrnetw18_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/N4C32/fcn_hrnetw18_bs4_fp32_DP.sh @@ -1,5 +1,5 @@ model_item="fcn_hrnetw18" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N4C32 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/prepare.sh index f9b7e125d1..835f7ebe32 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/prepare.sh @@ -4,13 +4,20 @@ echo "******* install enviroments for benchmark ***********" echo `pip --version` if [ ! -f "torch_dev_whls.tar" ];then + unset https_proxy && unset http_proxy wget ${FLAG_TORCH_WHL_URL} fi tar -xf torch_dev_whls.tar -pip install torch_dev_whls/* -pip install mmcv-full==1.7.1 -i https://pypi.tuna.tsinghua.edu.cn/simple +export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +for whl_file in torch_dev_whls/* +do + pip install ${whl_file} +done +unset https_proxy && unset http_proxy +pip install ninja -i https://pypi.tuna.tsinghua.edu.cn/simple +pip install -v mmcv-full==1.7.1 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple -pip install -e . +pip install -v -e . echo "******* prepare dataset for benchmark ***********" if [ ! -f "mmseg_benchmark_configs.zip" ];then diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/prepare.sh index c8422d01f5..4963692860 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/prepare.sh @@ -4,13 +4,21 @@ echo "******* install enviroments for benchmark ***********" echo `pip --version` if [ ! -f "torch_dev_whls.tar" ];then + unset https_proxy && unset http_proxy wget ${FLAG_TORCH_WHL_URL} fi tar -xf torch_dev_whls.tar -pip install torch_dev_whls/* +export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +for whl_file in torch_dev_whls/* +do + pip install ${whl_file} +done +export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} git clone https://github.com/facebookresearch/detectron2.git python -m pip install -e detectron2 +pip install git+https://github.com/cocodataset/panopticapi.git +unset https_proxy && unset http_proxy pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple cd mask2former/modeling/pixel_decoder/ops sh make.sh diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/prepare.sh index 33991788d2..dfc2255d21 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/prepare.sh @@ -4,13 +4,20 @@ echo "******* install enviroments for benchmark ***********" echo `pip --version` if [ ! -f "torch_dev_whls.tar" ];then + unset https_proxy && unset http_proxy wget ${FLAG_TORCH_WHL_URL} fi tar -xf torch_dev_whls.tar -pip install torch_dev_whls/* +export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +for whl_file in torch_dev_whls/* +do + pip install ${whl_file} +done +export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} git clone https://github.com/facebookresearch/detectron2.git python -m pip install -e detectron2 +unset https_proxy && unset http_proxy pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple echo "******* prepare dataset for benchmark ***********" diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/ocrnet_hrnetw48_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/ocrnet_hrnetw48_bs4_fp16_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/ocrnet_hrnetw48_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/ocrnet_hrnetw48_bs4_fp16_DP.sh index 7e3daba9f3..cb02affa88 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/ocrnet_hrnetw48_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/ocrnet_hrnetw48_bs4_fp16_DP.sh @@ -1,5 +1,5 @@ model_item="ocrnet_hrnetw48" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C1 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/ocrnet_hrnetw48_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/ocrnet_hrnetw48_bs4_fp32_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/ocrnet_hrnetw48_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/ocrnet_hrnetw48_bs4_fp32_DP.sh index 400d041240..55efc8aa9d 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/ocrnet_hrnetw48_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C1/ocrnet_hrnetw48_bs4_fp32_DP.sh @@ -1,5 +1,5 @@ model_item="ocrnet_hrnetw48" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C1 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/ocrnet_hrnetw48_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/ocrnet_hrnetw48_bs4_fp16_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/ocrnet_hrnetw48_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/ocrnet_hrnetw48_bs4_fp16_DP.sh index 2d8644a978..482ef04733 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/ocrnet_hrnetw48_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/ocrnet_hrnetw48_bs4_fp16_DP.sh @@ -1,5 +1,5 @@ model_item="ocrnet_hrnetw48" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C4 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/ocrnet_hrnetw48_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/ocrnet_hrnetw48_bs4_fp32_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/ocrnet_hrnetw48_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/ocrnet_hrnetw48_bs4_fp32_DP.sh index ecce509c12..ea65e099d3 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/ocrnet_hrnetw48_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C4/ocrnet_hrnetw48_bs4_fp32_DP.sh @@ -1,5 +1,5 @@ model_item="ocrnet_hrnetw48" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C4 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/ocrnet_hrnetw48_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/ocrnet_hrnetw48_bs4_fp16_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/ocrnet_hrnetw48_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/ocrnet_hrnetw48_bs4_fp16_DP.sh index 94e92254b4..5d2186d2de 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/ocrnet_hrnetw48_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/ocrnet_hrnetw48_bs4_fp16_DP.sh @@ -1,5 +1,5 @@ model_item="ocrnet_hrnetw48" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C8 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/ocrnet_hrnetw48_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/ocrnet_hrnetw48_bs4_fp32_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/ocrnet_hrnetw48_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/ocrnet_hrnetw48_bs4_fp32_DP.sh index 328cd366b0..e73a67dd94 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/ocrnet_hrnetw48_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N1C8/ocrnet_hrnetw48_bs4_fp32_DP.sh @@ -1,5 +1,5 @@ model_item="ocrnet_hrnetw48" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C8 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/ocrnet_hrnetw48_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/ocrnet_hrnetw48_bs4_fp16_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/ocrnet_hrnetw48_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/ocrnet_hrnetw48_bs4_fp16_DP.sh index 86073164f9..e5973b400a 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/ocrnet_hrnetw48_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/ocrnet_hrnetw48_bs4_fp16_DP.sh @@ -1,5 +1,5 @@ model_item="ocrnet_hrnetw48" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N4C32 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/ocrnet_hrnetw48_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/ocrnet_hrnetw48_bs4_fp32_DP.sh similarity index 95% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/ocrnet_hrnetw48_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/ocrnet_hrnetw48_bs4_fp32_DP.sh index 3465fb7516..b48e185d1c 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/ocrnet_hrnetw48_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/N4C32/ocrnet_hrnetw48_bs4_fp32_DP.sh @@ -1,5 +1,5 @@ model_item="ocrnet_hrnetw48" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N4C32 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/prepare.sh index f9b7e125d1..835f7ebe32 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/prepare.sh @@ -4,13 +4,20 @@ echo "******* install enviroments for benchmark ***********" echo `pip --version` if [ ! -f "torch_dev_whls.tar" ];then + unset https_proxy && unset http_proxy wget ${FLAG_TORCH_WHL_URL} fi tar -xf torch_dev_whls.tar -pip install torch_dev_whls/* -pip install mmcv-full==1.7.1 -i https://pypi.tuna.tsinghua.edu.cn/simple +export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +for whl_file in torch_dev_whls/* +do + pip install ${whl_file} +done +unset https_proxy && unset http_proxy +pip install ninja -i https://pypi.tuna.tsinghua.edu.cn/simple +pip install -v mmcv-full==1.7.1 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple -pip install -e . +pip install -v -e . echo "******* prepare dataset for benchmark ***********" if [ ! -f "mmseg_benchmark_configs.zip" ];then diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/prepare.sh index f9b7e125d1..835f7ebe32 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/prepare.sh @@ -4,13 +4,20 @@ echo "******* install enviroments for benchmark ***********" echo `pip --version` if [ ! -f "torch_dev_whls.tar" ];then + unset https_proxy && unset http_proxy wget ${FLAG_TORCH_WHL_URL} fi tar -xf torch_dev_whls.tar -pip install torch_dev_whls/* -pip install mmcv-full==1.7.1 -i https://pypi.tuna.tsinghua.edu.cn/simple +export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +for whl_file in torch_dev_whls/* +do + pip install ${whl_file} +done +unset https_proxy && unset http_proxy +pip install ninja -i https://pypi.tuna.tsinghua.edu.cn/simple +pip install -v mmcv-full==1.7.1 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple -pip install -e . +pip install -v -e . echo "******* prepare dataset for benchmark ***********" if [ ! -f "mmseg_benchmark_configs.zip" ];then From 81fac72aa4176f4d07d9889df130c6ed3e14376c Mon Sep 17 00:00:00 2001 From: Stinky-Tofu Date: Wed, 29 Mar 2023 05:38:11 +0000 Subject: [PATCH 02/13] [Benchmark]Add vit_adapter and stabilize the training speed of paddleSeg model --- .gitmodules | 3 + .../dynamic/PaddleSeg/models/ViT-Adapter | 1 + .../bisenetv2/N1C1/bisenetv2_bs4_fp16_DP.sh | 2 +- .../bisenetv2/N1C1/bisenetv2_bs4_fp32_DP.sh | 2 +- .../bisenetv2/N1C4/bisenetv2_bs4_fp16_DP.sh | 2 +- .../bisenetv2/N1C4/bisenetv2_bs4_fp32_DP.sh | 2 +- .../bisenetv2/N1C8/bisenetv2_bs4_fp16_DP.sh | 2 +- .../bisenetv2/N1C8/bisenetv2_bs4_fp32_DP.sh | 2 +- .../bisenetv2/N4C32/bisenetv2_bs4_fp16_DP.sh | 2 +- .../bisenetv2/N4C32/bisenetv2_bs4_fp32_DP.sh | 2 +- .../benchmark_common/run_benchmark.sh | 2 +- ...bs2_fp16_DP.sh => fastscnn_bs4_fp16_DP.sh} | 4 +- ...bs2_fp32_DP.sh => fastscnn_bs4_fp32_DP.sh} | 4 +- ...bs2_fp16_DP.sh => fastscnn_bs4_fp16_DP.sh} | 4 +- ...bs2_fp32_DP.sh => fastscnn_bs4_fp32_DP.sh} | 4 +- ...bs2_fp16_DP.sh => fastscnn_bs4_fp16_DP.sh} | 4 +- ...bs2_fp32_DP.sh => fastscnn_bs4_fp32_DP.sh} | 4 +- ...bs2_fp16_DP.sh => fastscnn_bs4_fp16_DP.sh} | 4 +- ...bs2_fp32_DP.sh => fastscnn_bs4_fp32_DP.sh} | 4 +- .../benchmark_common/run_benchmark.sh | 2 +- .../benchmark_common/run_benchmark.sh | 2 +- ..._fp16_DP.sh => mask2former_bs4_fp16_DP.sh} | 6 +- ..._fp32_DP.sh => mask2former_bs4_fp32_DP.sh} | 6 +- ..._fp16_DP.sh => mask2former_bs4_fp16_DP.sh} | 6 +- ..._fp32_DP.sh => mask2former_bs4_fp32_DP.sh} | 6 +- .../mask2former/benchmark_common/prepare.sh | 14 +-- .../benchmark_common/run_benchmark.sh | 2 +- ...2_fp16_DP.sh => maskformer_bs4_fp16_DP.sh} | 4 +- ...2_fp32_DP.sh => maskformer_bs4_fp32_DP.sh} | 4 +- ...2_fp16_DP.sh => maskformer_bs4_fp16_DP.sh} | 4 +- ...2_fp32_DP.sh => maskformer_bs4_fp32_DP.sh} | 4 +- ...2_fp16_DP.sh => maskformer_bs4_fp16_DP.sh} | 4 +- ...2_fp32_DP.sh => maskformer_bs4_fp32_DP.sh} | 4 +- ...2_fp16_DP.sh => maskformer_bs4_fp16_DP.sh} | 4 +- ...2_fp32_DP.sh => maskformer_bs4_fp32_DP.sh} | 4 +- .../benchmark_common/run_benchmark.sh | 2 +- .../benchmark_common/run_benchmark.sh | 2 +- ...2_fp16_DP.sh => stdc_stdc1_bs4_fp16_DP.sh} | 4 +- ...2_fp32_DP.sh => stdc_stdc1_bs4_fp32_DP.sh} | 4 +- ...2_fp16_DP.sh => stdc_stdc1_bs4_fp16_DP.sh} | 4 +- ...2_fp32_DP.sh => stdc_stdc1_bs4_fp32_DP.sh} | 4 +- ...2_fp16_DP.sh => stdc_stdc1_bs4_fp16_DP.sh} | 4 +- ...2_fp32_DP.sh => stdc_stdc1_bs4_fp32_DP.sh} | 4 +- ...2_fp16_DP.sh => stdc_stdc1_bs4_fp16_DP.sh} | 4 +- ...2_fp32_DP.sh => stdc_stdc1_bs4_fp32_DP.sh} | 4 +- .../benchmark_common/run_benchmark.sh | 2 +- .../N1C1/vit_adapter_bs4_fp16_DP.sh | 11 ++ .../N1C1/vit_adapter_bs4_fp32_DP.sh | 11 ++ .../N1C4/vit_adapter_bs4_fp16_DP.sh | 11 ++ .../N1C4/vit_adapter_bs4_fp32_DP.sh | 11 ++ .../N1C8/vit_adapter_bs4_fp16_DP.sh | 11 ++ .../N1C8/vit_adapter_bs4_fp32_DP.sh | 11 ++ .../N4C32/vit_adapter_bs4_fp16_DP.sh | 11 ++ .../N4C32/vit_adapter_bs4_fp32_DP.sh | 11 ++ .../benchmark_common/analysis_log.py | 73 ++++++++++++ .../benchmark_common/detect_cuda.cu | 16 +++ .../benchmark_common/dist_train.sh | 21 ++++ .../vit_adapter/benchmark_common/prepare.sh | 27 +++++ .../benchmark_common/run_benchmark.sh | 111 ++++++++++++++++++ 59 files changed, 419 insertions(+), 85 deletions(-) create mode 160000 frame_benchmark/pytorch/dynamic/PaddleSeg/models/ViT-Adapter rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/{fastscnn_bs2_fp16_DP.sh => fastscnn_bs4_fp16_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/{fastscnn_bs2_fp32_DP.sh => fastscnn_bs4_fp32_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/{fastscnn_bs2_fp16_DP.sh => fastscnn_bs4_fp16_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/{fastscnn_bs2_fp32_DP.sh => fastscnn_bs4_fp32_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/{fastscnn_bs2_fp16_DP.sh => fastscnn_bs4_fp16_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/{fastscnn_bs2_fp32_DP.sh => fastscnn_bs4_fp32_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/{fastscnn_bs2_fp16_DP.sh => fastscnn_bs4_fp16_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/{fastscnn_bs2_fp32_DP.sh => fastscnn_bs4_fp32_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/{mask2former_bs1_fp16_DP.sh => mask2former_bs4_fp16_DP.sh} (88%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/{mask2former_bs1_fp32_DP.sh => mask2former_bs4_fp32_DP.sh} (88%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/{mask2former_bs1_fp16_DP.sh => mask2former_bs4_fp16_DP.sh} (88%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/{mask2former_bs1_fp32_DP.sh => mask2former_bs4_fp32_DP.sh} (88%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/{maskformer_bs2_fp16_DP.sh => maskformer_bs4_fp16_DP.sh} (92%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/{maskformer_bs2_fp32_DP.sh => maskformer_bs4_fp32_DP.sh} (92%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/{maskformer_bs2_fp16_DP.sh => maskformer_bs4_fp16_DP.sh} (92%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/{maskformer_bs2_fp32_DP.sh => maskformer_bs4_fp32_DP.sh} (92%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/{maskformer_bs2_fp16_DP.sh => maskformer_bs4_fp16_DP.sh} (92%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/{maskformer_bs2_fp32_DP.sh => maskformer_bs4_fp32_DP.sh} (92%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/{maskformer_bs2_fp16_DP.sh => maskformer_bs4_fp16_DP.sh} (92%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/{maskformer_bs2_fp32_DP.sh => maskformer_bs4_fp32_DP.sh} (92%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/{stdc_stdc1_bs2_fp16_DP.sh => stdc_stdc1_bs4_fp16_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/{stdc_stdc1_bs2_fp32_DP.sh => stdc_stdc1_bs4_fp32_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/{stdc_stdc1_bs2_fp16_DP.sh => stdc_stdc1_bs4_fp16_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/{stdc_stdc1_bs2_fp32_DP.sh => stdc_stdc1_bs4_fp32_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/{stdc_stdc1_bs2_fp16_DP.sh => stdc_stdc1_bs4_fp16_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/{stdc_stdc1_bs2_fp32_DP.sh => stdc_stdc1_bs4_fp32_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/{stdc_stdc1_bs2_fp16_DP.sh => stdc_stdc1_bs4_fp16_DP.sh} (89%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/{stdc_stdc1_bs2_fp32_DP.sh => stdc_stdc1_bs4_fp32_DP.sh} (89%) create mode 100644 frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C1/vit_adapter_bs4_fp16_DP.sh create mode 100644 frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C1/vit_adapter_bs4_fp32_DP.sh create mode 100644 frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C4/vit_adapter_bs4_fp16_DP.sh create mode 100644 frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C4/vit_adapter_bs4_fp32_DP.sh create mode 100644 frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C8/vit_adapter_bs4_fp16_DP.sh create mode 100644 frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C8/vit_adapter_bs4_fp32_DP.sh create mode 100644 frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N4C32/vit_adapter_bs4_fp16_DP.sh create mode 100644 frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N4C32/vit_adapter_bs4_fp32_DP.sh create mode 100644 frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/analysis_log.py create mode 100755 frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/detect_cuda.cu create mode 100755 frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/dist_train.sh create mode 100755 frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/prepare.sh create mode 100644 frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/run_benchmark.sh diff --git a/.gitmodules b/.gitmodules index 93ed35b1a1..4b4acdd066 100644 --- a/.gitmodules +++ b/.gitmodules @@ -132,3 +132,6 @@ path = frame_benchmark/pytorch/dynamic/PaddleDetection/models/detrex url = https://github.com/PaddleBenchmark/detrex.git branch = main +[submodule "frame_benchmark/pytorch/dynamic/PaddleSeg/models/ViT-Adapter"] + path = frame_benchmark/pytorch/dynamic/PaddleSeg/models/ViT-Adapter + url = https://github.com/czczup/ViT-Adapter.git diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/models/ViT-Adapter b/frame_benchmark/pytorch/dynamic/PaddleSeg/models/ViT-Adapter new file mode 160000 index 0000000000..f7bdefdf12 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/models/ViT-Adapter @@ -0,0 +1 @@ +Subproject commit f7bdefdf126b7a407f7f6cf595eb1cc7436bc5a4 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp16_DP.sh index 6da871cf28..220e527782 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp16_DP.sh @@ -4,7 +4,7 @@ fp_item=fp16 run_mode=DP device_num=N1C1 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp32_DP.sh index 2396333b5f..97fc3ab11d 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C1/bisenetv2_bs4_fp32_DP.sh @@ -4,7 +4,7 @@ fp_item=fp32 run_mode=DP device_num=N1C1 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp16_DP.sh index e2ee1b2ad6..2601dfb45b 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp16_DP.sh @@ -4,7 +4,7 @@ fp_item=fp16 run_mode=DP device_num=N1C4 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp32_DP.sh index 1b957dd62d..5d196d0044 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C4/bisenetv2_bs4_fp32_DP.sh @@ -4,7 +4,7 @@ fp_item=fp32 run_mode=DP device_num=N1C4 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp16_DP.sh index de9619fb87..06cac03c3c 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp16_DP.sh @@ -4,7 +4,7 @@ fp_item=fp16 run_mode=DP device_num=N1C8 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp32_DP.sh index eb46596e8e..eed60b60f2 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N1C8/bisenetv2_bs4_fp32_DP.sh @@ -4,7 +4,7 @@ fp_item=fp32 run_mode=DP device_num=N1C8 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp16_DP.sh index 5b69dad1cc..59580651fb 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp16_DP.sh @@ -4,7 +4,7 @@ fp_item=fp16 run_mode=DP device_num=N4C32 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp32_DP.sh index 13d4b725ec..b841cea49a 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/N4C32/bisenetv2_bs4_fp32_DP.sh @@ -4,7 +4,7 @@ fp_item=fp32 run_mode=DP device_num=N4C32 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/run_benchmark.sh index b12d56b30b..5713e905be 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/run_benchmark.sh @@ -5,7 +5,7 @@ # Usage: CUDA_VISIBLE_DEVICES=xxx bash run_benchmark.sh ${model_name} ${run_mode} ${fp_item} ${bs_item} ${max_iter} ${num_workers} function _set_params(){ - model_item=${1:-"model_item"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 + model_item=${1:-"bisenetv2"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 base_batch_size=${2:-"2"} # (必选) 每张卡上的batch_size fp_item=${3:-"fp32"} # (必选) fp32|fp16 run_mode=${4:-"DP"} # (必选) MP模型并行|DP数据并行|PP流水线并行|混合并行DP1-MP1-PP1|DP1-MP4-PP1 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/fastscnn_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/fastscnn_bs4_fp16_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/fastscnn_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/fastscnn_bs4_fp16_DP.sh index fb9dbd637c..33f9e9a962 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/fastscnn_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/fastscnn_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="fastscnn" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C1 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/fastscnn_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/fastscnn_bs4_fp32_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/fastscnn_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/fastscnn_bs4_fp32_DP.sh index a367a39692..649ec9c98b 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/fastscnn_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C1/fastscnn_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="fastscnn" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C1 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/fastscnn_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/fastscnn_bs4_fp16_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/fastscnn_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/fastscnn_bs4_fp16_DP.sh index 75db0a9f81..4619f7838b 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/fastscnn_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/fastscnn_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="fastscnn" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C4 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/fastscnn_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/fastscnn_bs4_fp32_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/fastscnn_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/fastscnn_bs4_fp32_DP.sh index a05541fffc..d187c2e0ac 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/fastscnn_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C4/fastscnn_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="fastscnn" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C4 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/fastscnn_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/fastscnn_bs4_fp16_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/fastscnn_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/fastscnn_bs4_fp16_DP.sh index 7311461985..069b142293 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/fastscnn_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/fastscnn_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="fastscnn" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C8 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/fastscnn_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/fastscnn_bs4_fp32_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/fastscnn_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/fastscnn_bs4_fp32_DP.sh index a6cb9fbeb5..6932f51b13 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/fastscnn_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N1C8/fastscnn_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="fastscnn" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C8 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/fastscnn_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/fastscnn_bs4_fp16_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/fastscnn_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/fastscnn_bs4_fp16_DP.sh index efd6dce457..fda4841c10 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/fastscnn_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/fastscnn_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="fastscnn" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N4C32 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/fastscnn_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/fastscnn_bs4_fp32_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/fastscnn_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/fastscnn_bs4_fp32_DP.sh index e2c4b96f2b..5702ed676f 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/fastscnn_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/N4C32/fastscnn_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="fastscnn" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N4C32 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/run_benchmark.sh index b12d56b30b..fdb656f97b 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/run_benchmark.sh @@ -5,7 +5,7 @@ # Usage: CUDA_VISIBLE_DEVICES=xxx bash run_benchmark.sh ${model_name} ${run_mode} ${fp_item} ${bs_item} ${max_iter} ${num_workers} function _set_params(){ - model_item=${1:-"model_item"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 + model_item=${1:-"fastscnn"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 base_batch_size=${2:-"2"} # (必选) 每张卡上的batch_size fp_item=${3:-"fp32"} # (必选) fp32|fp16 run_mode=${4:-"DP"} # (必选) MP模型并行|DP数据并行|PP流水线并行|混合并行DP1-MP1-PP1|DP1-MP4-PP1 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/run_benchmark.sh index b12d56b30b..14c751e288 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/run_benchmark.sh @@ -5,7 +5,7 @@ # Usage: CUDA_VISIBLE_DEVICES=xxx bash run_benchmark.sh ${model_name} ${run_mode} ${fp_item} ${bs_item} ${max_iter} ${num_workers} function _set_params(){ - model_item=${1:-"model_item"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 + model_item=${1:-"fcn_hrnetw18"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 base_batch_size=${2:-"2"} # (必选) 每张卡上的batch_size fp_item=${3:-"fp32"} # (必选) fp32|fp16 run_mode=${4:-"DP"} # (必选) MP模型并行|DP数据并行|PP流水线并行|混合并行DP1-MP1-PP1|DP1-MP4-PP1 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/mask2former_bs1_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/mask2former_bs4_fp16_DP.sh similarity index 88% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/mask2former_bs1_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/mask2former_bs4_fp16_DP.sh index 6d71675c18..fb28a7700e 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/mask2former_bs1_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/mask2former_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="mask2former" -bs_item=1 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C1 -max_iter=600 -num_workers=8 +max_iter=400 +num_workers=24 train_config=configs/coco/panoptic-segmentation/maskformer2_R50_bs16_50ep.yaml bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/mask2former_bs1_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/mask2former_bs4_fp32_DP.sh similarity index 88% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/mask2former_bs1_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/mask2former_bs4_fp32_DP.sh index 9aa92fa12a..8974f46d94 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/mask2former_bs1_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C1/mask2former_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="mask2former" -bs_item=1 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C1 -max_iter=600 -num_workers=8 +max_iter=400 +num_workers=24 train_config=configs/coco/panoptic-segmentation/maskformer2_R50_bs16_50ep.yaml bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/mask2former_bs1_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/mask2former_bs4_fp16_DP.sh similarity index 88% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/mask2former_bs1_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/mask2former_bs4_fp16_DP.sh index bfcd01f06f..310c0766f2 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/mask2former_bs1_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/mask2former_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="mask2former" -bs_item=1 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C4 -max_iter=600 -num_workers=8 +max_iter=400 +num_workers=24 train_config=configs/coco/panoptic-segmentation/maskformer2_R50_bs16_50ep.yaml bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/mask2former_bs1_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/mask2former_bs4_fp32_DP.sh similarity index 88% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/mask2former_bs1_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/mask2former_bs4_fp32_DP.sh index 69a537c0a2..4d3f34e3d9 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/mask2former_bs1_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C4/mask2former_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="mask2former" -bs_item=1 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C4 -max_iter=600 -num_workers=8 +max_iter=400 +num_workers=24 train_config=configs/coco/panoptic-segmentation/maskformer2_R50_bs16_50ep.yaml bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/prepare.sh index 4963692860..06e667b144 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/prepare.sh @@ -3,16 +3,10 @@ echo "******* install enviroments for benchmark ***********" echo `pip --version` -if [ ! -f "torch_dev_whls.tar" ];then - unset https_proxy && unset http_proxy - wget ${FLAG_TORCH_WHL_URL} -fi -tar -xf torch_dev_whls.tar -export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} -for whl_file in torch_dev_whls/* -do - pip install ${whl_file} -done + +unset https_proxy && unset http_proxy +pip install torch==1.13.0+cu117 torchvision==0.14.0+cu117 -f https://download.pytorch.org/whl/torch_stable.html +pip install -U opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} git clone https://github.com/facebookresearch/detectron2.git diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/run_benchmark.sh index 5127c4195b..01087b64e3 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/run_benchmark.sh @@ -5,7 +5,7 @@ # Usage: CUDA_VISIBLE_DEVICES=xxx bash run_benchmark.sh ${model_name} ${run_mode} ${fp_item} ${bs_item} ${max_iter} ${num_workers} function _set_params(){ - model_item=${1:-"model_item"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 + model_item=${1:-"mask2former"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 base_batch_size=${2:-"2"} # (必选) 每张卡上的batch_size fp_item=${3:-"fp32"} # (必选) fp32|fp16 run_mode=${4:-"DP"} # (必选) MP模型并行|DP数据并行|PP流水线并行|混合并行DP1-MP1-PP1|DP1-MP4-PP1 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/maskformer_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/maskformer_bs4_fp16_DP.sh similarity index 92% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/maskformer_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/maskformer_bs4_fp16_DP.sh index f71b3d47e5..2a89822156 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/maskformer_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/maskformer_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="maskformer" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C1 max_iter=400 -num_workers=8 +num_workers=12 train_config="configs/ade20k-150/swin/maskformer_swin_tiny_bs16_160k.yaml" bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/maskformer_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/maskformer_bs4_fp32_DP.sh similarity index 92% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/maskformer_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/maskformer_bs4_fp32_DP.sh index c23d0df21d..6b40212eeb 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/maskformer_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C1/maskformer_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="maskformer" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C1 max_iter=400 -num_workers=8 +num_workers=12 train_config="configs/ade20k-150/swin/maskformer_swin_tiny_bs16_160k.yaml" bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/maskformer_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/maskformer_bs4_fp16_DP.sh similarity index 92% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/maskformer_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/maskformer_bs4_fp16_DP.sh index 93031d146f..1e9166fff2 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/maskformer_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/maskformer_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="maskformer" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C4 max_iter=400 -num_workers=8 +num_workers=12 train_config="configs/ade20k-150/swin/maskformer_swin_tiny_bs16_160k.yaml" bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/maskformer_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/maskformer_bs4_fp32_DP.sh similarity index 92% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/maskformer_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/maskformer_bs4_fp32_DP.sh index 343212114d..6a2e79c4ca 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/maskformer_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C4/maskformer_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="maskformer" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C4 max_iter=400 -num_workers=8 +num_workers=12 train_config="configs/ade20k-150/swin/maskformer_swin_tiny_bs16_160k.yaml" bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/maskformer_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/maskformer_bs4_fp16_DP.sh similarity index 92% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/maskformer_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/maskformer_bs4_fp16_DP.sh index f30a7d81f2..4ef4f60061 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/maskformer_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/maskformer_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="maskformer" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C8 max_iter=400 -num_workers=8 +num_workers=12 train_config="configs/ade20k-150/swin/maskformer_swin_tiny_bs16_160k.yaml" bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/maskformer_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/maskformer_bs4_fp32_DP.sh similarity index 92% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/maskformer_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/maskformer_bs4_fp32_DP.sh index 048bafc260..68065d2f00 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/maskformer_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N1C8/maskformer_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="maskformer" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C8 max_iter=400 -num_workers=8 +num_workers=12 train_config="configs/ade20k-150/swin/maskformer_swin_tiny_bs16_160k.yaml" bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/maskformer_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/maskformer_bs4_fp16_DP.sh similarity index 92% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/maskformer_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/maskformer_bs4_fp16_DP.sh index ada789b84e..877f711699 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/maskformer_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/maskformer_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="maskformer" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N4C32 max_iter=400 -num_workers=8 +num_workers=12 train_config="configs/ade20k-150/swin/maskformer_swin_tiny_bs16_160k.yaml" bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/maskformer_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/maskformer_bs4_fp32_DP.sh similarity index 92% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/maskformer_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/maskformer_bs4_fp32_DP.sh index 2b2eb5dc17..59346a0f8a 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/maskformer_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/N4C32/maskformer_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="maskformer" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N4C32 max_iter=400 -num_workers=8 +num_workers=12 train_config="configs/ade20k-150/swin/maskformer_swin_tiny_bs16_160k.yaml" bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/run_benchmark.sh index 0bb1e605ed..7cb221ab6a 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/run_benchmark.sh @@ -5,7 +5,7 @@ # Usage: CUDA_VISIBLE_DEVICES=xxx bash run_benchmark.sh ${model_name} ${run_mode} ${fp_item} ${bs_item} ${max_iter} ${num_workers} function _set_params(){ - model_item=${1:-"model_item"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 + model_item=${1:-"maskformer"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 base_batch_size=${2:-"2"} # (必选) 每张卡上的batch_size fp_item=${3:-"fp32"} # (必选) fp32|fp16 run_mode=${4:-"DP"} # (必选) MP模型并行|DP数据并行|PP流水线并行|混合并行DP1-MP1-PP1|DP1-MP4-PP1 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/run_benchmark.sh index b12d56b30b..26f81a32bf 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/run_benchmark.sh @@ -5,7 +5,7 @@ # Usage: CUDA_VISIBLE_DEVICES=xxx bash run_benchmark.sh ${model_name} ${run_mode} ${fp_item} ${bs_item} ${max_iter} ${num_workers} function _set_params(){ - model_item=${1:-"model_item"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 + model_item=${1:-"ocrnet_hrnetw48"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 base_batch_size=${2:-"2"} # (必选) 每张卡上的batch_size fp_item=${3:-"fp32"} # (必选) fp32|fp16 run_mode=${4:-"DP"} # (必选) MP模型并行|DP数据并行|PP流水线并行|混合并行DP1-MP1-PP1|DP1-MP4-PP1 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/stdc_stdc1_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/stdc_stdc1_bs4_fp16_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/stdc_stdc1_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/stdc_stdc1_bs4_fp16_DP.sh index 3bb0b8012c..f5905d33a2 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/stdc_stdc1_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/stdc_stdc1_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="stdc_stdc1" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C1 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/stdc_stdc1_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/stdc_stdc1_bs4_fp32_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/stdc_stdc1_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/stdc_stdc1_bs4_fp32_DP.sh index 11212e2866..1a4bcb635b 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/stdc_stdc1_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C1/stdc_stdc1_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="stdc_stdc1" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C1 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/stdc_stdc1_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/stdc_stdc1_bs4_fp16_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/stdc_stdc1_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/stdc_stdc1_bs4_fp16_DP.sh index b76de562a5..fc4a491a21 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/stdc_stdc1_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/stdc_stdc1_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="stdc_stdc1" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C4 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/stdc_stdc1_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/stdc_stdc1_bs4_fp32_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/stdc_stdc1_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/stdc_stdc1_bs4_fp32_DP.sh index 7e02374297..ddab527272 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/stdc_stdc1_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C4/stdc_stdc1_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="stdc_stdc1" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C4 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/stdc_stdc1_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/stdc_stdc1_bs4_fp16_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/stdc_stdc1_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/stdc_stdc1_bs4_fp16_DP.sh index c478d75c4f..57f291a921 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/stdc_stdc1_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/stdc_stdc1_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="stdc_stdc1" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C8 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/stdc_stdc1_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/stdc_stdc1_bs4_fp32_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/stdc_stdc1_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/stdc_stdc1_bs4_fp32_DP.sh index f316cdc658..ecd21231a8 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/stdc_stdc1_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N1C8/stdc_stdc1_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="stdc_stdc1" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C8 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/stdc_stdc1_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/stdc_stdc1_bs4_fp16_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/stdc_stdc1_bs2_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/stdc_stdc1_bs4_fp16_DP.sh index cbf9ae40e7..e29576e469 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/stdc_stdc1_bs2_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/stdc_stdc1_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="stdc_stdc1" -bs_item=2 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N4C32 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/stdc_stdc1_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/stdc_stdc1_bs4_fp32_DP.sh similarity index 89% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/stdc_stdc1_bs2_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/stdc_stdc1_bs4_fp32_DP.sh index 7af7f4696d..9264219b1a 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/stdc_stdc1_bs2_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/N4C32/stdc_stdc1_bs4_fp32_DP.sh @@ -1,10 +1,10 @@ model_item="stdc_stdc1" -bs_item=2 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N4C32 max_iter=400 -num_workers=8 +num_workers=24 bash prepare.sh; bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/run_benchmark.sh index b12d56b30b..e068a8e7c5 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/run_benchmark.sh @@ -5,7 +5,7 @@ # Usage: CUDA_VISIBLE_DEVICES=xxx bash run_benchmark.sh ${model_name} ${run_mode} ${fp_item} ${bs_item} ${max_iter} ${num_workers} function _set_params(){ - model_item=${1:-"model_item"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 + model_item=${1:-"stdc_stdc1"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 base_batch_size=${2:-"2"} # (必选) 每张卡上的batch_size fp_item=${3:-"fp32"} # (必选) fp32|fp16 run_mode=${4:-"DP"} # (必选) MP模型并行|DP数据并行|PP流水线并行|混合并行DP1-MP1-PP1|DP1-MP4-PP1 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C1/vit_adapter_bs4_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C1/vit_adapter_bs4_fp16_DP.sh new file mode 100644 index 0000000000..d219ae3e01 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C1/vit_adapter_bs4_fp16_DP.sh @@ -0,0 +1,11 @@ +model_item="vit_adapter" +bs_item=4 +fp_item=fp16 +run_mode=DP +device_num=N1C1 +max_iter=400 +num_workers=24 +train_config=configs/ade20k/upernet_augreg_adapter_tiny_512_160k_ade20k.py + +bash prepare.sh; +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} ${train_config} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C1/vit_adapter_bs4_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C1/vit_adapter_bs4_fp32_DP.sh new file mode 100644 index 0000000000..307fab90dc --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C1/vit_adapter_bs4_fp32_DP.sh @@ -0,0 +1,11 @@ +model_item="vit_adapter" +bs_item=4 +fp_item=fp32 +run_mode=DP +device_num=N1C1 +max_iter=400 +num_workers=24 +train_config=configs/ade20k/upernet_augreg_adapter_tiny_512_160k_ade20k.py + +bash prepare.sh; +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} ${train_config} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C4/vit_adapter_bs4_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C4/vit_adapter_bs4_fp16_DP.sh new file mode 100644 index 0000000000..16b40d7544 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C4/vit_adapter_bs4_fp16_DP.sh @@ -0,0 +1,11 @@ +model_item="vit_adapter" +bs_item=4 +fp_item=fp16 +run_mode=DP +device_num=N1C4 +max_iter=400 +num_workers=24 +train_config=configs/ade20k/upernet_augreg_adapter_tiny_512_160k_ade20k.py + +bash prepare.sh; +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} ${train_config} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C4/vit_adapter_bs4_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C4/vit_adapter_bs4_fp32_DP.sh new file mode 100644 index 0000000000..5d9674ae75 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C4/vit_adapter_bs4_fp32_DP.sh @@ -0,0 +1,11 @@ +model_item="vit_adapter" +bs_item=4 +fp_item=fp32 +run_mode=DP +device_num=N1C4 +max_iter=400 +num_workers=24 +train_config=configs/ade20k/upernet_augreg_adapter_tiny_512_160k_ade20k.py + +bash prepare.sh; +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} ${train_config} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C8/vit_adapter_bs4_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C8/vit_adapter_bs4_fp16_DP.sh new file mode 100644 index 0000000000..5aad25eba0 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C8/vit_adapter_bs4_fp16_DP.sh @@ -0,0 +1,11 @@ +model_item="vit_adapter" +bs_item=4 +fp_item=fp16 +run_mode=DP +device_num=N1C8 +max_iter=400 +num_workers=24 +train_config=configs/ade20k/upernet_augreg_adapter_tiny_512_160k_ade20k.py + +bash prepare.sh; +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} ${train_config} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C8/vit_adapter_bs4_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C8/vit_adapter_bs4_fp32_DP.sh new file mode 100644 index 0000000000..7cb54ed9b4 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N1C8/vit_adapter_bs4_fp32_DP.sh @@ -0,0 +1,11 @@ +model_item="vit_adapter" +bs_item=4 +fp_item=fp32 +run_mode=DP +device_num=N1C8 +max_iter=400 +num_workers=24 +train_config=configs/ade20k/upernet_augreg_adapter_tiny_512_160k_ade20k.py + +bash prepare.sh; +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} ${train_config} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N4C32/vit_adapter_bs4_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N4C32/vit_adapter_bs4_fp16_DP.sh new file mode 100644 index 0000000000..0f0e531ffe --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N4C32/vit_adapter_bs4_fp16_DP.sh @@ -0,0 +1,11 @@ +model_item="vit_adapter" +bs_item=4 +fp_item=fp16 +run_mode=DP +device_num=N4C32 +max_iter=400 +num_workers=24 +train_config=configs/ade20k/upernet_augreg_adapter_tiny_512_160k_ade20k.py + +bash prepare.sh; +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} ${train_config} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N4C32/vit_adapter_bs4_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N4C32/vit_adapter_bs4_fp32_DP.sh new file mode 100644 index 0000000000..0b42970830 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/N4C32/vit_adapter_bs4_fp32_DP.sh @@ -0,0 +1,11 @@ +model_item="vit_adapter" +bs_item=4 +fp_item=fp32 +run_mode=DP +device_num=N4C32 +max_iter=400 +num_workers=24 +train_config=configs/ade20k/upernet_augreg_adapter_tiny_512_160k_ade20k.py + +bash prepare.sh; +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} ${train_config} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/analysis_log.py b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/analysis_log.py new file mode 100644 index 0000000000..9314b80c1b --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/analysis_log.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# encoding=utf-8 vi:ts=4:sw=4:expandtab:ft=python + +import re +import sys +import json +import os + +def analyze(model_name, log_file, res_log_file, device_num, fp_item): + bs_pat = re.compile(r"samples_per_gpu=(.*),") + time_pat = re.compile(r"(?<=, time: )\d+\.?\d*") + loss_pat = re.compile(r"loss: (.*)") + + logs = open(log_file).readlines() + logs = ";".join(logs) + bs_res = bs_pat.findall(logs) + time_res = time_pat.findall(logs) + loss_res = loss_pat.findall(logs) + + print("---device_num:-", device_num) + index_c = device_num.index('C') + print("---index_c:-", index_c) + gpu_num = int(device_num[index_c + 1:len(device_num)]) + print("-----gpu_num:", gpu_num) + + run_mode = "" + # gpu_num = 0 + ips = 0 + bs = 0 + if time_res == []: + ips = 0 + else: + bs = int(bs_res[0]) + + skip_num = 4 + total_time = 0 + for i in range(skip_num, len(time_res)): + total_time += float(time_res[i]) + avg_time = total_time / (len(time_res) - skip_num) + ips = round(bs * gpu_num / avg_time, 3) + + info = { "model_branch": os.getenv('model_branch'), + "model_commit": os.getenv('model_commit'), + "model_name": model_name, + "batch_size": bs, + "fp_item": fp_item, + "run_mode": "DP", + "convergence_value": loss_res[-1], + "convergence_key": "loss", + "ips": ips, + "speed_unit":"images/s", + "device_num": device_num, + "model_run_time": os.getenv('model_run_time'), + "frame_commit": "", + "frame_version": os.getenv('frame_version'), + } + json_info = json.dumps(info) + print(json_info) + with open(res_log_file, "w") as of: + of.write(json_info) + +if __name__ == "__main__": + if len(sys.argv) != 6: + print("Usage:" + sys.argv[0] + " model_item path/to/log/file path/to/res/log/file") + sys.exit() + + model_item = sys.argv[1] + log_file = sys.argv[2] + res_log_file = sys.argv[3] + device_num = sys.argv[4] + fp_item = sys.argv[5] + analyze(model_item, log_file, res_log_file, device_num, fp_item) diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/detect_cuda.cu b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/detect_cuda.cu new file mode 100755 index 0000000000..c356f83fb3 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/detect_cuda.cu @@ -0,0 +1,16 @@ +#include "cuda.h" +#include "cuda_runtime.h" +#include "stdio.h" + +int main() { + int version = -1; + cudaError_t err = cudaRuntimeGetVersion(&version); + if (err != cudaSuccess) { + printf("%s\n", cudaGetErrorString(err)); + return -1; + } + int major = version / 1000; + int minor = (version % 100) / 10; + printf("%d.%d\n", major, minor); + return 0; +} diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/dist_train.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/dist_train.sh new file mode 100755 index 0000000000..44eac1c635 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/dist_train.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -e + +CONFIG=$1 +GPUS=$2 +Devices=$3 +PORT=${PORT:-29500} + +if [[ $Devices -gt 1 ]]; then + echo "Devices = $Devices 1" + PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \ + python -m torch.distributed.launch --nproc_per_node=$GPUS --master_port=$PORT \ + --nnodes=$Devices --node_rank=$PADDLE_TRAINER_ID --master_addr=$POD_0_IP $(dirname "$0")/train.py \ + $CONFIG --launcher pytorch ${@:4} +else + echo "Devices = $Devices 2" + PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \ + python -m torch.distributed.launch --nproc_per_node=$GPUS --master_port=$PORT \ + $(dirname "$0")/train.py $CONFIG --launcher pytorch ${@:4} +fi \ No newline at end of file diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/prepare.sh new file mode 100755 index 0000000000..2536df0f67 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/prepare.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +echo "******* install enviroments for benchmark ***********" +echo `pip --version` + +unset https_proxy && unset http_proxy +pip install torch==1.13.0+cu117 torchvision==0.14.0+cu117 -f https://download.pytorch.org/whl/torch_stable.html +pip install -U openmim +mim install -v mmcv-full==1.5.0 +pip install timm==0.4.12 +pip install mmdet==2.22.0 +pip install mmsegmentation==0.20.2 + +ln -s ../detection/ops ./ +cd ops && sh make.sh && cd - +cp dist_train.sh dist_train.sh + +echo "******* prepare dataset for benchmark ***********" + +rm -rf data +mkdir -p data/ade +cd data/ade +wget https://paddleseg.bj.bcebos.com/dataset/ADEChallengeData2016.zip --no-check-certificate +unzip -o ADEChallengeData2016.zip +cd - + +echo "******* prepare benchmark end *******" diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/run_benchmark.sh new file mode 100644 index 0000000000..22fe079a9a --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/run_benchmark.sh @@ -0,0 +1,111 @@ +#!/usr/bin/env bash + +# Test training benchmark for a model. + +# Usage: CUDA_VISIBLE_DEVICES=xxx bash run_benchmark.sh ${model_name} ${run_mode} ${fp_item} ${bs_item} ${max_iter} ${num_workers} + +function _set_params(){ + model_item=${1:-"vit_adapter"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 + base_batch_size=${2:-"2"} # (必选) 每张卡上的batch_size + fp_item=${3:-"fp32"} # (必选) fp32|fp16 + run_mode=${4:-"DP"} # (必选) MP模型并行|DP数据并行|PP流水线并行|混合并行DP1-MP1-PP1|DP1-MP4-PP1 + device_num=${5:-"N1C1"} # (必选) 使用的卡数量,N1C1|N1C8|N4C8 (4机32卡) + profiling=${PROFILING:-"false"} # (必选) Profiling 开关,默认关闭,通过全局变量传递 + model_repo="mmsegmentation" # (必选) 模型套件的名字 + ips_unit="samples/sec" # (必选)速度指标单位 + skip_steps=10 # (必选)解析日志,跳过模型前几个性能不稳定的step + keyword="ips:" # (必选)解析日志,筛选出性能数据所在行的关键字 + + convergence_key="" # (可选)解析日志,筛选出收敛数据所在行的关键字 如:convergence_key="loss:" + max_iter=${6:-"100"} # (可选)需保证模型执行时间在5分钟内,需要修改代码提前中断的直接提PR 合入套件 或是max_epoch + num_workers=${7:-"3"} # (可选) + train_config=${8:-"detectron_configs/${model_item}.yaml"} # (可选) 模型的训练文件 + + # 以下为通用拼接log路径,无特殊可不用修改 + model_name=${model_item}_bs${base_batch_size}_${fp_item}_${run_mode} # (必填) 切格式不要改动,与平台页面展示对齐 + device=${CUDA_VISIBLE_DEVICES//,/ } + arr=(${device}) + num_gpu_devices=${#arr[*]} + run_log_path=${TRAIN_LOG_DIR:-$(pwd)} # (必填) TRAIN_LOG_DIR benchmark框架设置该参数为全局变量 + profiling_log_path=${PROFILING_LOG_DIR:-$(pwd)} # (必填) PROFILING_LOG_DIR benchmark框架设置该参数为全局变量 + speed_log_path=${LOG_PATH_INDEX_DIR:-$(pwd)} + # mmsegmentation_fastscnn_bs2_fp32_MultiP_DP_N1C1_log + train_log_file=${run_log_path}/${model_repo}_${model_name}_${device_num}_log + profiling_log_file=${profiling_log_path}/${model_repo}_${model_name}_${device_num}_profiling + speed_log_file=${speed_log_path}/${model_repo}_${model_name}_${device_num}_speed + if [ ${profiling} = "true" ];then + add_options="profiler_options=\"batch_range=[50, 60]; profile_path=model.profile\"" + log_file=${profiling_log_file} + else + add_options="" + log_file=${train_log_file} + fi +} + +function _analysis_log(){ + python analysis_log.py ${model_name} ${log_file} ${speed_log_file} ${device_num} ${fp_item} +} + +function _train(){ + batch_size=${base_batch_size} # 如果模型跑多卡但进程时,请在_train函数中计算出多卡需要的bs + + echo "current ${model_name} CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES, gpus=${device_num}, batch_size=${batch_size}" + + if [ ${fp_item} = "fp16" ];then + train_config_fp16="${train_config%.*}_fp16.py" + cp -r ${train_config} ${train_config_fp16} + echo " " >> ${train_config_fp16} + echo "optimizer_config = dict(type='Fp16OptimizerHook', loss_scale=512.)" >> ${train_config_fp16} + echo "fp16 = dict()" >> ${train_config_fp16} + train_config=${train_config_fp16} + fi + + use_com_args="" + # if [ ${FLAG_TORCH_COMPILE} = "True" ];then + # use_com_args="--torchcompile" + # fi + + train_options="--no-validate \ + --options log_config.interval=15 \ + runner.max_iters=${max_iter} \ + data.samples_per_gpu=${batch_size} \ + data.workers_per_gpu=${num_workers} \ + model.pretrained=None \ + pretrained=None \ + ${use_com_args}" + + if [ ${device_num} = "N1C1" ]; then + train_cmd="python train.py ${train_config} ${train_options}" + else + train_cmd="bash dist_train.sh ${train_config} ${device_num:3:1} ${device_num:1:1} ${train_options}" + fi + +# 以下为通用执行命令,无特殊可不用修改 + echo ${train_cmd} + timeout 15m ${train_cmd} > ${log_file} 2>&1 + if [ $? -ne 0 ];then + echo -e "${model_name}, FAIL" + else + echo -e "${model_name}, SUCCESS" + fi + kill -9 `ps -ef|grep 'python'|awk '{print $2}'` + if [ ${device_num} != "N1C1" -a -d mylog ]; then + rm ${log_file} + cp mylog/workerlog.0 ${log_file} + fi +} + +_set_params $@ +# export model_branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3` +# export model_commit=$(git log|head -n1|awk '{print $2}') +export frame_version=`python -c "import torch;print(torch.__version__)"` +echo "---------frame_version is torch ${frame_version}" +echo "---------model_branch is ${model_branch}" +echo "---------model_commit is ${model_commit}" + +job_bt=`date '+%Y%m%d%H%M%S'` +_train +job_et=`date '+%Y%m%d%H%M%S'` +export model_run_time=$((${job_et}-${job_bt})) +_analysis_log + From cd8334aa67cefd8d530288f0eaae198bce30f846 Mon Sep 17 00:00:00 2001 From: Stinky-Tofu Date: Wed, 29 Mar 2023 15:34:03 +0800 Subject: [PATCH 03/13] make mmsegmentation support torch compile --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index ed7306f3c5..9d9d870533 100644 --- a/.gitmodules +++ b/.gitmodules @@ -57,7 +57,7 @@ branch = main [submodule "frame_benchmark/pytorch/dynamic/PaddleSeg/models/mmsegmentation"] path = frame_benchmark/pytorch/dynamic/PaddleSeg/models/mmsegmentation - url = https://github.com/open-mmlab/mmsegmentation.git + url = https://github.com/PaddleBenchmark/mmsegmentation.git branch = master [submodule "frame_benchmark/pytorch/dynamic/PaddleVideo/models/temporal-shift-module"] path = frame_benchmark/pytorch/dynamic/PaddleVideo/models/temporal-shift-module From 82710d73ee3a356734a88cacd711620555de1960 Mon Sep 17 00:00:00 2001 From: Stinky-Tofu Date: Wed, 29 Mar 2023 08:18:31 +0000 Subject: [PATCH 04/13] fix proxy environment viriable --- .../PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh | 2 +- .../PaddleSeg/scripts/fastscnn/benchmark_common/prepare.sh | 2 +- .../scripts/fcn_hrnetw18/benchmark_common/prepare.sh | 2 +- .../PaddleSeg/scripts/mask2former/benchmark_common/prepare.sh | 2 +- .../PaddleSeg/scripts/maskformer/benchmark_common/prepare.sh | 4 ++-- .../scripts/ocrnet_hrnetw48/benchmark_common/prepare.sh | 2 +- .../PaddleSeg/scripts/stdc_stdc1/benchmark_common/prepare.sh | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh index 835f7ebe32..8fa80383fc 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh @@ -8,7 +8,7 @@ if [ ! -f "torch_dev_whls.tar" ];then wget ${FLAG_TORCH_WHL_URL} fi tar -xf torch_dev_whls.tar -export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +export https_proxy=${HTTP_PRO} && export http_proxy=${HTTPS_PRO} for whl_file in torch_dev_whls/* do pip install ${whl_file} diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/prepare.sh index 835f7ebe32..8fa80383fc 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/prepare.sh @@ -8,7 +8,7 @@ if [ ! -f "torch_dev_whls.tar" ];then wget ${FLAG_TORCH_WHL_URL} fi tar -xf torch_dev_whls.tar -export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +export https_proxy=${HTTP_PRO} && export http_proxy=${HTTPS_PRO} for whl_file in torch_dev_whls/* do pip install ${whl_file} diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/prepare.sh index 835f7ebe32..8fa80383fc 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/prepare.sh @@ -8,7 +8,7 @@ if [ ! -f "torch_dev_whls.tar" ];then wget ${FLAG_TORCH_WHL_URL} fi tar -xf torch_dev_whls.tar -export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +export https_proxy=${HTTP_PRO} && export http_proxy=${HTTPS_PRO} for whl_file in torch_dev_whls/* do pip install ${whl_file} diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/prepare.sh index 06e667b144..0401ea005c 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/prepare.sh @@ -8,7 +8,7 @@ unset https_proxy && unset http_proxy pip install torch==1.13.0+cu117 torchvision==0.14.0+cu117 -f https://download.pytorch.org/whl/torch_stable.html pip install -U opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple -export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +export https_proxy=${HTTP_PRO} && export http_proxy=${HTTPS_PRO} git clone https://github.com/facebookresearch/detectron2.git python -m pip install -e detectron2 pip install git+https://github.com/cocodataset/panopticapi.git diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/prepare.sh index dfc2255d21..0a0cc55a34 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/prepare.sh @@ -8,13 +8,13 @@ if [ ! -f "torch_dev_whls.tar" ];then wget ${FLAG_TORCH_WHL_URL} fi tar -xf torch_dev_whls.tar -export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +export https_proxy=${HTTP_PRO} && export http_proxy=${HTTPS_PRO} for whl_file in torch_dev_whls/* do pip install ${whl_file} done -export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +export https_proxy=${HTTP_PRO} && export http_proxy=${HTTPS_PRO} git clone https://github.com/facebookresearch/detectron2.git python -m pip install -e detectron2 unset https_proxy && unset http_proxy diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/prepare.sh index 835f7ebe32..8fa80383fc 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/prepare.sh @@ -8,7 +8,7 @@ if [ ! -f "torch_dev_whls.tar" ];then wget ${FLAG_TORCH_WHL_URL} fi tar -xf torch_dev_whls.tar -export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +export https_proxy=${HTTP_PRO} && export http_proxy=${HTTPS_PRO} for whl_file in torch_dev_whls/* do pip install ${whl_file} diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/prepare.sh index 835f7ebe32..8fa80383fc 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/prepare.sh @@ -8,7 +8,7 @@ if [ ! -f "torch_dev_whls.tar" ];then wget ${FLAG_TORCH_WHL_URL} fi tar -xf torch_dev_whls.tar -export https_proxy=${PROXY_IP} && export http_proxy=${PROXY_IP} +export https_proxy=${HTTP_PRO} && export http_proxy=${HTTPS_PRO} for whl_file in torch_dev_whls/* do pip install ${whl_file} From 0459f216c1fcd32961d784474320405355b31d5d Mon Sep 17 00:00:00 2001 From: Stinky-Tofu Date: Wed, 29 Mar 2023 09:30:01 +0000 Subject: [PATCH 05/13] add some code for benchmark --- frame_benchmark/docker_images.yaml | 3 ++- frame_benchmark/models_path.yaml | 1 + .../PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh | 2 ++ .../scripts/bisenetv2/benchmark_common/run_benchmark.sh | 6 ++++++ .../deeplabv3p_resnet50/benchmark_common/run_benchmark.sh | 6 ++++++ .../scripts/fastscnn/benchmark_common/run_benchmark.sh | 6 ++++++ .../scripts/fcn_hrnetw18/benchmark_common/run_benchmark.sh | 6 ++++++ .../scripts/mask2former/benchmark_common/run_benchmark.sh | 6 ++++++ .../scripts/maskformer/benchmark_common/run_benchmark.sh | 6 ++++++ .../ocrnet_hrnetw48/benchmark_common/run_benchmark.sh | 6 ++++++ .../scripts/segformer_b0/benchmark_common/run_benchmark.sh | 6 ++++++ .../scripts/stdc_stdc1/benchmark_common/run_benchmark.sh | 6 ++++++ .../scripts/vit_adapter/benchmark_common/run_benchmark.sh | 6 ++++++ 13 files changed, 65 insertions(+), 1 deletion(-) diff --git a/frame_benchmark/docker_images.yaml b/frame_benchmark/docker_images.yaml index 438212f19c..9031c0e096 100755 --- a/frame_benchmark/docker_images.yaml +++ b/frame_benchmark/docker_images.yaml @@ -97,4 +97,5 @@ pytorch: maskformer: iregistry.baidu-int.com/paddlecloud/base-images:paddlecloud-ubuntu18.04-gcc8.2-cuda11.7-cudnn8.4.1-nccl2.12.12 mask2former: iregistry.baidu-int.com/paddlecloud/base-images:paddlecloud-ubuntu18.04-gcc8.2-cuda11.7-cudnn8.4.1-nccl2.12.12 petrv2: iregistry.baidu-int.com/paddlecloud/base-images:paddlecloud-ubuntu18.04-gcc8.2-cuda11.7-cudnn8.4.1-nccl2.12.12 - VideoSwin: iregistry.baidu-int.com/paddlecloud/base-images:paddlecloud-ubuntu18.04-gcc8.2-cuda11.7-cudnn8.4.1-nccl2.12.12 \ No newline at end of file + VideoSwin: iregistry.baidu-int.com/paddlecloud/base-images:paddlecloud-ubuntu18.04-gcc8.2-cuda11.7-cudnn8.4.1-nccl2.12.12 + vit_adapter: iregistry.baidu-int.com/paddlecloud/base-images:paddlecloud-ubuntu18.04-gcc8.2-cuda11.7-cudnn8.4.1-nccl2.12.12 \ No newline at end of file diff --git a/frame_benchmark/models_path.yaml b/frame_benchmark/models_path.yaml index ffaca3cbbf..0b711b1f1d 100644 --- a/frame_benchmark/models_path.yaml +++ b/frame_benchmark/models_path.yaml @@ -98,3 +98,4 @@ pytorch: mask2former: benchmark/frame_benchmark/pytorch/dynamic/PaddleSeg/models/Mask2Former petrv2: benchmark/frame_benchmark/pytorch/dynamic/Paddle3D/models/PETR VideoSwin: benchmark/frame_benchmark/pytorch/dynamic/PaddleVideo/models/Video-Swin-Transformer + vit_adapter: benchmark/frame_benchmark/pytorch/dynamic/PaddleSeg/models/ViT-Adapter diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh index 8fa80383fc..c4d07e8a36 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh @@ -37,4 +37,6 @@ else echo "******* cityscapes dataset already exists *******" fi +rm -rf /dev/shm/* + echo "******* prepare benchmark end *******" diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/run_benchmark.sh index 5713e905be..74ebb4af8e 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/run_benchmark.sh @@ -96,6 +96,10 @@ function _train(){ _set_params $@ # export model_branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3` # export model_commit=$(git log|head -n1|awk '{print $2}') + +# clear share memory +rm -rf /dev/shm/* + export frame_version=`python -c "import torch;print(torch.__version__)"` echo "---------frame_version is torch ${frame_version}" echo "---------model_branch is ${model_branch}" @@ -107,3 +111,5 @@ job_et=`date '+%Y%m%d%H%M%S'` export model_run_time=$((${job_et}-${job_bt})) _analysis_log +# kill all python processes +ps -ef | grep python | awk '{ print $2 }' | xargs kill -9 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/deeplabv3p_resnet50/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/deeplabv3p_resnet50/benchmark_common/run_benchmark.sh index 734e3f9b47..4f6256a18b 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/deeplabv3p_resnet50/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/deeplabv3p_resnet50/benchmark_common/run_benchmark.sh @@ -88,6 +88,10 @@ function _train(){ _set_params $@ # export model_branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3` # export model_commit=$(git log|head -n1|awk '{print $2}') + +# clear share memory +rm -rf /dev/shm/* + export frame_version=`python -c "import torch;print(torch.__version__)"` echo "---------frame_version is torch ${frame_version}" echo "---------model_branch is ${model_branch}" @@ -99,3 +103,5 @@ job_et=`date '+%Y%m%d%H%M%S'` export model_run_time=$((${job_et}-${job_bt})) _analysis_log +# kill all python processes +ps -ef | grep python | awk '{ print $2 }' | xargs kill -9 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/run_benchmark.sh index fdb656f97b..529b0495e6 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fastscnn/benchmark_common/run_benchmark.sh @@ -96,6 +96,10 @@ function _train(){ _set_params $@ # export model_branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3` # export model_commit=$(git log|head -n1|awk '{print $2}') + +# clear share memory +rm -rf /dev/shm/* + export frame_version=`python -c "import torch;print(torch.__version__)"` echo "---------frame_version is torch ${frame_version}" echo "---------model_branch is ${model_branch}" @@ -107,3 +111,5 @@ job_et=`date '+%Y%m%d%H%M%S'` export model_run_time=$((${job_et}-${job_bt})) _analysis_log +# kill all python processes +ps -ef | grep python | awk '{ print $2 }' | xargs kill -9 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/run_benchmark.sh index 14c751e288..7e4f8a4eb2 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/fcn_hrnetw18/benchmark_common/run_benchmark.sh @@ -96,6 +96,10 @@ function _train(){ _set_params $@ # export model_branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3` # export model_commit=$(git log|head -n1|awk '{print $2}') + +# clear share memory +rm -rf /dev/shm/* + export frame_version=`python -c "import torch;print(torch.__version__)"` echo "---------frame_version is torch ${frame_version}" echo "---------model_branch is ${model_branch}" @@ -107,3 +111,5 @@ job_et=`date '+%Y%m%d%H%M%S'` export model_run_time=$((${job_et}-${job_bt})) _analysis_log +# kill all python processes +ps -ef | grep python | awk '{ print $2 }' | xargs kill -9 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/run_benchmark.sh index 01087b64e3..5d85f9a389 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/benchmark_common/run_benchmark.sh @@ -84,6 +84,10 @@ function _train(){ _set_params $@ # export model_branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3` # export model_commit=$(git log|head -n1|awk '{print $2}') + +# clear share memory +rm -rf /dev/shm/* + export frame_version=`python -c "import torch;print(torch.__version__)"` echo "---------frame_version is torch ${frame_version}" echo "---------model_branch is ${model_branch}" @@ -95,3 +99,5 @@ job_et=`date '+%Y%m%d%H%M%S'` export model_run_time=$((${job_et}-${job_bt})) _analysis_log +# kill all python processes +ps -ef | grep python | awk '{ print $2 }' | xargs kill -9 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/run_benchmark.sh index 7cb221ab6a..e0e6983404 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/maskformer/benchmark_common/run_benchmark.sh @@ -84,6 +84,10 @@ function _train(){ _set_params $@ # export model_branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3` # export model_commit=$(git log|head -n1|awk '{print $2}') + +# clear share memory +rm -rf /dev/shm/* + export frame_version=`python -c "import torch;print(torch.__version__)"` echo "---------frame_version is torch ${frame_version}" echo "---------model_branch is ${model_branch}" @@ -95,3 +99,5 @@ job_et=`date '+%Y%m%d%H%M%S'` export model_run_time=$((${job_et}-${job_bt})) _analysis_log +# kill all python processes +ps -ef | grep python | awk '{ print $2 }' | xargs kill -9 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/run_benchmark.sh index 26f81a32bf..3458bd824b 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/ocrnet_hrnetw48/benchmark_common/run_benchmark.sh @@ -96,6 +96,10 @@ function _train(){ _set_params $@ # export model_branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3` # export model_commit=$(git log|head -n1|awk '{print $2}') + +# clear share memory +rm -rf /dev/shm/* + export frame_version=`python -c "import torch;print(torch.__version__)"` echo "---------frame_version is torch ${frame_version}" echo "---------model_branch is ${model_branch}" @@ -107,3 +111,5 @@ job_et=`date '+%Y%m%d%H%M%S'` export model_run_time=$((${job_et}-${job_bt})) _analysis_log +# kill all python processes +ps -ef | grep python | awk '{ print $2 }' | xargs kill -9 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/segformer_b0/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/segformer_b0/benchmark_common/run_benchmark.sh index e00b356130..632b7ce381 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/segformer_b0/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/segformer_b0/benchmark_common/run_benchmark.sh @@ -81,6 +81,10 @@ function _train(){ _set_params $@ # export model_branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3` # export model_commit=$(git log|head -n1|awk '{print $2}') + +# clear share memory +rm -rf /dev/shm/* + export frame_version=`python -c "import torch;print(torch.__version__)"` echo "---------frame_version is torch ${frame_version}" echo "---------model_branch is ${model_branch}" @@ -92,3 +96,5 @@ job_et=`date '+%Y%m%d%H%M%S'` export model_run_time=$((${job_et}-${job_bt})) _analysis_log +# kill all python processes +ps -ef | grep python | awk '{ print $2 }' | xargs kill -9 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/run_benchmark.sh index e068a8e7c5..e868200425 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/stdc_stdc1/benchmark_common/run_benchmark.sh @@ -96,6 +96,10 @@ function _train(){ _set_params $@ # export model_branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3` # export model_commit=$(git log|head -n1|awk '{print $2}') + +# clear share memory +rm -rf /dev/shm/* + export frame_version=`python -c "import torch;print(torch.__version__)"` echo "---------frame_version is torch ${frame_version}" echo "---------model_branch is ${model_branch}" @@ -107,3 +111,5 @@ job_et=`date '+%Y%m%d%H%M%S'` export model_run_time=$((${job_et}-${job_bt})) _analysis_log +# kill all python processes +ps -ef | grep python | awk '{ print $2 }' | xargs kill -9 diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/run_benchmark.sh index 22fe079a9a..63ff7d717a 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/run_benchmark.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/vit_adapter/benchmark_common/run_benchmark.sh @@ -98,6 +98,10 @@ function _train(){ _set_params $@ # export model_branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3` # export model_commit=$(git log|head -n1|awk '{print $2}') + +# clear share memory +rm -rf /dev/shm/* + export frame_version=`python -c "import torch;print(torch.__version__)"` echo "---------frame_version is torch ${frame_version}" echo "---------model_branch is ${model_branch}" @@ -109,3 +113,5 @@ job_et=`date '+%Y%m%d%H%M%S'` export model_run_time=$((${job_et}-${job_bt})) _analysis_log +# kill all python processes +ps -ef | grep python | awk '{ print $2 }' | xargs kill -9 From 304ce977fdc697e7cc69ffb3b31909d6faff8ebd Mon Sep 17 00:00:00 2001 From: Stinky-Tofu Date: Wed, 29 Mar 2023 09:33:45 +0000 Subject: [PATCH 06/13] fix some code --- .../PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh index c4d07e8a36..8fa80383fc 100755 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/bisenetv2/benchmark_common/prepare.sh @@ -37,6 +37,4 @@ else echo "******* cityscapes dataset already exists *******" fi -rm -rf /dev/shm/* - echo "******* prepare benchmark end *******" From 7ad3c0be6c8f61c8c3e999f656b76388dff6db85 Mon Sep 17 00:00:00 2001 From: Stinky-Tofu Date: Fri, 31 Mar 2023 03:47:28 +0000 Subject: [PATCH 07/13] [Fix] Solve the problem of mmsegmentation mmcv incompatibility (paddleSeg) --- .gitmodules | 7 +++---- .../pytorch/dynamic/PaddleSeg/models/mmsegmentation | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 9d9d870533..ec39bf56fa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -55,10 +55,6 @@ path = frame_benchmark/pytorch/dynamic/PaddleDetection/models/fairmot url = https://github.com/nemonameless/fairmot.git branch = main -[submodule "frame_benchmark/pytorch/dynamic/PaddleSeg/models/mmsegmentation"] - path = frame_benchmark/pytorch/dynamic/PaddleSeg/models/mmsegmentation - url = https://github.com/PaddleBenchmark/mmsegmentation.git - branch = master [submodule "frame_benchmark/pytorch/dynamic/PaddleVideo/models/temporal-shift-module"] path = frame_benchmark/pytorch/dynamic/PaddleVideo/models/temporal-shift-module url = https://github.com/PaddleBenchmark/temporal-shift-module.git @@ -142,3 +138,6 @@ path = frame_benchmark/pytorch/dynamic/PaddleVideo/models/Video-Swin-Transformer url = https://github.com/PaddleBenchmark/Video-Swin-Transformer.git branch = master +[submodule "frame_benchmark/pytorch/dynamic/PaddleSeg/models/mmsegmentation"] + path = frame_benchmark/pytorch/dynamic/PaddleSeg/models/mmsegmentation + url = https://github.com/PaddleBenchmark/mmsegmentation.git diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/models/mmsegmentation b/frame_benchmark/pytorch/dynamic/PaddleSeg/models/mmsegmentation index 02d2790145..17e8279c57 160000 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/models/mmsegmentation +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/models/mmsegmentation @@ -1 +1 @@ -Subproject commit 02d2790145275477928b97bdcc6e2bc806c095a3 +Subproject commit 17e8279c571c4d46f3919b5b1235d31103dd199a From 0405fa8996606a002e5bbd4df4fbcbd4b828e48e Mon Sep 17 00:00:00 2001 From: Stinky-Tofu Date: Fri, 31 Mar 2023 12:00:04 +0000 Subject: [PATCH 08/13] [Fix] fix some bug for paddleSeg --- ...k2former_bs1_fp16_DP.sh => mask2former_bs4_fp16_DP.sh} | 6 +++--- ...k2former_bs1_fp32_DP.sh => mask2former_bs4_fp32_DP.sh} | 8 ++++---- ...k2former_bs1_fp16_DP.sh => mask2former_bs4_fp16_DP.sh} | 6 +++--- ...k2former_bs1_fp32_DP.sh => mask2former_bs4_fp32_DP.sh} | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/{mask2former_bs1_fp16_DP.sh => mask2former_bs4_fp16_DP.sh} (88%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/{mask2former_bs1_fp32_DP.sh => mask2former_bs4_fp32_DP.sh} (87%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/{mask2former_bs1_fp16_DP.sh => mask2former_bs4_fp16_DP.sh} (88%) rename frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/{mask2former_bs1_fp32_DP.sh => mask2former_bs4_fp32_DP.sh} (87%) diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/mask2former_bs1_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/mask2former_bs4_fp16_DP.sh similarity index 88% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/mask2former_bs1_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/mask2former_bs4_fp16_DP.sh index c5d0802db6..b6190beedf 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/mask2former_bs1_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/mask2former_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="mask2former" -bs_item=1 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N1C8 -max_iter=600 -num_workers=8 +max_iter=400 +num_workers=24 train_config=configs/coco/panoptic-segmentation/maskformer2_R50_bs16_50ep.yaml bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/mask2former_bs1_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/mask2former_bs4_fp32_DP.sh similarity index 87% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/mask2former_bs1_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/mask2former_bs4_fp32_DP.sh index 3d6e9b29fa..a39b34a9f2 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/mask2former_bs1_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N1C8/mask2former_bs4_fp32_DP.sh @@ -1,11 +1,11 @@ model_item="mask2former" -bs_item=1 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N1C8 -max_iter=600 -num_workers=8 +max_iter=400 +num_workers=24 train_config=configs/coco/panoptic-segmentation/maskformer2_R50_bs16_50ep.yaml bash prepare.sh; -bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} ${train_config} 2>&1; \ No newline at end of file +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} ${train_config} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/mask2former_bs1_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/mask2former_bs4_fp16_DP.sh similarity index 88% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/mask2former_bs1_fp16_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/mask2former_bs4_fp16_DP.sh index 31a8cf6ac6..cfb3b9c379 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/mask2former_bs1_fp16_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/mask2former_bs4_fp16_DP.sh @@ -1,10 +1,10 @@ model_item="mask2former" -bs_item=1 +bs_item=4 fp_item=fp16 run_mode=DP device_num=N4C32 -max_iter=600 -num_workers=8 +max_iter=400 +num_workers=24 train_config=configs/coco/panoptic-segmentation/maskformer2_R50_bs16_50ep.yaml bash prepare.sh; diff --git a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/mask2former_bs1_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/mask2former_bs4_fp32_DP.sh similarity index 87% rename from frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/mask2former_bs1_fp32_DP.sh rename to frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/mask2former_bs4_fp32_DP.sh index 6be213b691..27cb344917 100644 --- a/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/mask2former_bs1_fp32_DP.sh +++ b/frame_benchmark/pytorch/dynamic/PaddleSeg/scripts/mask2former/N4C32/mask2former_bs4_fp32_DP.sh @@ -1,11 +1,11 @@ model_item="mask2former" -bs_item=1 +bs_item=4 fp_item=fp32 run_mode=DP device_num=N4C32 -max_iter=600 -num_workers=8 +max_iter=400 +num_workers=24 train_config=configs/coco/panoptic-segmentation/maskformer2_R50_bs16_50ep.yaml bash prepare.sh; -bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} ${train_config} 2>&1; \ No newline at end of file +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} ${train_config} 2>&1; From c200f03caebb76257a87202b2ff3fe69758ae8e6 Mon Sep 17 00:00:00 2001 From: Stinky-Tofu Date: Tue, 4 Apr 2023 11:50:29 +0000 Subject: [PATCH 09/13] [Benchmark] add pointpillars for paddle3D benchmark --- .gitmodules | 3 + .../pytorch/dynamic/Paddle3D/models/OpenPCDet | 1 + .../petrv2/benchmark_common/PrepareEnv.sh | 2 +- .../N1C1/pointpillars_bs2_fp16_DP.sh | 10 ++ .../N1C1/pointpillars_bs2_fp32_DP.sh | 10 ++ .../N1C4/pointpillars_bs2_fp16_DP.sh | 10 ++ .../N1C4/pointpillars_bs2_fp32_DP.sh | 10 ++ .../benchmark_common/analysis_log.py | 70 +++++++++ .../benchmark_common/kitti_dataset.yaml | 70 +++++++++ .../benchmark_common/pointpillars.yaml | 144 ++++++++++++++++++ .../pointpillars/benchmark_common/prepare.sh | 34 +++++ .../benchmark_common/run_benchmark.sh | 113 ++++++++++++++ 12 files changed, 476 insertions(+), 1 deletion(-) create mode 160000 frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet create mode 100644 frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C1/pointpillars_bs2_fp16_DP.sh create mode 100644 frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C1/pointpillars_bs2_fp32_DP.sh create mode 100644 frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C4/pointpillars_bs2_fp16_DP.sh create mode 100644 frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C4/pointpillars_bs2_fp32_DP.sh create mode 100644 frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/analysis_log.py create mode 100644 frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/kitti_dataset.yaml create mode 100644 frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/pointpillars.yaml create mode 100644 frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh create mode 100644 frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/run_benchmark.sh diff --git a/.gitmodules b/.gitmodules index 32e1b67d4b..d0455c6f86 100644 --- a/.gitmodules +++ b/.gitmodules @@ -141,3 +141,6 @@ path = frame_benchmark/pytorch/dynamic/PaddleDetection/models/yolov7 url = https://github.com/PaddleBenchmark/yolov7.git branch = main +[submodule "frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet"] + path = frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet + url = https://github.com/open-mmlab/OpenPCDet.git diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet b/frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet new file mode 160000 index 0000000000..83954d039e --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet @@ -0,0 +1 @@ +Subproject commit 83954d039e48aedc95b09dac2075eb38f571d326 diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/petrv2/benchmark_common/PrepareEnv.sh b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/petrv2/benchmark_common/PrepareEnv.sh index d07cca5b2b..2a6923b46b 100644 --- a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/petrv2/benchmark_common/PrepareEnv.sh +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/petrv2/benchmark_common/PrepareEnv.sh @@ -14,7 +14,7 @@ pip install setuptools==59.5.0 pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.1/index.html wget https://paddle-wheel.bj.bcebos.com/benchmark/mmdetection-2.24.1.zip -unzip mmdetection-2.24.1.zip +unzip -o mmdetection-2.24.1.zip rm -rf mmdetection-2.24.1.zip mv mmdetection-2.24.1 mmdetection cd mmdetection diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C1/pointpillars_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C1/pointpillars_bs2_fp16_DP.sh new file mode 100644 index 0000000000..829e7b765a --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C1/pointpillars_bs2_fp16_DP.sh @@ -0,0 +1,10 @@ +model_item="pointpillars" +bs_item=2 +fp_item=fp16 +run_mode=DP +device_num=N1C1 +max_iter=400 +num_workers=8 + +bash prepare.sh; +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C1/pointpillars_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C1/pointpillars_bs2_fp32_DP.sh new file mode 100644 index 0000000000..e282087c7d --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C1/pointpillars_bs2_fp32_DP.sh @@ -0,0 +1,10 @@ +model_item="pointpillars" +bs_item=2 +fp_item=fp32 +run_mode=DP +device_num=N1C1 +max_iter=400 +num_workers=8 + +bash prepare.sh; +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C4/pointpillars_bs2_fp16_DP.sh b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C4/pointpillars_bs2_fp16_DP.sh new file mode 100644 index 0000000000..1fc00b60a4 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C4/pointpillars_bs2_fp16_DP.sh @@ -0,0 +1,10 @@ +model_item="pointpillars" +bs_item=2 +fp_item=fp16 +run_mode=DP +device_num=N1C4 +max_iter=400 +num_workers=8 + +bash prepare.sh; +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C4/pointpillars_bs2_fp32_DP.sh b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C4/pointpillars_bs2_fp32_DP.sh new file mode 100644 index 0000000000..55d04203e0 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/N1C4/pointpillars_bs2_fp32_DP.sh @@ -0,0 +1,10 @@ +model_item="pointpillars" +bs_item=2 +fp_item=fp32 +run_mode=DP +device_num=N1C4 +max_iter=400 +num_workers=8 + +bash prepare.sh; +bash run_benchmark.sh ${model_item} ${bs_item} ${fp_item} ${run_mode} ${device_num} ${max_iter} ${num_workers} 2>&1; diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/analysis_log.py b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/analysis_log.py new file mode 100644 index 0000000000..adc6ff90b7 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/analysis_log.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# encoding=utf-8 vi:ts=4:sw=4:expandtab:ft=python + +import re +import sys +import json +import os + +def analyze(model_name, batch_size, log_file, res_log_file, device_num): + gpu_ids_pat = re.compile(r"GPU (.*):") + time_pat = re.compile(r"Batch time: (.*)\(.*\)") + + logs = open(log_file).readlines() + logs = ";".join(logs) + gpu_ids_res = gpu_ids_pat.findall(logs) + time_res = time_pat.findall(logs) + print(time_res, "***********************") + + print("---device_num:-", device_num) + index_c = device_num.index('C') + print("---index_c:-", index_c) + gpu_num = int(device_num[index_c + 1:len(device_num)]) + print("-----gpu_num:", gpu_num) + + fail_flag = 0 + run_mode = "" + fp_item = "fp32" + ips = 0 + + run_mode = "DP" + skip_num = 10 + total_time = 0 + for i in range(skip_num, len(time_res)): + total_time += float(time_res[i]) + avg_time = total_time / (len(time_res) - skip_num) + ips = float(batch_size) * round(1 / avg_time, 3) + + info = { "model_branch": os.getenv('model_branch'), + "model_commit": os.getenv('model_commit'), + "model_name": model_name, + "batch_size": batch_size, + "fp_item": fp_item, + "run_mode": run_mode, + "convergence_value": 0, + "convergence_key": "", + "ips": ips * int(gpu_num), + "speed_unit":"images/s", + "device_num": device_num, + "model_run_time": os.getenv('model_run_time'), + "frame_commit": "", + "frame_version": os.getenv('frame_version'), + } + print(info) + json_info = json.dumps(info) + with open(res_log_file, "w") as of: + of.write(json_info) + +if __name__ == "__main__": + if len(sys.argv) != 6: + print("Usage:" + sys.argv[0] + " model_name path/to/log/file path/to/res/log/file") + sys.exit() + + model_name = sys.argv[1] + batch_size = sys.argv[2] + log_file = sys.argv[3] + res_log_file = sys.argv[4] + device_num = sys.argv[5] + + analyze(model_name, batch_size, log_file, res_log_file, device_num) diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/kitti_dataset.yaml b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/kitti_dataset.yaml new file mode 100644 index 0000000000..a69acfff8e --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/kitti_dataset.yaml @@ -0,0 +1,70 @@ +DATASET: 'KittiDataset' +DATA_PATH: '../data/KITTI_800' + +POINT_CLOUD_RANGE: [0, -40, -3, 70.4, 40, 1] + +DATA_SPLIT: { + 'train': train, + 'test': val +} + +INFO_PATH: { + 'train': [kitti_infos_train.pkl], + 'test': [kitti_infos_val.pkl], +} + +GET_ITEM_LIST: ["points"] +FOV_POINTS_ONLY: True + +DATA_AUGMENTOR: + DISABLE_AUG_LIST: ['placeholder'] + AUG_CONFIG_LIST: + - NAME: gt_sampling + USE_ROAD_PLANE: True + DB_INFO_PATH: + - kitti_dbinfos_train.pkl + PREPARE: { + filter_by_min_points: ['Car:5', 'Pedestrian:5', 'Cyclist:5'], + filter_by_difficulty: [-1], + } + + SAMPLE_GROUPS: ['Car:20','Pedestrian:15', 'Cyclist:15'] + NUM_POINT_FEATURES: 4 + DATABASE_WITH_FAKELIDAR: False + REMOVE_EXTRA_WIDTH: [0.0, 0.0, 0.0] + LIMIT_WHOLE_SCENE: True + + - NAME: random_world_flip + ALONG_AXIS_LIST: ['x'] + + - NAME: random_world_rotation + WORLD_ROT_ANGLE: [-0.78539816, 0.78539816] + + - NAME: random_world_scaling + WORLD_SCALE_RANGE: [0.95, 1.05] + + +POINT_FEATURE_ENCODING: { + encoding_type: absolute_coordinates_encoding, + used_feature_list: ['x', 'y', 'z', 'intensity'], + src_feature_list: ['x', 'y', 'z', 'intensity'], +} + + +DATA_PROCESSOR: + - NAME: mask_points_and_boxes_outside_range + REMOVE_OUTSIDE_BOXES: True + + - NAME: shuffle_points + SHUFFLE_ENABLED: { + 'train': True, + 'test': False + } + + - NAME: transform_points_to_voxels + VOXEL_SIZE: [0.05, 0.05, 0.1] + MAX_POINTS_PER_VOXEL: 5 + MAX_NUMBER_OF_VOXELS: { + 'train': 16000, + 'test': 40000 + } diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/pointpillars.yaml b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/pointpillars.yaml new file mode 100644 index 0000000000..d0225644bf --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/pointpillars.yaml @@ -0,0 +1,144 @@ +CLASS_NAMES: ['Car'] + +DATA_CONFIG: + _BASE_CONFIG_: kitti_dataset.yaml + POINT_CLOUD_RANGE: [0, -39.68, -3, 69.12, 39.68, 1] + DATA_PROCESSOR: + - NAME: mask_points_and_boxes_outside_range + REMOVE_OUTSIDE_BOXES: True + + - NAME: shuffle_points + SHUFFLE_ENABLED: { + 'train': True, + 'test': False + } + + - NAME: transform_points_to_voxels + VOXEL_SIZE: [0.16, 0.16, 4] + MAX_POINTS_PER_VOXEL: 32 + MAX_NUMBER_OF_VOXELS: { + 'train': 16000, + 'test': 40000 + } + DATA_AUGMENTOR: + DISABLE_AUG_LIST: ['placeholder'] + AUG_CONFIG_LIST: + - NAME: gt_sampling + USE_ROAD_PLANE: True + DB_INFO_PATH: + - kitti_dbinfos_train.pkl + PREPARE: { + filter_by_min_points: ['Car:5'], + filter_by_difficulty: [-1], + } + + SAMPLE_GROUPS: ['Car:15'] + NUM_POINT_FEATURES: 4 + DATABASE_WITH_FAKELIDAR: False + REMOVE_EXTRA_WIDTH: [0.0, 0.0, 0.0] + LIMIT_WHOLE_SCENE: False + + - NAME: random_world_flip + ALONG_AXIS_LIST: ['x'] + + - NAME: random_world_rotation + WORLD_ROT_ANGLE: [-0.78539816, 0.78539816] + + - NAME: random_world_scaling + WORLD_SCALE_RANGE: [0.95, 1.05] + +MODEL: + NAME: PointPillar + + VFE: + NAME: PillarVFE + WITH_DISTANCE: False + USE_ABSLOTE_XYZ: True + USE_NORM: True + NUM_FILTERS: [64] + + MAP_TO_BEV: + NAME: PointPillarScatter + NUM_BEV_FEATURES: 64 + + BACKBONE_2D: + NAME: BaseBEVBackbone + LAYER_NUMS: [3, 5, 5] + LAYER_STRIDES: [2, 2, 2] + NUM_FILTERS: [64, 128, 256] + UPSAMPLE_STRIDES: [1, 2, 4] + NUM_UPSAMPLE_FILTERS: [128, 128, 128] + + DENSE_HEAD: + NAME: AnchorHeadSingle + CLASS_AGNOSTIC: False + + USE_DIRECTION_CLASSIFIER: True + DIR_OFFSET: 0.78539 + DIR_LIMIT_OFFSET: 0.0 + NUM_DIR_BINS: 2 + + ANCHOR_GENERATOR_CONFIG: [ + { + 'class_name': 'Car', + 'anchor_sizes': [[3.9, 1.6, 1.56]], + 'anchor_rotations': [0, 1.57], + 'anchor_bottom_heights': [-1.78], + 'align_center': False, + 'feature_map_stride': 2, + 'matched_threshold': 0.6, + 'unmatched_threshold': 0.45 + } + ] + + TARGET_ASSIGNER_CONFIG: + NAME: AxisAlignedTargetAssigner + POS_FRACTION: -1.0 + SAMPLE_SIZE: 512 + NORM_BY_NUM_EXAMPLES: False + MATCH_HEIGHT: False + BOX_CODER: ResidualCoder + + LOSS_CONFIG: + LOSS_WEIGHTS: { + 'cls_weight': 1.0, + 'loc_weight': 2.0, + 'dir_weight': 0.2, + 'code_weights': [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] + } + + POST_PROCESSING: + RECALL_THRESH_LIST: [0.3, 0.5, 0.7] + SCORE_THRESH: 0.1 + OUTPUT_RAW_SCORE: False + + EVAL_METRIC: kitti + + NMS_CONFIG: + MULTI_CLASSES_NMS: False + NMS_TYPE: nms_gpu + NMS_THRESH: 0.01 + NMS_PRE_MAXSIZE: 4096 + NMS_POST_MAXSIZE: 500 + + +OPTIMIZATION: + BATCH_SIZE_PER_GPU: 2 + NUM_EPOCHS: 1 + + OPTIMIZER: adam_onecycle + LR: 0.003 + WEIGHT_DECAY: 0.01 + MOMENTUM: 0.9 + + MOMS: [0.95, 0.85] + PCT_START: 0.4 + DIV_FACTOR: 10 + DECAY_STEP_LIST: [35, 45] + LR_DECAY: 0.1 + LR_CLIP: 0.0000001 + + LR_WARMUP: False + WARMUP_EPOCH: 1 + + GRAD_NORM_CLIP: 10 diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh new file mode 100644 index 0000000000..d195156601 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# install env +echo "*******prepare benchmark start ***********" +pip install -U pip +echo `pip --version` + + +cd .. +unset https_proxy && unset http_proxy +if [ ! -f "torch_dev_whls.tar" ];then + wget ${FLAG_TORCH_WHL_URL} +fi +tar -xf torch_dev_whls.tar +for whl_file in torch_dev_whls/* +do + pip install ${whl_file} +done +pip install spconv-cu117 +python setup.py develop +unset https_proxy && unset http_proxy + + +# 由于kitti数据集太大,为避免每次下载过于耗时,请将kitti数据集下载后,软链到/data/Dataset/kitti +if [ ! -d "/data/Dataset/KITTI_800" ]; then + cd /data/Dataset + wget https://paddle3d.bj.bcebos.com/TIPC/dataset/KITTI_800.tar --no-check-certificate + tar -xf KITTI_800.tar + cd - +fi +rm -rf data/KITTI_800 +ln -s /data/Dataset/KITTI_800 data/KITTI_800 +cd - +echo "*******prepare benchmark end***********" diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/run_benchmark.sh b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/run_benchmark.sh new file mode 100644 index 0000000000..5c0d35f3f5 --- /dev/null +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/run_benchmark.sh @@ -0,0 +1,113 @@ +#!/usr/bin/env bash + +# Test training benchmark for a model. + +# Usage: CUDA_VISIBLE_DEVICES=xxx bash run_benchmark.sh ${model_name} ${run_mode} ${fp_item} ${bs_item} ${max_iter} ${num_workers} + +function _set_params(){ + model_item=${1:-"pointpillars"} # (必选) 模型 item |fastscnn|segformer_b0| ocrnet_hrnetw48 + base_batch_size=${2:-"2"} # (必选) 每张卡上的batch_size + fp_item=${3:-"fp32"} # (必选) fp32|fp16 + run_mode=${4:-"DP"} # (必选) MP模型并行|DP数据并行|PP流水线并行|混合并行DP1-MP1-PP1|DP1-MP4-PP1 + device_num=${5:-"N1C4"} # (必选) 使用的卡数量,N1C1|N1C8|N4C8 (4机32卡) + profiling=${PROFILING:-"false"} # (必选) Profiling 开关,默认关闭,通过全局变量传递 + model_repo="OpenPCDet" # (必选) 模型套件的名字 + ips_unit="samples/sec" # (必选)速度指标单位 + skip_steps=10 # (必选)解析日志,跳过模型前几个性能不稳定的step + keyword="ips:" # (必选)解析日志,筛选出性能数据所在行的关键字 + + convergence_key="loss:" # (可选)解析日志,筛选出收敛数据所在行的关键字 如:convergence_key="loss:" + max_iter=${6:-"400"} # (可选) + num_workers=${7:-"16"} # (可选) + + # 以下为通用拼接log路径,无特殊可不用修改 + model_name=${model_item}_bs${base_batch_size}_${fp_item}_${run_mode} # (必填) 切格式不要改动,与平台页面展示对齐 + device=${CUDA_VISIBLE_DEVICES//,/ } + arr=(${device}) + num_gpu_devices=${#arr[*]} + run_log_path=${TRAIN_LOG_DIR:-$(pwd)} # (必填) TRAIN_LOG_DIR benchmark框架设置该参数为全局变量 + profiling_log_path=${PROFILING_LOG_DIR:-$(pwd)} # (必填) PROFILING_LOG_DIR benchmark框架设置该参数为全局变量 + speed_log_path=${LOG_PATH_INDEX_DIR:-$(pwd)} + train_log_file=${run_log_path}/${model_repo}_${model_name}_${device_num}_log + profiling_log_file=${profiling_log_path}/${model_repo}_${model_name}_${device_num}_profiling + speed_log_file=${speed_log_path}/${model_repo}_${model_name}_${device_num}_speed + if [ ${profiling} = "true" ];then + add_options="profiler_options=\"batch_range=[50, 60]; profile_path=model.profile\"" + log_file=${profiling_log_file} + else + add_options="" + log_file=${train_log_file} + fi +} + +function _analysis_log(){ + python analysis_log.py ${model_name} ${base_batch_size} ${log_file} ${speed_log_file} ${device_num} +} + +function _train(){ + batch_size=${base_batch_size} # 如果模型跑多卡但进程时,请在_train函数中计算出多卡需要的bs + + echo "current ${model_name} CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES, gpus=${device_num}, batch_size=${batch_size}" + + train_config="${model_item}.yaml" + + use_com_args="" + if [ ${FLAG_TORCH_COMPILE} = "True" ];then + use_com_args="--torchcompile" + fi + use_amp="" + if [ ${fp_item} = "fp16" ];then + use_amp="--use_amp" + fi + + gpus=${device_num:3:1} + train_options="--cfg_file=${train_config} + --epochs=${gpus} + --workers=${num_workers} + --logger_iter_interval=10 + --num_epochs_to_eval=10000 + --ckpt_save_interval=10000 + ${use_amp} + --set OPTIMIZATION.BATCH_SIZE_PER_GPU ${batch_size}" + + if [ ${device_num} = "N1C1" ]; then + train_cmd="python train.py ${train_options}" + else + train_cmd="bash scripts/dist_train.sh ${gpus} ${train_options}" + fi + +# 以下为通用执行命令,无特殊可不用修改 + echo ${train_cmd} + timeout 15m ${train_cmd} > ${log_file} 2>&1 + if [ $? -ne 0 ];then + echo -e "${model_name}, FAIL" + else + echo -e "${model_name}, SUCCESS" + fi + kill -9 `ps -ef|grep 'python'|awk '{print $2}'` + if [ ${device_num} != "N1C1" -a -d mylog ]; then + rm ${log_file} + cp mylog/workerlog.0 ${log_file} + fi +} + +_set_params $@ +export model_branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3` +export model_commit=$(git log|head -n1|awk '{print $2}') + +# clear share memory +rm -rf /dev/shm/* + +export frame_version=`python -c "import torch;print(torch.__version__)"` +echo "---------frame_version is torch ${frame_version}" +echo "---------model_branch is ${model_branch}" +echo "---------model_commit is ${model_commit}" + +job_bt=`date '+%Y%m%d%H%M%S'` +_train +job_et=`date '+%Y%m%d%H%M%S'` +export model_run_time=$((${job_et}-${job_bt})) +_analysis_log + +# kill all python processes +ps -ef | grep python | awk '{ print $2 }' | xargs kill -9 From 9d1387657113c9d327f34555f05c8e7cb102210a Mon Sep 17 00:00:00 2001 From: Stinky-Tofu Date: Tue, 4 Apr 2023 11:54:08 +0000 Subject: [PATCH 10/13] [Fix] add docker_images and models_path for paddleSeg pointpillars --- frame_benchmark/docker_images.yaml | 1 + frame_benchmark/models_path.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/frame_benchmark/docker_images.yaml b/frame_benchmark/docker_images.yaml index 6bd31b76aa..362526038d 100755 --- a/frame_benchmark/docker_images.yaml +++ b/frame_benchmark/docker_images.yaml @@ -99,3 +99,4 @@ pytorch: petrv2: iregistry.baidu-int.com/paddlecloud/base-images:paddlecloud-ubuntu18.04-gcc8.2-cuda11.7-cudnn8.4.1-nccl2.12.12 VideoSwin: iregistry.baidu-int.com/paddlecloud/base-images:paddlecloud-ubuntu18.04-gcc8.2-cuda11.7-cudnn8.4.1-nccl2.12.12 vit_adapter: iregistry.baidu-int.com/paddlecloud/base-images:paddlecloud-ubuntu18.04-gcc8.2-cuda11.7-cudnn8.4.1-nccl2.12.12 + pointpillars: iregistry.baidu-int.com/paddlecloud/base-images:paddlecloud-ubuntu18.04-gcc8.2-cuda11.7-cudnn8.4.1-nccl2.12.12 diff --git a/frame_benchmark/models_path.yaml b/frame_benchmark/models_path.yaml index 0b711b1f1d..afbe4cde25 100644 --- a/frame_benchmark/models_path.yaml +++ b/frame_benchmark/models_path.yaml @@ -99,3 +99,4 @@ pytorch: petrv2: benchmark/frame_benchmark/pytorch/dynamic/Paddle3D/models/PETR VideoSwin: benchmark/frame_benchmark/pytorch/dynamic/PaddleVideo/models/Video-Swin-Transformer vit_adapter: benchmark/frame_benchmark/pytorch/dynamic/PaddleSeg/models/ViT-Adapter + pointpillars: benchmark/frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet From 9f76f3e136535c21c54d2bec0abc5cc049250812 Mon Sep 17 00:00:00 2001 From: Stinky-Tofu Date: Thu, 6 Apr 2023 07:30:50 +0000 Subject: [PATCH 11/13] modify OpenPCDet submodule --- .gitmodules | 3 ++- frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index d0455c6f86..572e3c0367 100644 --- a/.gitmodules +++ b/.gitmodules @@ -143,4 +143,5 @@ branch = main [submodule "frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet"] path = frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet - url = https://github.com/open-mmlab/OpenPCDet.git + url = git@github.com:PaddleBenchmark/OpenPCDet.git + breanch = master diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet b/frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet index 83954d039e..0d6d9eb75f 160000 --- a/frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/models/OpenPCDet @@ -1 +1 @@ -Subproject commit 83954d039e48aedc95b09dac2075eb38f571d326 +Subproject commit 0d6d9eb75fbacb693915e7673ecba40f22859386 From 471de45e7c2ff6930f9012bb640be2c88dac28de Mon Sep 17 00:00:00 2001 From: Stinky-Tofu Date: Thu, 6 Apr 2023 08:37:50 +0000 Subject: [PATCH 12/13] mkdir /data/Dataset --- .../Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh index d195156601..1dc6806688 100644 --- a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh @@ -22,6 +22,7 @@ unset https_proxy && unset http_proxy # 由于kitti数据集太大,为避免每次下载过于耗时,请将kitti数据集下载后,软链到/data/Dataset/kitti +mkdir -p /data/Dataset if [ ! -d "/data/Dataset/KITTI_800" ]; then cd /data/Dataset wget https://paddle3d.bj.bcebos.com/TIPC/dataset/KITTI_800.tar --no-check-certificate From 5c1a09b561e56e18f3c05550665e317fdeeb9981 Mon Sep 17 00:00:00 2001 From: Stinky-Tofu Date: Thu, 6 Apr 2023 09:11:19 +0000 Subject: [PATCH 13/13] acclerate package download --- .../Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh index 1dc6806688..1d33ceaa19 100644 --- a/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh +++ b/frame_benchmark/pytorch/dynamic/Paddle3D/scripts/pointpillars/benchmark_common/prepare.sh @@ -11,14 +11,16 @@ unset https_proxy && unset http_proxy if [ ! -f "torch_dev_whls.tar" ];then wget ${FLAG_TORCH_WHL_URL} fi +export https_proxy=${HTTP_PRO} && export http_proxy=${HTTPS_PRO} tar -xf torch_dev_whls.tar for whl_file in torch_dev_whls/* do pip install ${whl_file} done +pip install kornia +unset https_proxy && unset http_proxy pip install spconv-cu117 python setup.py develop -unset https_proxy && unset http_proxy # 由于kitti数据集太大,为避免每次下载过于耗时,请将kitti数据集下载后,软链到/data/Dataset/kitti