Skip to content

Commit b50c3ae

Browse files
mdouzeThejas-bhat
authored andcommitted
Relax IVF AQ FastScan (facebookresearch#2940)
Summary: Pull Request resolved: facebookresearch#2940 This test fails on some occasions. After investigation it turns out this is due to non reproducible behavior IndexIVFFastScan::search_implem_14 with a parallel loop, where there are ties in the resutls (ie. the resulting distances are the same but not the ids). As a workaround I relaxed the test slightly. + a fix in the checksum function. Reviewed By: algoriddle Differential Revision: D47229086 fbshipit-source-id: 55e53bcfe47cf33041cc7fd5691b5de65067ce0f
1 parent c2af07a commit b50c3ae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

faiss/python/extra_wrappers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def checksum(a):
108108
""" compute a checksum for quick-and-dirty comparisons of arrays """
109109
a = a.view('uint8')
110110
if a.ndim == 1:
111-
return bvec_checksum(s.size, swig_ptr(a))
111+
return bvec_checksum(a.size, swig_ptr(a))
112112
n, d = a.shape
113113
cs = np.zeros(n, dtype='uint64')
114114
bvecs_checksum(n, d, swig_ptr(a), swig_ptr(cs))

tests/test_fast_scan_ivf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def subtest_accuracy(self, aq, st, by_residual, implem, metric_type='L2'):
558558
recall1 = (I1 == gt).sum() / nq
559559

560560
print(aq, st, by_residual, implem, metric_type, recall_ref, recall1)
561-
assert abs(recall_ref - recall1) < 0.05
561+
assert abs(recall_ref - recall1) < 0.051
562562

563563
def xx_test_accuracy(self):
564564
# generated programatically below

0 commit comments

Comments
 (0)