Merge pull request #985 from Jackwaterveg/benchmark

revise the benchmark
pull/987/head
Hui Zhang 3 years ago committed by GitHub
commit 51a6845564
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -206,12 +206,13 @@ class U2Trainer(Trainer):
observation['batch_cost'] = observation[ observation['batch_cost'] = observation[
'reader_cost'] + observation['step_cost'] 'reader_cost'] + observation['step_cost']
observation['samples'] = observation['batch_size'] observation['samples'] = observation['batch_size']
observation['ips[sent./sec]'] = observation[ observation['ips,sent./sec'] = observation[
'batch_size'] / observation['batch_cost'] 'batch_size'] / observation['batch_cost']
for k, v in observation.items(): for k, v in observation.items():
msg += f" {k}: " msg += f" {k.split(',')[0]}: "
msg += f"{v:>.8f}" if isinstance(v, msg += f"{v:>.8f}" if isinstance(v,
float) else f"{v}" float) else f"{v}"
msg += f" {k.split(',')[1]}" if len(k.split(',')) == 2 else f""
msg += "," msg += ","
msg = msg[:-1] # remove the last "," msg = msg[:-1] # remove the last ","
if (batch_index + 1 if (batch_index + 1

@ -10,8 +10,10 @@ pushd ../../../examples/aishell/s1
source path.sh source path.sh
source ${MAIN_ROOT}/utils/parse_options.sh || exit 1;
fp_item_list=(fp32) fp_item_list=(fp32)
bs_item=(16) bs_item=(16 30)
config_path=conf/conformer.yaml config_path=conf/conformer.yaml
seed=0 seed=0
output=exp/conformer output=exp/conformer
@ -34,7 +36,4 @@ done
popd popd
mkdir -p log
bash run_analysis_sp.sh > log/log_sp.out
bash run_analysis_mp.sh > log/log_mp.out

@ -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"

@ -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"
Loading…
Cancel
Save