-
Notifications
You must be signed in to change notification settings - Fork 143
MG Python API #1307
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
Merged
Merged
MG Python API #1307
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
f4574ad
MG C API
viclafargue d00bea2
Documentation
viclafargue 3896985
Merge branch 'branch-25.10' into mg-c-api
cjnolet f8d28d0
switch to MultiGpu
viclafargue d854345
Renaming and include removal
viclafargue 822b966
answering review
viclafargue fb4e2b6
fix template instantiation
viclafargue b1b23ca
Updating the serialization process
viclafargue 7f4c590
copyright edit
viclafargue 147dc33
Merge branch 'branch-25.10' into mg-c-api
viclafargue 5e16895
Merge branch 'branch-25.10' into mg-c-api
cjnolet 8db9b86
Add IVF-Flat half type to MG API
viclafargue 94b0cd5
Merge branch 'branch-25.10' into mg-c-api
viclafargue 650b221
Merge branch 'branch-25.10' into mg-c-api
cjnolet a41f17c
MG Python API
viclafargue 30363b7
Merge branch 'branch-25.10' into mg-python-api
viclafargue 69ffaf8
Adding documentation
viclafargue fd1cb41
Merge branch 'branch-25.10' into mg-python-api
cjnolet bb44474
Answering review
viclafargue 1dfed37
Fixing issues
viclafargue 3ed0192
Merge branch 'branch-25.10' into mg-python-api
viclafargue 15b8f5f
Merge branch 'branch-25.10' into mg-python-api
viclafargue 32b4d1c
Merge branch 'branch-25.10' into mg-python-api
cjnolet 984c6f6
Merge branch 'branch-25.10' into mg-python-api
cjnolet 6400c0f
Merge branch 'branch-25.10' into mg-python-api
viclafargue 9528af3
correct merge typo
viclafargue 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| Multi-GPU CAGRA | ||
| =============== | ||
|
|
||
| Multi-GPU CAGRA extends the graph-based CAGRA algorithm to work across multiple GPUs, providing improved scalability and performance for large-scale vector search. It supports both replicated and sharded distribution modes. | ||
|
|
||
| .. role:: py(code) | ||
| :language: python | ||
| :class: highlight | ||
|
|
||
| .. note:: | ||
| **IMPORTANT**: Multi-GPU CAGRA requires all data (datasets, queries, output arrays) to be in host memory (CPU). | ||
| If using CuPy/device arrays, transfer to host with ``array.get()`` or ``cp.asnumpy(array)`` before use. | ||
|
|
||
| Index build parameters | ||
| ###################### | ||
|
|
||
| .. autoclass:: cuvs.neighbors.mg_cagra.IndexParams | ||
| :members: | ||
|
|
||
| Index search parameters | ||
| ####################### | ||
|
|
||
| .. autoclass:: cuvs.neighbors.mg_cagra.SearchParams | ||
| :members: | ||
|
|
||
| Index | ||
| ##### | ||
|
|
||
| .. autoclass:: cuvs.neighbors.mg_cagra.Index | ||
| :members: | ||
|
|
||
| Index build | ||
| ########### | ||
|
|
||
| .. autofunction:: cuvs.neighbors.mg_cagra.build | ||
|
|
||
| Index search | ||
| ############ | ||
|
|
||
| .. autofunction:: cuvs.neighbors.mg_cagra.search | ||
|
|
||
| Index save | ||
| ########## | ||
|
|
||
| .. autofunction:: cuvs.neighbors.mg_cagra.save | ||
|
|
||
| Index load | ||
| ########## | ||
|
|
||
| .. autofunction:: cuvs.neighbors.mg_cagra.load | ||
|
|
||
| Index distribute | ||
| ################ | ||
|
|
||
| .. autofunction:: cuvs.neighbors.mg_cagra.distribute |
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.
Is this change intentional? (do we only support float32 here, and you meant to remove support for the other dtypes?)
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.
This functions deserializes a single-GPU index and distributes it across multiple GPUs. The IVF-PQ index does not have a
Ttemplate parameter, onlyIdxT(which is alwaysint64_t). Because of this, a file containing a serialized IVF-PQ index is not prepended with an index type (float, half, uint8_t, int8_t). This makes it impossible to find the index type necessary to instantiate a multi-GPU index. This is fundamentally an issue in the multi-GPU API that should be remediated. In the meantime, we should assume that for this specific case (the replication of a single-GPU IVF-PQ index), the user is planning to search with floats.