【benchmark】fix gpu_mem unit (#3634)

* fix profiler

* add max_mem_reserved for benchmark

* fix benchmark
pull/3711/head
gmm 7 months ago committed by GitHub
parent f2416ff365
commit 1b8ca706d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -164,9 +164,10 @@ class Trainer(object):
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)

Loading…
Cancel
Save