Skip to content

Commit

Permalink
【benchmark】add max_mem_reserved for benchmark (#3604)
Browse files Browse the repository at this point in the history
* fix profiler

* add max_mem_reserved for benchmark
  • Loading branch information
mmglove committed Nov 22, 2023
1 parent 1dc67f9 commit a1f9339
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions paddlespeech/t2s/training/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
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
Expand Down Expand Up @@ -162,8 +162,12 @@ def run(self):
) + "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
Expand Down

0 comments on commit a1f9339

Please sign in to comment.