From 843ea1c12e4f062e995a22493a04930cf191ad8b Mon Sep 17 00:00:00 2001 From: huangyuxin Date: Wed, 10 Nov 2021 07:26:41 +0000 Subject: [PATCH] revise the benchmark --- paddlespeech/s2t/exps/u2/model.py | 5 +++-- tests/benchmark/conformer/run.sh | 7 +++---- tests/benchmark/conformer/run_analysis_mp.sh | 12 ------------ tests/benchmark/conformer/run_analysis_sp.sh | 12 ------------ 4 files changed, 6 insertions(+), 30 deletions(-) delete mode 100644 tests/benchmark/conformer/run_analysis_mp.sh delete mode 100644 tests/benchmark/conformer/run_analysis_sp.sh diff --git a/paddlespeech/s2t/exps/u2/model.py b/paddlespeech/s2t/exps/u2/model.py index cf02d7d3..32311c88 100644 --- a/paddlespeech/s2t/exps/u2/model.py +++ b/paddlespeech/s2t/exps/u2/model.py @@ -206,12 +206,13 @@ class U2Trainer(Trainer): observation['batch_cost'] = observation[ 'reader_cost'] + observation['step_cost'] observation['samples'] = observation['batch_size'] - observation['ips[sent./sec]'] = observation[ + observation['ips,sent./sec'] = observation[ 'batch_size'] / observation['batch_cost'] for k, v in observation.items(): - msg += f" {k}: " + msg += f" {k.split(',')[0]}: " msg += f"{v:>.8f}" if isinstance(v, float) else f"{v}" + msg += f" {k.split(',')[1]}" if len(k.split(',')) == 2 else f"" msg += "," msg = msg[:-1] # remove the last "," if (batch_index + 1 diff --git a/tests/benchmark/conformer/run.sh b/tests/benchmark/conformer/run.sh index f9244f5d..c09bbf09 100644 --- a/tests/benchmark/conformer/run.sh +++ b/tests/benchmark/conformer/run.sh @@ -10,8 +10,10 @@ pushd ../../../examples/aishell/s1 source path.sh +source ${MAIN_ROOT}/utils/parse_options.sh || exit 1; + fp_item_list=(fp32) -bs_item=(16) +bs_item=(16 30) config_path=conf/conformer.yaml seed=0 output=exp/conformer @@ -34,7 +36,4 @@ done popd -mkdir -p log -bash run_analysis_sp.sh > log/log_sp.out -bash run_analysis_mp.sh > log/log_mp.out diff --git a/tests/benchmark/conformer/run_analysis_mp.sh b/tests/benchmark/conformer/run_analysis_mp.sh deleted file mode 100644 index f68dd1e4..00000000 --- a/tests/benchmark/conformer/run_analysis_mp.sh +++ /dev/null @@ -1,12 +0,0 @@ -python analysis.py \ - --filename "recoder_mp_bs16_fp32_ngpu8.txt" \ - --keyword "ips[sent./sec]:" \ - --base_batch_size 16 \ - --model_name "Conformer" \ - --mission_name "eight gpu" \ - --run_mode "mp" \ - --ips_unit "sent./sec" \ - --gpu_num 8 \ - --use_num 480 \ - --separator " " \ - --direction_id "1" diff --git a/tests/benchmark/conformer/run_analysis_sp.sh b/tests/benchmark/conformer/run_analysis_sp.sh deleted file mode 100644 index e521db88..00000000 --- a/tests/benchmark/conformer/run_analysis_sp.sh +++ /dev/null @@ -1,12 +0,0 @@ -python analysis.py \ - --filename "recoder_sp_bs16_fp32_ngpu1.txt" \ - --keyword "ips[sent./sec]:" \ - --base_batch_size 16 \ - --model_name "Conformer" \ - --mission_name "one gpu" \ - --run_mode "sp" \ - --ips_unit "sent./sec" \ - --gpu_num 1 \ - --use_num 60 \ - --separator " " \ - --direction_id "1"