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 computation using Keops post dataloader #1

Merged
merged 14 commits into from
Feb 14, 2025

Conversation

chaidosa
Copy link

@chaidosa chaidosa commented Jan 4, 2025

In this branch, the key change is the introduction of post_knn in the config file, allowing KNN computation on the GPU after the dataloader instead of within the CPU-based dataloader. We use KeOps for KNN computation post-dataloader.

The file knn_post_dataloader_train.py provides an example of how to implement this, while knn_post_dataloader_utils.py contains the necessary functions for retrieving correct values and performing KNN computation using KeOps.

Additionally, the previous functionality remains unchanged—if post_knn is not specified in the config file, the codebase functions as in the previous version.

@Lawrence444 Lawrence444 assigned Lawrence444 and npmhung and unassigned Lawrence444 Jan 6, 2025
@chaidosa
Copy link
Author

@npmhung, I have made the changes as we discussed, updated the README, renamed the files for better readability, and included the config file for post_knn usage.

Copy link

@npmhung npmhung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does "prepare" function do exactly?

@chaidosa
Copy link
Author

chaidosa commented Feb 5, 2025

@npmhung, the prepare function is used to create a packed representation of the kNN indices. it is similar to datasetCommon.py which is used in the dataloader.

@Lawrence444 Lawrence444 merged commit 6313fff into main Feb 14, 2025
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.

3 participants