Skip to content

Commit

Permalink
Refine according to comment (#11301)
Browse files Browse the repository at this point in the history
  • Loading branch information
RuohengMa authored Nov 24, 2023
1 parent c8544d0 commit 317f56a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tools/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,11 @@ def train(config,
eta_sec = ((epoch_num + 1 - epoch) * \
len(train_dataloader) - idx - 1) * eta_meter.avg
eta_sec_format = str(datetime.timedelta(seconds=int(eta_sec)))
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()} B"
max_mem_allocated_str = f"max_mem_allocated: {paddle.device.cuda.max_memory_allocated()} B"
else:
max_mem_reserved_str = f"max_mem_reserved: not supported on non-CUDA device B"
max_mem_allocated_str = f"max_mem_allocated: not supported on non-CUDA device B"
strs = 'epoch: [{}/{}], global_step: {}, {}, avg_reader_cost: ' \
'{:.5f} s, avg_batch_cost: {:.5f} s, avg_samples: {}, ' \
'ips: {:.5f} samples/s, eta: {}, {}, {}'.format(
Expand Down

0 comments on commit 317f56a

Please sign in to comment.