make tests cheaper

Summary:
Many of the additive quantizer tests are recognized as flaky because the tests timeout in non-optimized stress mode.
This is probably because they don't import

https://www.internalfb.com/code/fbsource/fbcode/faiss/tests/common_faiss_tests.py

that sets the number of threads to 4. This diff fixes that and in addition declares the tests as "heavyweight" so that not too many of them are spawned in parallel in stress mode.

https://www.internalfb.com/intern/wiki/TAE/tpx/Timeouts_and_Sharded_Bundled_mode/#degree-of-parallelism

Hopefully it should fix the flaky tests

Reviewed By: alexanderguzhva

Differential Revision: D38111820

fbshipit-source-id: 7dd7c72e7e92b82384a170743cfd5c4aaf9a6960
This commit is contained in:
Matthijs Douze
2022-07-25 06:58:39 -07:00
committed by Facebook GitHub Bot
parent 79d94227b4
commit f2a9324359
4 changed files with 6 additions and 0 deletions
+2
View File
@@ -14,6 +14,8 @@ import faiss
from faiss.contrib import datasets
# the tests tend to timeout in stress modes + dev otherwise
faiss.omp_set_num_threads(4)
class TestCompileOptions(unittest.TestCase):
+2
View File
@@ -14,6 +14,8 @@ import faiss
from faiss.contrib import datasets
from faiss.contrib.inspect_tools import get_invlist
# the tests tend to timeout in stress modes + dev otherwise
faiss.omp_set_num_threads(4)
class TestLUTQuantization(unittest.TestCase):
+1
View File
@@ -14,6 +14,7 @@ import unittest
from faiss.contrib import datasets
faiss.omp_set_num_threads(4)
sp = faiss.swig_ptr
+1
View File
@@ -15,6 +15,7 @@ from faiss.contrib.inspect_tools import get_additive_quantizer_codebooks
# Reference implementation of encoding with beam search
###########################################################
faiss.omp_set_num_threads(4)
def pairwise_distances(a, b):
anorms = (a ** 2).sum(1)