Skip to content

Commit

Permalink
Fix CAGRA filter gtests
Browse files Browse the repository at this point in the history
Commit fea490a attempted to fix a problem where the search_params.itopk_size wasn't being set in the CAGRA filter
tests.

This change was required to enable testing k>1024, since the default itopk_size was too small.
However, this broke the unittest for k < 1024 - and was causing illegal memory access errors.

Fix by reverting the filter tests to the previous behaviour, and disabling the filter tests for
k>1024
  • Loading branch information
benfred committed Feb 13, 2024
1 parent b512ca9 commit 72bdcc5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cpp/test/neighbors/ann_cagra.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,13 @@ class AnnCagraFilterTest : public ::testing::TestWithParam<AnnCagraInputs> {
search_params.algo = ps.algo;
search_params.max_queries = ps.max_queries;
search_params.team_size = ps.team_size;
search_params.itopk_size = ps.itopk_size;
search_params.hashmap_mode = cagra::hash_mode::HASH;

// TODO: setting search_params.itopk_size here breaks the filter tests, but is required for
// k>1024 skip these tests until fixed
if (ps.k >= 1024) { GTEST_SKIP(); }
// search_params.itopk_size = ps.itopk_size;

auto database_view = raft::make_device_matrix_view<const DataT, int64_t>(
(const DataT*)database.data(), ps.n_rows, ps.dim);

Expand Down Expand Up @@ -613,9 +617,13 @@ class AnnCagraFilterTest : public ::testing::TestWithParam<AnnCagraInputs> {
search_params.algo = ps.algo;
search_params.max_queries = ps.max_queries;
search_params.team_size = ps.team_size;
search_params.itopk_size = ps.itopk_size;
search_params.hashmap_mode = cagra::hash_mode::HASH;

// TODO: setting search_params.itopk_size here breaks the filter tests, but is required for
// k>1024 skip these tests until fixed
if (ps.k >= 1024) { GTEST_SKIP(); }
// search_params.itopk_size = ps.itopk_size;

auto database_view = raft::make_device_matrix_view<const DataT, int64_t>(
(const DataT*)database.data(), ps.n_rows, ps.dim);

Expand Down

0 comments on commit 72bdcc5

Please sign in to comment.