-
Notifications
You must be signed in to change notification settings - Fork 21
Provide support for RAFT-based indexes #377
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
Conversation
@lowener Thanks for much for putting this up! super excited. To run the tests can you sign the CLA? Let me know if you have and it's just not appearing. |
@@ -0,0 +1,18 @@ | |||
# ============================================================================= |
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.
redis license
# or implied. See the License for the specific language governing permissions and limitations under | ||
# the License. | ||
|
||
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RAPIDS.cmake) |
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.
can we use cmake fetch content?
include(rapids-cmake) | ||
include(rapids-cpm) | ||
include(rapids-cuda) | ||
include(rapids-export) | ||
include(rapids-find) |
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.
please add a comment about each specific include purpose
if (!flat_index_) { | ||
flat_index_ = std::make_unique<raftIvfFlatIndex>( | ||
raft::neighbors::ivf_flat::build<DataType, std::int64_t>( | ||
res_, *build_params_flat_, raft::make_const_mdspan(vector_data_gpu.view()))); |
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.
add comments please
int RaftIVFIndex::addVectorBatch(const void *vector_data, labelType *labels, size_t batch_size, | ||
bool overwrite_allowed) { | ||
auto vector_data_gpu = | ||
raft::make_device_matrix<DataType, std::int64_t>(res_, batch_size, this->dim); |
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.
can you explain ifstd::int64_t
is used for id or label?
return result_list; | ||
} | ||
auto vector_data_gpu = | ||
raft::make_device_matrix<DataType, std::int64_t>(res_, queryParams->batchSize, this->dim); |
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.
batchSize
is misused here. It is used in our batch iterator for hybrid queries
this->ivf_index_->addVectorBatchGpuBuffer(vectorDataGpuBuffer.data_handle(), | ||
labels_gpu.data_handle(), | ||
nVectors); | ||
updateIvfIndex = false; |
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.
Once the flat buffer is copied to the IVF it should be flushed
Describe the changes in the pull request
This PR add support for RAFT-based index. IVF-Flat and IVF-PQ indexes will be added.
The main API change needed is the introduction of Batch vector addition (possibly through a
VecSimIndex_AddVectorBatch
function)Mark if applicable
Work still in progress