-
Notifications
You must be signed in to change notification settings - Fork 208
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
Make IPC handle export optional in cuda_async_memory_resource #1030
Conversation
I ran into a problem with the Pytests on CUDA 11.2 because of this C++ code:
On CUDA 11.2 there is no way to check the supported handle types. So we don't support anything other than There are two options: Change the default to |
…on dependency. Cython is not working -- not sure how to do it.
…x-opt-in-async-IPC
OK @shwina to avoid having to do the hackery on the Cython side, I added an |
@vyasr I think I've addressed all your comments. Thanks everyone for the reviews. before we merge, I would like someone to comment on whether changing to default disabling IPC export is going to cause problems (e.g. for UCX or Dask). Thanks! |
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! There's a minor typo fix that I'll just commit.
I'm guessing that this would be a good question for @quasiben or @jakirkham. |
Think @pentschev would know better. So will defer to him |
{ | ||
int supported_handle_types_bitmask{}; | ||
#if CUDART_VERSION >= 11030 // 11.3 introduced cudaDevAttrMemoryPoolSupportedHandleTypes | ||
cudaDeviceGetAttribute(&supported_handle_types_bitmask, |
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.
Need to error check return value.
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.
Done, using RMM_CUDA_TRY
. At least this way we will throw a rmm::cuda_error
exception.
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.
After discussing offline, sounds like we are good to go on the Python side
I benchmarked with and without IPC enabled (None vs. PosixFileDescriptor) and see no appreciable difference. So I will try setting the default in Python back to
|
I changed the Python |
OK, I ran into the same problem with |
We could default to |
I don't understand. True and False are both options. But how do we detect the CUDA runtime version at runtime in Python? That would still be a breaking change. If we are going to break the API (which I am increasingly thinking is fine to do) then why not just default to False. |
Defaulting to To find the driver/runtime versions you can use RMM! For example: |
Sync'd offline with Mark and we agreed this is best to do. We don't believe this is widely used enough that it will impact many users. |
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
posix handle export is not supported currently in cudaMemPoolCreate on WSL2. This change makes the default to not export IPC handles (
cudaMemHandleTypeNone
), and allows setting a different handle type.In Python,
cuda_async_memory_resource
takes a newenable_ipc
parameter which currently defaults toFalse
, which is a breaking change. Defaulting toFalse
was necessary because we can't check supported handle types on CUDA 11.2, only 11.3 and above. Also, theTrue
path is currently written to only support Posix handles, so WSL2 is not supported. Also, IPC has some overheads on cudaMallocAsync pools which we may want to avoid.Fixes #1029