diff --git a/paddlespeech/s2t/exps/u2/model.py b/paddlespeech/s2t/exps/u2/model.py index cf02d7d3b52bccf342c5434aed8211ceb636c8fb..32311c88298dfff45691d631ac29bf0c0df60513 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 f9244f5d17c12960a403c8d04cd14b280749336a..c09bbf09b0547f3f0214f85a437dae23f764df98 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 f68dd1e4557f61b2e24b94e545828fb568154cbc..0000000000000000000000000000000000000000 --- 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 e521db88d7c44096a2161494b090d7faad788c55..0000000000000000000000000000000000000000 --- 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"