-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add available_device_memory
to fetch free amount of memory on a GPU
#1567
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question.
@@ -1188,3 +1188,10 @@ def get_log_filenames(): | |||
else None | |||
for i, each_mr in _per_device_mrs.items() | |||
} | |||
|
|||
|
|||
def get_free_device_memory(percent): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: let's make this parameter self-documenting with:
def get_free_device_memory(*, percent: int):
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks.
get_free_device_memory
to fetch free amount of memory on a GPUavailable_device_memory
to fetch free amount of memory on a GPU
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more round of comments -- but I think this can be merged after you fix the import
statement, so I'll approve.
|
||
def available_device_memory(): | ||
""" | ||
Returns a tuple of free and total device memory memory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish this was in a Returns
block that follows numpy docstring style but it doesn't seem like RMM uses full docstrings...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RMM Python is immature in a lot of ways. No time like the present...
Co-authored-by: Bradley Dice <[email protected]>
/merge |
Description
This PR adds
get_free_device_memory
that returns free GPU memory necessary for rapidsai/cudf#15628Checklist