-
Notifications
You must be signed in to change notification settings - Fork 600
Improved memory efficiency in UMAP given precomputed knn graphs #7481
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
Improved memory efficiency in UMAP given precomputed knn graphs #7481
Conversation
cpp/include/cuml/manifold/common.hpp
Outdated
| cudaGetLastError(); | ||
| return false; // Assume host pointer if query fails | ||
| } | ||
| return attr.type == cudaMemoryTypeDevice || attr.type == cudaMemoryTypeManaged; |
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.
this pattern of checking if its a device pointer is being repeated way too much. In cuvs and raft we have abstracted it away into functions such as check_pointer_residency. Can you check if you can use those directly? If you cannot use those directly, we should create an issue for this -- ideally we'd have a function in raft that does this.
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.
Changes to using check_pointer_residency!
hcho3
left a comment
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
csadorf
left a comment
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. Just a few minor suggestions for improved wording in the docs.
|
Had to change the default based on the changes of this PR: #7501 |
|
/merge |
Closes #7143
This PR improves memory usage in UMAP when given a precomputed knn graph.
Previously, a user-given knn graph will occupy GPU memory throughout the full UMAP pipeline even though it is not needed in later steps of UMAP.
In this PR, if the user-given knn graph is on host memory, we keep it on host memory and copy to device at the cpp level to allow better memory management.
This PR with precomputed knn graph on CPU
Before with precomputed knn graph on CPU