-
Notifications
You must be signed in to change notification settings - Fork 97
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
Nearest Neighbor in OpenCL #174
Comments
Hi @djhoese -- I came here via your recent thread on dask improvements for pyresample and started poking around. cuML has a GPU enabled |
That'd be great @quasiben! As an optional performance improvement, CUDA-only would still be fine. What would the code look like if we had dask arrays for X, Y, Z euclidean coordinates and a single 2D image array to be resampled? Are there optimizations available if we wanted to run the nearest neighbor again but with different image data (same coordinates)? Right now pyresample uses the pykdtree package. Also note that the X, Y, Z coordinates are converted from lon/lat arrays so if those could be given to the classifier directly that would save even more time. |
Looking deeper here I think cuML is lacking some functionality . While there are NearestNeighbor Classifiers, there is no KDTree implementation at the moment (though, there is an issue rapidsai/cuml#1690 ) . cuSpatial does had a quad-tree -- I'll ask around and see if there are any plans here. Apologies for the noise. |
No problem. Glad you could at least link to some other efforts in similar areas. |
Here is another CUDA kd-tree implementation I came across (BSD 3-clause license) |
Cupy seems to have a GPU-optimized kdtree docs.cupy.dev/en/latest/reference/generated/cupyx.scipy.spatial.KDTree.html |
I'd like to start this discussion because I might research this topic when I get bored. I am not an OpenCL or CUDA expert (or even novice) so I'm putting my findings here as I go.
Summary: KDTree is not typically a great algorithm for GPUs, it is intentionally good for CPUs. At the end someone provides a link to their paper on a GPU-friendly KDTree algorithm.
Python library with GPU OpenCL implementation with a mix of a KDTree and brute force algorithm.
C++ library advertised on Stackoverflow as "the fastest nearest neighbor algorithm on a GPU"
Simple OpenCL code for a brute force "minimum distance between this point and all others"
Fast k Nearest Neighbor Search using GPU
Has a python wrapper and has lots of stars
The text was updated successfully, but these errors were encountered: