Skip to content

Commit 5d52dc4

Browse files
committed
Fix comments an codebook size estimate
1 parent db2a1cf commit 5d52dc4

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

cpp/src/neighbors/detail/cagra/cagra_helpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ std::tuple<size_t, size_t, size_t, size_t> optimize_workspace_size(size_t n_rows
3030
mst_host = n_rows * index_size; // mst_graph_num_edges
3131
mst_host += n_rows * graph_degree * index_size; // mst_graph allocated in optimize
3232
mst_host += n_rows * graph_degree * index_size; // mst_graph allocated in mst_optimize
33-
mst_host += n_rows * index_size * 7; // vectors with _max_edges suffix
33+
mst_host += n_rows * index_size * 7; // Five vectors _edges suffix, and label, cluster_size vectors.
3434
mst_host_fixed += (graph_degree - 1) * (graph_degree - 1) * index_size; // iB_candidates
3535
mst_host += mst_host_fixed;
3636
}

cpp/src/neighbors/ivf_pq_index.cu

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,12 +828,14 @@ size_t compressed_dataset_size(raft::resources const& res,
828828
constexpr static uint32_t kIndexGroupSize = 32;
829829
constexpr static uint32_t kIndexGroupVecLen = 16;
830830

831-
size_t pq_chunk = (kIndexGroupVecLen * 8) / params.pq_bits;
832-
size_t pq_centers = idx.pq_len() * pq_book_size * params.pq_dim * sizeof(float);
831+
size_t pq_chunk = (kIndexGroupVecLen * 8) / params.pq_bits;
832+
size_t pq_centers =
833+
(params.codebook_kind == codebook_gen::PER_SUBSPACE ? params.pq_dim : params.n_lists) *
834+
idx.pq_len() * pq_book_size * sizeof(float);
833835
size_t pq_dataset = raft::ceildiv<size_t>(dataset.extent(0), kIndexGroupSize) * kIndexGroupSize *
834836
raft::ceildiv<size_t>(params.pq_dim, pq_chunk) * kIndexGroupVecLen;
835837
size_t indices = dataset.extent(0) * sizeof(int64_t);
836-
size_t rotation_matrix = idx.rot_dim() * idx.rot_dim() * sizeof(float);
838+
size_t rotation_matrix = idx.rot_dim() * idx.dim() * sizeof(float);
837839
size_t list_offsets = (params.n_lists + 1) * sizeof(int64_t);
838840
size_t list_sizes = params.n_lists * sizeof(int64_t);
839841
size_t centers = params.n_lists * idx.dim_ext() * sizeof(float);

examples/cpp/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ include(rapids-export)
1616
include(rapids-find)
1717

1818
# ------------- configure project --------------#
19-
set(CMAKE_CXX_STANDARD 20)
20-
set(CMAKE_CUDA_STANDARD 20)
2119

2220
rapids_cuda_init_architectures(test_cuvs)
2321

0 commit comments

Comments
 (0)