From a1f93391816708871aec2d125302486116712c85 Mon Sep 17 00:00:00 2001 From: gmm <38800877+mmglove@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:22:15 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90benchmark=E3=80=91add=20max=5Fmem=5Fre?= =?UTF-8?q?served=20for=20benchmark=20=20(#3604)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix profiler * add max_mem_reserved for benchmark --- paddlespeech/t2s/training/trainer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/paddlespeech/t2s/training/trainer.py b/paddlespeech/t2s/training/trainer.py index 9a32bca8..7f1b17de 100644 --- a/paddlespeech/t2s/training/trainer.py +++ b/paddlespeech/t2s/training/trainer.py @@ -20,7 +20,7 @@ from typing import List from typing import Union import six - +import paddle from paddlespeech.t2s.training.extension import Extension from paddlespeech.t2s.training.extension import PRIORITY_READER from paddlespeech.t2s.training.reporter import scope @@ -162,8 +162,12 @@ class Trainer(object): ) + "avg_batch_cost: {:.5f} sec, ".format(avg_batch_cost) msg += "avg_samples: {}, ".format( self.updater. - batch_size) + "avg_ips: {:.5f} sequences/sec".format( + batch_size) + "avg_ips: {:.5f} sequences/sec,".format( self.updater.batch_size / avg_batch_cost) + max_mem_reserved_str = f" max_mem_reserved: {paddle.device.cuda.max_memory_reserved()} B" + max_mem_allocated_str = f" max_mem_allocated: {paddle.device.cuda.max_memory_allocated()} B" + msg += max_mem_reserved_str + "," + max_mem_allocated_str + logger.info(msg) # execute extension when necessary