Skip to content
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

Open
djhoese opened this issue Mar 16, 2019 · 6 comments
Open

Nearest Neighbor in OpenCL #174

djhoese opened this issue Mar 16, 2019 · 6 comments

Comments

@djhoese
Copy link
Member

djhoese commented Mar 16, 2019

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.

@quasiben
Copy link

quasiben commented Dec 6, 2021

Hi @djhoese -- I came here via your recent thread on dask improvements for pyresample and started poking around. cuML has a GPU enabled KNeighborsClassifier . Happy to help run some experiments if you're still interested in this topic. Sadly, CUDA only

@djhoese
Copy link
Member Author

djhoese commented Dec 6, 2021

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.

@quasiben
Copy link

quasiben commented Dec 7, 2021

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.

@djhoese
Copy link
Member Author

djhoese commented Dec 7, 2021

No problem. Glad you could at least link to some other efforts in similar areas.

@grlee77
Copy link

grlee77 commented Feb 15, 2022

Here is another CUDA kd-tree implementation I came across (BSD 3-clause license)
https://github.com/johnarobinson77/KdTreeGPU

@mraspaud
Copy link
Member

mraspaud commented Nov 4, 2024

Cupy seems to have a GPU-optimized kdtree docs.cupy.dev/en/latest/reference/generated/cupyx.scipy.spatial.KDTree.html
However at the time writing, this has not been released yet and would need manual building of cupy to try it out (which I don't have time for right now).

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

No branches or pull requests

4 participants