UCT/CUDA/CUDA_IPC: Unmap memhandle mapped at rkey unpack & rkey ptr.#11288
Open
rakhmets wants to merge 1 commit intoopenucx:masterfrom
Open
UCT/CUDA/CUDA_IPC: Unmap memhandle mapped at rkey unpack & rkey ptr.#11288rakhmets wants to merge 1 commit intoopenucx:masterfrom
rakhmets wants to merge 1 commit intoopenucx:masterfrom
Conversation
93e5320 to
373daae
Compare
yosefe
requested changes
Mar 24, 2026
| extended_rkey = &unpacked_rkey->super; | ||
| rkey = &extended_rkey->super; | ||
| rkey_release_args = (uct_cuda_ipc_rkey_release_args_h)args; | ||
| status = uct_cuda_ipc_unmap_memhandle(rkey->pid, extended_rkey->pid_ns, |
Contributor
There was a problem hiding this comment.
so it means rkey will not be cached? seems it can hurt RNDV protocol performance
Contributor
Author
There was a problem hiding this comment.
Every uct_cuda_ipc_map_memhandle should be paired with uct_cuda_ipc_unmap_memhandle.
The one in uct_cuda_ipc_rkey_unpack does not have a pair. This PR fixes this.
I have just updated PR. So that UCX_CUDA_IPC_CACHE is taken into account in this path.
rakhmets
commented
Mar 24, 2026
Contributor
Author
90d3956 to
3dffc60
Compare
Contributor
Author
3dffc60 to
dcb2923
Compare
dcb2923 to
01eca31
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What?
Unregistered the CUDA IPC memory handle that was registered when unpacking the remote memory key and/or getting local pointer to remote memory.
Why?
CUDA IPC component does peer reachability check when unpacking the remote memory key. At the first reachability check it opens an inter process memory handle exported from another process. The component also may open an inter process memory handle exported from another process at getting local pointer to remote memory. If this handle is not closed, then the memory on the remote side cannot be released.