Skip to content

Commit

Permalink
IVF-Flat: fix search batching (#1764)
Browse files Browse the repository at this point in the history
Fix the cluster probes (coarse_index) not being advanced when batching.

Thanks @tarang-jain for the precise reproducer.

Closes: #1756

Authors:
  - Artem M. Chirkin (https://github.com/achirkin)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)

URL: #1764
  • Loading branch information
achirkin authored Aug 23, 2023
1 parent 845ae38 commit 9019054
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ void launch_kernel(Lambda lambda,
queries += grid_dim_y * index.dim();
neighbors += grid_dim_y * grid_dim_x * k;
distances += grid_dim_y * grid_dim_x * k;
coarse_index += grid_dim_y * n_probes;
}
}

Expand Down
7 changes: 6 additions & 1 deletion cpp/test/neighbors/ann_ivf_flat.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,11 @@ const std::vector<AnnIvfFlatInputs<int64_t>> inputs = {
raft::matrix::detail::select::warpsort::kMaxCapacity * 4,
raft::matrix::detail::select::warpsort::kMaxCapacity * 4,
raft::distance::DistanceType::InnerProduct,
false}};
false},

// The following two test cases should show very similar recall.
// num_queries, num_db_vecs, dim, k, nprobe, nlist, metric, adaptive_centers
{20000, 8712, 3, 10, 51, 66, raft::distance::DistanceType::L2Expanded, false},
{100000, 8712, 3, 10, 51, 66, raft::distance::DistanceType::L2Expanded, false}};

} // namespace raft::neighbors::ivf_flat

0 comments on commit 9019054

Please sign in to comment.