Skip to content

Commit

Permalink
removed excess logic now that using pynvml
Browse files Browse the repository at this point in the history
  • Loading branch information
jperez999 committed Jan 12, 2024
1 parent bd495d3 commit 8e6a737
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions merlin/core/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,9 @@ def device_mem_size(kind="total", cpu=False):

if kind not in ["free", "total"]:
raise ValueError(f"{kind} not a supported option for device_mem_size.")
try:
return pynvml_mem_size(kind=kind)
except NotImplementedError:
if kind == "free":
# Not using NVML "free" memory, because it will not include RMM-managed memory
warnings.warn("get_memory_info is not supported. Using total device memory from NVML.")
size = pynvml_mem_size(kind="total", index=0)
return size

return pynvml_mem_size(kind=kind)



try:
Expand Down

0 comments on commit 8e6a737

Please sign in to comment.