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

KNN Implementation #44

Open
jenkspt opened this issue Jan 11, 2021 · 6 comments
Open

KNN Implementation #44

jenkspt opened this issue Jan 11, 2021 · 6 comments

Comments

@jenkspt
Copy link

jenkspt commented Jan 11, 2021

I'm interested in a fast GPU implementation for k nearest neighbor queries -- similar to pytorch3d.ops.knn_points. Flux3D seems like an appropriate place for this to live.

Relevant pytorch3d code:
pytorch3d/csrc/knn
pytorch3d/csrc/utils/mink.cuh

Relevant Julia code:
https://github.com/JuliaParallel/rodinia/blob/master/julia_cuda/nn/nn.jl

@avik-pal
Copy link
Member

Thanks for the references. (I can try to put together an inplementation around mid Feb). Feel free to submit a PR if you want. Even if it is not highly optimized, a simple update of the code in rodinia to latest CUDA version is acceptable to get things going.

@nirmal-suthar
Copy link
Contributor

There is an internal function _nearest_neighbors which compute the nearest 1 neighbor between batched pointcloud. The GPU implementation is very naive, but the CPU version working well, if this helps.

@jenkspt
Copy link
Author

jenkspt commented Jan 12, 2021

I missed this _nearest_neighbors (gpu). I believe the advantages of the pytorch implementation are:

  • Can use any distance metric (the pytorch version uses euclidean distance)
  • Only the k neighbors are stored (much more memory efficient)

The rodinia findLowest apparently runs on the CPU.

I may be able to get a PR together before mid Feb. Thanks for the quick responses.

@avik-pal
Copy link
Member

@jenkspt the link is not working

@jenkspt
Copy link
Author

jenkspt commented Jan 24, 2021

Oops. Fixed it.

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

3 participants