-
Notifications
You must be signed in to change notification settings - Fork 96
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
Hostfile: register the removal of an existing key #500
Hostfile: register the removal of an existing key #500
Conversation
@@ -148,6 +148,10 @@ def __init__( | |||
self.fast = self.host_buffer if memory_limit == 0 else self.host_buffer.fast | |||
|
|||
def __setitem__(self, key, value): | |||
if key in self.device_buffer: | |||
# Make sure we register the removal of an existing key | |||
del self[key] |
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'm not sure I understand this, what is the case when this is necessary? If the key already exists in self.device_buffer
but it now refers to a non-CUDA object that's going to be stored in self.host_buffer
, is that right? If so, does this actually happen in practice?
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.
No, in the case of DeviceHostFile
and in the current Dask/Distributed implementation, I don't think it is likely to happen in practice.
In ProxifyHostFile
it is way more likely to happen and I added the check in DeviceHostFile
for robustness.
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 see, thanks for confirming.
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.
LGTM, thanks @madsbk .
@@ -148,6 +148,10 @@ def __init__( | |||
self.fast = self.host_buffer if memory_limit == 0 else self.host_buffer.fast | |||
|
|||
def __setitem__(self, key, value): | |||
if key in self.device_buffer: | |||
# Make sure we register the removal of an existing key | |||
del self[key] |
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 see, thanks for confirming.
Codecov Report
@@ Coverage Diff @@
## branch-0.18 #500 +/- ##
===============================================
+ Coverage 90.42% 91.62% +1.19%
===============================================
Files 15 18 +3
Lines 1128 1432 +304
===============================================
+ Hits 1020 1312 +292
- Misses 108 120 +12
Continue to review full report at Codecov.
|
@gpucibot merge |
This PR makes sure that hostfiles register the removal of an existing key. They didn't do that before when mixing CUDA and non-CUDA objects.