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

Use FAISS with RMM #363

Merged
merged 14 commits into from
Jan 19, 2022
Merged

Conversation

viclafargue
Copy link
Contributor

@viclafargue viclafargue requested review from a team as code owners October 20, 2021 13:00
@github-actions github-actions bot added the cpp label Oct 20, 2021
@viclafargue viclafargue added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Oct 20, 2021
cpp/include/raft/mr/faiss_mr.hpp Outdated Show resolved Hide resolved
cpp/include/raft/mr/faiss_mr.hpp Outdated Show resolved Hide resolved
cpp/include/raft/mr/faiss_mr.hpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added the CMake label Oct 25, 2021
Copy link
Member

@cjnolet cjnolet left a comment

Choose a reason for hiding this comment

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

The changes are looking much better. I also want to make sure we clearly describe the path to removing the copied code and adapting it to their API once that issue is resolved. Once that's done, this PR will be ready to go.

cpp/include/raft/spatial/knn/faiss_mr.hpp Show resolved Hide resolved
@viclafargue
Copy link
Contributor Author

Opened an issue on FAISS to avoid code duplication : facebookresearch/faiss#2097.

Using a custom memory manager in FAISS currently requires overriding methods of GpuResources and GpuResourcesProvider classes. Most of the logic however, is consistent with existing StandardGpuResourcesImpl and StandardGpuResources classes causing unnecessary and difficulty maintainable rewrites.

It would be possible to prevent consequent rewrites thanks to updates to the StandardGpuResources.h header file. Indeed the ideal situation would be to inherit the logic of these classes and only override the allocMemory and deallocMemory methods.

The necessary changes would be the following :

  1. Promote attributes from private to protected
  2. Use allocMemory in initializeForDevice to prevent cudaHostAlloc call
  3. (optionally) Remove unnamed namespace to allow the reuse of the allocsToString function

@cjnolet
Copy link
Member

cjnolet commented Nov 15, 2021

@viclafargue, I looked back over my last comment and realized it was fairly ambiguous. I think having the comment on this PR is very useful as well but we should also have the comment in the code, preferably at the top of faiss_mr.hpp

@cjnolet cjnolet changed the base branch from branch-21.12 to branch-22.02 November 23, 2021 19:03
Copy link
Member

@cjnolet cjnolet left a comment

Choose a reason for hiding this comment

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

LGTM

@cjnolet cjnolet added 5 - Merge After Dependencies Depends on another PR: do not merge out of order 5 - Ready to Merge and removed 5 - Merge After Dependencies Depends on another PR: do not merge out of order labels Dec 6, 2021
@github-actions
Copy link

github-actions bot commented Jan 5, 2022

This PR has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d if there is no activity in the next 60 days.

@cjnolet
Copy link
Member

cjnolet commented Jan 10, 2022

@viclafargue it's been a little while so just wanted to check the status on this PR. IIRC, we are waiting on cuml side to pass successfuly, right?

@viclafargue
Copy link
Contributor Author

viclafargue commented Jan 10, 2022

@viclafargue it's been a little while so just wanted to check the status on this PR. IIRC, we are waiting on cuml side to pass successfuly, right?

Thanks for reminding me of this. Yes, I just solved the merge conflicts on this PR.

@cjnolet
Copy link
Member

cjnolet commented Jan 19, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 73585f4 into rapidsai:branch-22.02 Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge CMake cpp improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants