【benchmark】fix gpu_mem unit (#3634)

* fix profiler

* add max_mem_reserved for benchmark

* fix benchmark
pull/3711/head
gmm 1 year 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. 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) self.updater.batch_size / avg_batch_cost)
max_mem_reserved_str = f" max_mem_reserved: {paddle.device.cuda.max_memory_reserved()} B" if paddle.device.is_compiled_with_cuda():
max_mem_allocated_str = f" max_mem_allocated: {paddle.device.cuda.max_memory_allocated()} B" max_mem_reserved_str = f" max_mem_reserved: {paddle.device.cuda.max_memory_reserved() // (1024 ** 2)} MB"
msg += max_mem_reserved_str + "," + max_mem_allocated_str 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) logger.info(msg)

Loading…
Cancel
Save