From 0a4c9c8ea7a8ef856024b2e30435972b4efb313f Mon Sep 17 00:00:00 2001 From: hong <43953930+phlrain@users.noreply.github.com> Date: Wed, 4 Nov 2020 20:25:16 +0800 Subject: [PATCH] fix bert multi gpu bug; and change qps to ips; test=develop (#4930) --- PaddleNLP/pretrain_language_models/BERT/run_classifier.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PaddleNLP/pretrain_language_models/BERT/run_classifier.py b/PaddleNLP/pretrain_language_models/BERT/run_classifier.py index 5be40e1f..d0cf29d7 100644 --- a/PaddleNLP/pretrain_language_models/BERT/run_classifier.py +++ b/PaddleNLP/pretrain_language_models/BERT/run_classifier.py @@ -342,7 +342,7 @@ def main(args): fetch_list = [loss.name, accuracy.name, scheduled_lr.name, num_seqs.name] outputs = exe.run(train_compiled_program, fetch_list=fetch_list) - interval_seq_num += outputs[3] # get the sequence number + interval_seq_num += np.sum( outputs[3] ) # get the sequence number if steps % args.skip_steps == 0: if args.use_fp16: @@ -381,7 +381,7 @@ def main(args): ce_info.append([np.sum(total_cost) / np.sum(total_num_seqs), np.sum(total_acc) / np.sum(total_num_seqs), used_time]) if steps > 0 : throughput.append( args.skip_steps / used_time) - log_record = log_record + ", speed: %f steps/s" % (args.skip_steps / used_time) + ", qps: %f sequence/s" % ( interval_seq_num / used_time ) + log_record = log_record + ", speed: %f steps/s" % (args.skip_steps / used_time) + ", ips: %f sequence/s" % ( interval_seq_num / used_time ) print(log_record) else: print(log_record) -- GitLab