Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
3c40a06
Init IVFPQ migration
lowener Apr 11, 2024
c5a3d3a
Migrate ivf-pq build steps to cuvs
lowener Apr 15, 2024
3568f12
Migrate ivf-pq extend to cuvs
lowener Apr 15, 2024
69bf330
Migrate ivf-pq serialize to cuvs
lowener Apr 16, 2024
7a5e8a0
Migrate compute similarity
lowener Apr 17, 2024
4b86f94
Migrate search
lowener Apr 18, 2024
8c8aaed
Add Test for IVFPQ
lowener Apr 19, 2024
e444f4b
Temporarily remove IVFPQ Search with filter
lowener Apr 19, 2024
5228a68
Reset exceptions
lowener Apr 19, 2024
3f924f2
Merge branch 'branch-24.06' into 24.06-ivfpq-migration
lowener Apr 19, 2024
e8907ee
Add bitset to cuvs, add search_with_filter to ivf-pq
lowener Apr 23, 2024
64809e8
Remove `uint32_t` ivfpq compute_similarity instantiation
lowener Apr 23, 2024
e88f82c
Add bitset to compute similarity instantiation
lowener Apr 23, 2024
36bd63b
Add NVTX cuvs domain
lowener Apr 24, 2024
9c4781d
Expose only public API on includes
lowener Apr 30, 2024
9cbfc53
First commit of moving CAGRA from RAFT
cjnolet Apr 30, 2024
1a8a789
Making progress
cjnolet May 1, 2024
6e7591a
Merge branch 'branch-24.06' into 24.06-ivfpq-migration
cjnolet May 1, 2024
5a719ba
Move headers
lowener May 3, 2024
844f209
Merge remote-tracking branch 'mickael/24.06-ivfpq-migration' into fea…
cjnolet May 3, 2024
2783c83
Making progress
cjnolet May 3, 2024
ec2125b
Checking in.
cjnolet May 3, 2024
c024780
COuple minor fixes to ann_utils
cjnolet May 3, 2024
55d8851
More fixes to ann_utils
cjnolet May 3, 2024
b24a43c
MOre updates
cjnolet May 4, 2024
091fe02
Separate header and impl for filters
lowener May 6, 2024
80a0c0b
Compiles!
cjnolet May 6, 2024
40a860a
Merge remote-tracking branch 'mickael/24.06-ivfpq-migration' into fea…
cjnolet May 6, 2024
cb011f6
I think it works!
cjnolet May 6, 2024
dff10bc
Making sure tests are using runtime APIs
cjnolet May 6, 2024
3a4c04b
Merge branch 'branch-24.06' into fea-2406-cagra_from_raft
cjnolet May 6, 2024
8fd2389
Removing debugging prints
cjnolet May 6, 2024
9b9db71
Checking in
cjnolet May 6, 2024
e5b8500
Merge branch 'fea-2406-cagra_from_raft' of github.com:rapidsai/cuvs i…
cjnolet May 6, 2024
849358c
Adding nn-descent public API and tests
cjnolet May 6, 2024
8621e6f
Fix style
lowener May 8, 2024
197730e
Remove CMAKE_INSTALL_MESSAGE = LAZY
lowener May 8, 2024
7c15d0c
Merge remote-tracking branch 'mickael/24.06-ivfpq-migration' into fea…
cjnolet May 8, 2024
5b60ee4
Fixing docs
cjnolet May 8, 2024
73ae071
Using CUVS_USE_RAFT_STATIC
cjnolet May 9, 2024
57d33a8
Trying again
cjnolet May 9, 2024
3cf245a
Trying again...y
cjnolet May 9, 2024
f7dbd55
Use Raft Bitset
lowener May 10, 2024
e22aff7
Revert "Trying again...y"
cjnolet May 10, 2024
de395c8
Revert "Using CUVS_USE_RAFT_STATIC"
cjnolet May 10, 2024
5239b93
Making sure the python cmakelists is reverted
cjnolet May 10, 2024
10b9a7e
Removing line that was accidentally inserted back
cjnolet May 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
209 changes: 189 additions & 20 deletions cpp/CMakeLists.txt

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions cpp/include/cuvs/core/bitset.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should consider keeping this in raft with the other vocabulary types so it can continue to be used across different libraries that use raft. Also- we can't be defining device functions in an hpp file in cuVS, since it's not header-only. The only APIs users should be interacting with in cuVS should be pre-compiled runtime APIs.

* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include <raft/core/bitset.hpp>

namespace cuvs::core {
/* To use bitset functions containing CUDA code, include <raft/core/bitset.cuh> */

template <typename bitset_t, typename index_t>
using bitset_view = raft::core::bitset_view<bitset_t, index_t>;

template <typename bitset_t, typename index_t>
using bitset = raft::core::bitset<bitset_t, index_t>;

} // end namespace cuvs::core
40 changes: 39 additions & 1 deletion cpp/include/cuvs/neighbors/ann_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,48 @@

#pragma once

#include <cstdint>
#include <cuvs/distance/distance_types.hpp>

namespace cuvs::neighbors::ann {

/** Parameters for VPQ compression. */
struct vpq_params {
/**
* The bit length of the vector element after compression by PQ.
*
* Possible values: [4, 5, 6, 7, 8].
*
* Hint: the smaller the 'pq_bits', the smaller the index size and the better the search
* performance, but the lower the recall.
*/
uint32_t pq_bits = 8;
/**
* The dimensionality of the vector after compression by PQ.
* When zero, an optimal value is selected using a heuristic.
*
* TODO: at the moment `dim` must be a multiple `pq_dim`.
*/
uint32_t pq_dim = 0;
/**
* Vector Quantization (VQ) codebook size - number of "coarse cluster centers".
* When zero, an optimal value is selected using a heuristic.
*/
uint32_t vq_n_centers = 0;
/** The number of iterations searching for kmeans centers (both VQ & PQ phases). */
uint32_t kmeans_n_iters = 25;
/**
* The fraction of data to use during iterative kmeans building (VQ phase).
* When zero, an optimal value is selected using a heuristic.
*/
double vq_kmeans_trainset_fraction = 0;
/**
* The fraction of data to use during iterative kmeans building (PQ phase).
* When zero, an optimal value is selected using a heuristic.
*/
double pq_kmeans_trainset_fraction = 0;
};

/**
* @defgroup ann_types Approximate Nearest Neighbors Types
* @{
Expand All @@ -31,7 +69,7 @@ struct index {};
/** The base for KNN index parameters. */
struct index_params {
/** Distance type. */
cuvs::distance::DistanceType metric = distance::DistanceType::L2Expanded;
cuvs::distance::DistanceType metric = cuvs::distance::DistanceType::L2Expanded;
/** The argument used by some distance metrics. */
float metric_arg = 2.0f;
/**
Expand Down
Loading