Skip to content

Add small MPI_Alltoall after autotuning to work around MPI memory registration delaying cudaFree.#47

Merged
romerojosh merged 2 commits intomainfrom
mpi_memory_war
Jan 31, 2025
Merged

Add small MPI_Alltoall after autotuning to work around MPI memory registration delaying cudaFree.#47
romerojosh merged 2 commits intomainfrom
mpi_memory_war

Conversation

@romerojosh
Copy link
Copy Markdown
Collaborator

We have observed that some versions of UCX have a behavior where buffers used in MPI operations may not be immediately freed, even once cudaFree is called on them. This is due to their internal caching of memory registration handles on these buffers. These cached handles are not immediately destroyed upon a call to cudaFree and the CUDA driver will not reclaim this memory until these registration handles are freed.

This issue impacts memory usage after cuDecomp autotuning, where the memory used for the autotuning test buffers may not be immediately allocatable by users after autotuning completes. I have implemented a workaround that attempts to alleviate this issue in this PR. The workaround is to launch a MPI_Alltoall on small GPU buffers after autotuning completes to force UCX to invalidate and destroy the stale registration handles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant