Skip to content

Commit

Permalink
【benchmark】fix gpu_mem unit (#3634)
Browse files Browse the repository at this point in the history
* fix profiler

* add max_mem_reserved for benchmark

* fix benchmark
  • Loading branch information
mmglove committed Dec 5, 2023
1 parent f2416ff commit 1b8ca70
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions paddlespeech/t2s/training/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,10 @@ def run(self):
self.updater.
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
if paddle.device.is_compiled_with_cuda():
max_mem_reserved_str = f" max_mem_reserved: {paddle.device.cuda.max_memory_reserved() // (1024 ** 2)} MB"
max_mem_allocated_str = f" max_mem_allocated: {paddle.device.cuda.max_memory_allocated() // (1024 ** 2)} MB"
msg += max_mem_reserved_str + "," + max_mem_allocated_str

logger.info(msg)

Expand Down

0 comments on commit 1b8ca70

Please sign in to comment.