-
Notifications
You must be signed in to change notification settings - Fork 932
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
[REVIEW] Add cudf.set_allocator
function for easier RMM config
#2682
Conversation
As @harrism mentioned in #2676 (comment), when you specify a pool size of |
@jrhemstad - yes, |
So a word of caution. Calling For example:
Any time memory was allocated with As such, would it be possible to make it such that |
Yup, that's the reason I have the https://github.com/rapidsai/cudf/pull/2682/files#diff-cd29b5f971f5dbde2615245fd859be27R74 import cudf
cudf.set_allocator(...)
a = cudf.Series(...)
cudf.set_allocator(...) # ignored That being said, this doesn't protect the user from doing something like this: import cudf
a = cudf.Series(...)
cudf.set_allocator(...) # frees memory associated with `a` |
Nifty, glad that exists in Python.
This is problematic only if default allocator is
However, your example does illustrate another potential problem. If the user allocates a bunch of memory w/ non-pool mode, and then calls |
It doesn't :) but it's trivial to write: cudf/python/cudf/cudf/utils/utils.py Line 182 in 05e297e
|
Codecov Report
@@ Coverage Diff @@
## branch-0.10 #2682 +/- ##
===============================================
+ Coverage 86.36% 86.43% +0.07%
===============================================
Files 48 48
Lines 8808 8854 +46
===============================================
+ Hits 7607 7653 +46
Misses 1201 1201
Continue to review full report at Codecov.
|
python/cudf/cudf/__init__.py
Outdated
|
||
@_initfunc | ||
def set_allocator(allocator="default", pool=False, initial_pool_size=None): | ||
""" |
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.
Needs a complete docstring
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.
Nice
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.
Would be nice to expose logging.
cudf.set_allocator
function for easier RMM configcudf.set_allocator
function for easier RMM config
…dd-set-allocator
…dd-set-allocator
cudf.set_allocator
function for easier RMM configcudf.set_allocator
function for easier RMM config
|
Thanks @kkraus14 :) |
Thanks all! Will this then be included in the nightlies? |
Yep. |
Without memory pool:
With memory pool (default allocator), and initial pool size of 1/2 GPU memory:
With memory pool (default allocator), and initial pool size of 0 bytes (i.e., caching allocator):
cc: @jrhemstad @harrism @jakirkham