-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
simplify raft build #2983
Closed
Closed
simplify raft build #2983
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cjnolet I wanted to try this, based on the documentation: https://docs.rapids.ai/api/raft/stable/build/#using-c-pre-compiled-shared-libraries
Wouldn't this be the preferred and simplest way to add the dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @algoriddle, We probably want to keep the cpm stuff here so that RAFT will automatically be built if it's not already installed. I suspect the issue we're facing is that two different versions of RAFT are being installed (e.g. different version from conda than what's being pulled inside cpm) and this is putting the headers from both on the search path, thus causing build issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, I'm pretty sure that's the case here because if the same version of RAFT were being downloaded from conda that was specified in
cpm
then removing one of them wouldn't have fixed a failing RAFT build. I think we should lock both to 23.08 nightlies.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@algoriddle, it looks like we're fetching 23.06 for
cpm
. Are we installing 23.08 from conda by chance?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an advantage of building RAFT if it's not installed? The Faiss build scripts don't build other dependencies (eg. MKL) either, but we expect them to be installed in the build environment. The downside of building RAFT when not available is that we can accidentally create a dependency on the locally built version - either a compile time or runtime dependency, neither of which is desired. We would like to only depend on the version of libraft that we explicitly install and compile with.
We install the nightly of libraft in the environment in what we call the 'cmake' contbuild (which doesn't use
conda build
, but invokes cmake+make directly. See the initialization of the build environment here: https://github.com/facebookresearch/faiss/blob/main/.circleci/config.yml#L191). I suggest we keep it this way (use the nightly of libraft), because it will allow us to notice breaking changes in upstream.When I will create the workflow for building a conda package, I will be pinning the version of libraft to an appropriate version upstream, which I presume will be 23.08 initially. In that case the version pinning will be done in the conda package specification (meta.yaml). We will want the cmake script to build against that version of libraft and create a conda package dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@algoriddle
Yeah that's totally fine w/ me. In the FAISS docs, we could just point the users to RAFT itself if they want to build it and install it from source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@algoriddle, we have also been kicking around the idea on RAFT to produce a static link library, which might actually make it easier for FAISS since
The second part there would also alleviate the potential that a user might have a different version fo RAFT already installed on their system when using FAISS.
Would there be any interest in using a static link library for RAFT if we produce one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any risk of static linking? If an end user uses faiss, but also loads libraft dynamically into a process (because they use some libraft features directly), would there be any problems or limitations imposed on the use of faiss (with a statically linked instance of libraft) + a dynamically loaded instance of libraft at the same time? Is there any global state in libraft? Are there any issues sharing data pointers between two instances of libraft (one statically linked, the other dynamically loaded) within the same process?