Skip to content
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

Merged
merged 2 commits into from
Jan 26, 2021

Conversation

madsbk
Copy link
Member

@madsbk madsbk commented Jan 25, 2021

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.

@madsbk madsbk requested a review from a team as a code owner January 25, 2021 16:41
@madsbk madsbk added 3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jan 25, 2021
@@ -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]
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

@pentschev pentschev left a 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]
Copy link
Member

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.

@pentschev pentschev added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels Jan 26, 2021
@codecov-io
Copy link

codecov-io commented Jan 26, 2021

Codecov Report

Merging #500 (9433b79) into branch-0.18 (32d9d33) will increase coverage by 1.19%.
The diff coverage is 94.97%.

Impacted file tree graph

@@               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     
Impacted Files Coverage Δ
dask_cuda/cli/dask_cuda_worker.py 96.92% <ø> (ø)
dask_cuda/cuda_worker.py 78.75% <75.00%> (+1.73%) ⬆️
dask_cuda/device_host_file.py 90.90% <80.00%> (-7.96%) ⬇️
dask_cuda/get_device_memory_objects.py 89.04% <89.04%> (ø)
dask_cuda/proxify_device_objects.py 91.83% <91.83%> (ø)
dask_cuda/proxy_object.py 90.88% <94.94%> (+3.08%) ⬆️
dask_cuda/explicit_comms/comms.py 99.02% <100.00%> (+0.01%) ⬆️
dask_cuda/explicit_comms/utils.py 100.00% <100.00%> (ø)
dask_cuda/local_cuda_cluster.py 81.17% <100.00%> (+0.68%) ⬆️
dask_cuda/proxify_host_file.py 100.00% <100.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f96befa...9433b79. Read the comment docs.

@pentschev
Copy link
Member

@gpucibot merge

@rapids-bot rapids-bot bot merged commit f2739aa into rapidsai:branch-0.18 Jan 26, 2021
@madsbk madsbk deleted the hostfile_remove_existing_key branch January 27, 2021 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants