Repository navigation
Fix test params for filtered ivf_flat - #1463
Merged
rapids-bot[bot] merged 4 commits intoOct 27, 2025
Merged
Conversation
tarang-jain
approved these changes
Oct 27, 2025
divyegala
approved these changes
Oct 27, 2025
Contributor
|
/merge |
landrumb
pushed a commit
to landrumb/cuvs
that referenced
this pull request
Jul 8, 2026
Resolves NVIDIA#1452 The `test_ivf_flat.py::test_filtered_ivf_flat[0.5]` has been consistently failing in the cuvs CI recently. This test uses a dataset of 10,000 points but uses the default parameters of `n_lists=1024` and `n_probes=20` which means there are around only 10 points per cluster. However filtering 50% `[0.5]` can invalidate a lot of nearest neighbors candidates. To solve this issue we need to properly tune `n_lists` to be smaller and have more points per cluster. We can also increase the `n_probes` to look at more clusters. This PR changes the pytest to the following: [0.5] 50% of points are filtered n_lists = 50 n_probes = 10 search 2000 of 10,000 points ``` ================================================== Recall Statistics Comparison 0.5 ================================================== OLD NEW -------------------------------------------------- Min Recall: 0.6900 0.8700 Max Recall: 0.9500 1.0000 Mean Recall: 0.8327 0.9615 Std Dev: 0.0431 0.0230 Total runs: 1000 1000 ================================================== ``` [0.7] 30% of the points are filtered n_lists = 70 n_probes = 10 search 1428 of 10,000 points ``` ================================================== Recall Statistics Comparison 0.7 ================================================== OLD NEW -------------------------------------------------- Min Recall: 0.7300 0.8500 Max Recall: 0.9600 1.0000 Mean Recall: 0.8623 0.9509 Std Dev: 0.0392 0.0256 Total runs: 1000 1000 ================================================== ``` [1.0] 0% of the points are filtered n_lists = 100 n_probes = 10 search 1000 of 10,000 points ``` ================================================== Recall Statistics Comparison 1.0 ================================================== OLD NEW -------------------------------------------------- Min Recall: 0.7200 0.8300 Max Recall: 0.9900 1.0000 Mean Recall: 0.8886 0.9430 Std Dev: 0.0369 0.0271 Total runs: 1000 1000 ================================================== ``` Upon investigating this test, the variable `sparsity` is misleading, since higher value means more sparse, but in the code it means no filtering. We could rename it to `density` if desired. Justification of initial value of `n_lists` choice under 0% filtering. > Setting n_lists = sqrt(n_samples) is a good starting point (where n_samples is the number of vectors in the dataset) Reference from https://developer.nvidia.com/blog/accelerated-vector-search-approximating-with-nvidia-cuvs-ivf-flat/ Authors: - Anupam (https://github.com/aamijar) Approvers: - Tarang Jain (https://github.com/tarang-jain) - Divye Gala (https://github.com/divyegala) URL: NVIDIA#1463
This was referenced Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1452
The
test_ivf_flat.py::test_filtered_ivf_flat[0.5]has been consistently failing in the cuvs CI recently.This test uses a dataset of 10,000 points but uses the default parameters of
n_lists=1024andn_probes=20which means there are around only 10 points per cluster. However filtering 50%[0.5]can invalidate a lot of nearest neighbors candidates. To solve this issue we need to properly tunen_liststo be smaller and have more points per cluster. We can also increase then_probesto look at more clusters.This PR changes the pytest to the following:
[0.5] 50% of points are filtered
n_lists = 50
n_probes = 10
search 2000 of 10,000 points
[0.7] 30% of the points are filtered
n_lists = 70
n_probes = 10
search 1428 of 10,000 points
[1.0] 0% of the points are filtered
n_lists = 100
n_probes = 10
search 1000 of 10,000 points
Upon investigating this test, the variable
sparsityis misleading, since higher value means more sparse, but in the code it means no filtering. We could rename it todensityif desired.Justification of initial value of
n_listschoice under 0% filtering.Reference from https://developer.nvidia.com/blog/accelerated-vector-search-approximating-with-nvidia-cuvs-ivf-flat/