未验证 提交 51a68455 编写于 作者: H Hui Zhang 提交者: GitHub

Merge pull request #985 from Jackwaterveg/benchmark

revise the benchmark
...@@ -206,12 +206,13 @@ class U2Trainer(Trainer): ...@@ -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 ...@@ -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 ...@@ -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
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"
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"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册