-
Notifications
You must be signed in to change notification settings - Fork 28
Address RMM setup in bootstrap_dask_cluster
#779
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
Open
rjzamora
wants to merge
4
commits into
rapidsai:main
Choose a base branch
from
rjzamora:rmm-setup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There's one thing that concerns me here, how do we handle the case where Dask-CUDA has already setup RMM? In Dask-CUDA, specifically the benchmarks, we have recently introduced a safeguard in https://github.com/rapidsai/dask-cuda/blob/669fbc76a1c29357e572646fb3f7f5cacc69f935/dask_cuda/benchmarks/utils.py#L549-L556, that checks whether a cluster has already setup RMM which happens if the cluster was setup externally, however, in Dask integration in RapidsMPF my understanding is that
LocalCUDAClusterwill run the internalRMMSetupand then here we'll run it again, no? Setting it up twice may have downsides, particularly if memory has been already registered for example for use with CUDA IPC (e.g., via UCX). Ideally, we would prevent at all costs setting RMM up more than once.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.
Yeah, this is a good question.
If this PR were to be merged right now, I don't think the behavior of the cudf-polars pdsh benchmarks change. We would still be passing in the
rmm_*arguments toLocalCUDACluster, and we would not be passing in thermm_*Optionstobootstrap_dask_cluster. Therefore, this call tosetup_rmm_poolwould be a no-op.In a follow-up cudf-polars PR, we will need to move the
rmm_*arguments from theLocalCUDAClustercall to thebootstrap_dask_clustercall.With that said, we still don't have a bullet-proof plan for detecting when RMM has already been configured on a rapidsmpf worker. We can only check for the
RMMSetupplugin when we are running on top of Dask and didn't usesetup_rmm_pool.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 agree, this is probably fine for the single-node cluster. However, when setting up a multi-node cluster you need to provide an already setup cluster, in which case
rmpf_worker_setupwill run and setup RMM a second time, no?I don't think we have a bullet-proof way to prevent it, and maybe never will have one, but perhaps we should implement a similar check for
RMMSetupto that I linked in Dask-CUDA. I think when we run multi-node setup we will end up callingsetup_rmm_poolon top of the already executedRMMSetupon the cluster, but correct me if I'm still overlooking something.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.
When you setup a multi-node cluster, you can pass in the
--rmm-*options when you create your workers, or you can set up the rmm pool withinrmpf_worker_setup. Either way,rmpf_worker_setup(and thereforesetup_rmm_pool) will run on each worker when you callbootstrap_dask_clusteron the client.The important detail is that
setup_rmm_poolwill not actually do anything if theOptionsargument is empty (or doesn't contain any rmm-related options). By default, all of these arguments will beNone. The user (orutils.pyscript) needs to manually add the rmm-related options to thebootstrap_dask_clusterOptionsargument.Yes. However, we will not actually do anything in the
setup_rmm_poolcall unless we have updated thebootstrap_dask_clusterOptionsargument to contain rmm options.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.
But that trusts the user NOT to specify
--rmm-*to bothdask cuda workerand the client simultaneously, right? So while this is functional, it could still be dangerous. I don't want to hold off on this PR much longer, I just want to ensure we're aware we may be compromising on one end or another.