Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Jan 9, 2025
1 parent 0566b5e commit ac1fb86
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/anemoi/inference/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ def __call__(self, title):
bytes_to_human(torch.cuda.memory_reserved(0)),
)

free, total = torch.cuda.mem_get_info("cuda:0")
mem_used_MB = (total - free) / 1024**2
LOG.info(f"Pytorch mem_get_info says 'cuda:0' is using {mem_used_MB}MB / {total / 1024 ** 2}MB of memory.")

self.last_total = total
self.last_title = title
self.known = tensors

free, total = torch.cuda.mem_get_info("cuda:0")
LOG.info(f"Pytorch mem_get_info says 'cuda:0' is using {bytes_to_human(total - free)} of memory.")

0 comments on commit ac1fb86

Please sign in to comment.