faiss 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/LICENSE.txt +1 -1
- data/lib/faiss/version.rb +1 -1
- data/vendor/faiss/faiss/AutoTune.cpp +2 -2
- data/vendor/faiss/faiss/AutoTune.h +2 -2
- data/vendor/faiss/faiss/Clustering.cpp +2 -2
- data/vendor/faiss/faiss/Clustering.h +2 -2
- data/vendor/faiss/faiss/IVFlib.cpp +2 -2
- data/vendor/faiss/faiss/IVFlib.h +2 -2
- data/vendor/faiss/faiss/Index.cpp +6 -2
- data/vendor/faiss/faiss/Index.h +10 -3
- data/vendor/faiss/faiss/Index2Layer.cpp +2 -2
- data/vendor/faiss/faiss/Index2Layer.h +2 -2
- data/vendor/faiss/faiss/IndexAdditiveQuantizer.cpp +7 -7
- data/vendor/faiss/faiss/IndexAdditiveQuantizer.h +2 -2
- data/vendor/faiss/faiss/IndexAdditiveQuantizerFastScan.cpp +14 -16
- data/vendor/faiss/faiss/IndexAdditiveQuantizerFastScan.h +2 -2
- data/vendor/faiss/faiss/IndexBinary.cpp +13 -2
- data/vendor/faiss/faiss/IndexBinary.h +8 -2
- data/vendor/faiss/faiss/IndexBinaryFlat.cpp +2 -3
- data/vendor/faiss/faiss/IndexBinaryFlat.h +2 -2
- data/vendor/faiss/faiss/IndexBinaryFromFloat.cpp +2 -2
- data/vendor/faiss/faiss/IndexBinaryFromFloat.h +2 -2
- data/vendor/faiss/faiss/IndexBinaryHNSW.cpp +2 -7
- data/vendor/faiss/faiss/IndexBinaryHNSW.h +2 -2
- data/vendor/faiss/faiss/IndexBinaryHash.cpp +2 -3
- data/vendor/faiss/faiss/IndexBinaryHash.h +2 -2
- data/vendor/faiss/faiss/IndexBinaryIVF.cpp +2 -2
- data/vendor/faiss/faiss/IndexBinaryIVF.h +2 -2
- data/vendor/faiss/faiss/IndexFastScan.cpp +10 -14
- data/vendor/faiss/faiss/IndexFastScan.h +11 -2
- data/vendor/faiss/faiss/IndexFlat.cpp +2 -3
- data/vendor/faiss/faiss/IndexFlat.h +2 -2
- data/vendor/faiss/faiss/IndexFlatCodes.cpp +11 -2
- data/vendor/faiss/faiss/IndexFlatCodes.h +5 -2
- data/vendor/faiss/faiss/IndexHNSW.cpp +13 -6
- data/vendor/faiss/faiss/IndexHNSW.h +2 -2
- data/vendor/faiss/faiss/IndexIDMap.cpp +19 -3
- data/vendor/faiss/faiss/IndexIDMap.h +5 -2
- data/vendor/faiss/faiss/IndexIVF.cpp +2 -3
- data/vendor/faiss/faiss/IndexIVF.h +5 -4
- data/vendor/faiss/faiss/IndexIVFAdditiveQuantizer.cpp +6 -7
- data/vendor/faiss/faiss/IndexIVFAdditiveQuantizer.h +2 -2
- data/vendor/faiss/faiss/IndexIVFAdditiveQuantizerFastScan.cpp +3 -14
- data/vendor/faiss/faiss/IndexIVFAdditiveQuantizerFastScan.h +2 -4
- data/vendor/faiss/faiss/IndexIVFFastScan.cpp +71 -34
- data/vendor/faiss/faiss/IndexIVFFastScan.h +19 -2
- data/vendor/faiss/faiss/IndexIVFFlat.cpp +2 -2
- data/vendor/faiss/faiss/IndexIVFFlat.h +2 -2
- data/vendor/faiss/faiss/IndexIVFIndependentQuantizer.cpp +2 -2
- data/vendor/faiss/faiss/IndexIVFIndependentQuantizer.h +2 -2
- data/vendor/faiss/faiss/IndexIVFPQ.cpp +2 -3
- data/vendor/faiss/faiss/IndexIVFPQ.h +2 -2
- data/vendor/faiss/faiss/IndexIVFPQFastScan.cpp +7 -33
- data/vendor/faiss/faiss/IndexIVFPQFastScan.h +2 -4
- data/vendor/faiss/faiss/IndexIVFPQR.cpp +2 -2
- data/vendor/faiss/faiss/IndexIVFPQR.h +2 -2
- data/vendor/faiss/faiss/IndexIVFSpectralHash.cpp +2 -3
- data/vendor/faiss/faiss/IndexIVFSpectralHash.h +2 -2
- data/vendor/faiss/faiss/IndexLSH.cpp +2 -3
- data/vendor/faiss/faiss/IndexLSH.h +2 -2
- data/vendor/faiss/faiss/IndexLattice.cpp +2 -2
- data/vendor/faiss/faiss/IndexLattice.h +2 -2
- data/vendor/faiss/faiss/IndexNNDescent.cpp +2 -2
- data/vendor/faiss/faiss/IndexNNDescent.h +2 -2
- data/vendor/faiss/faiss/IndexNSG.cpp +2 -5
- data/vendor/faiss/faiss/IndexNSG.h +2 -2
- data/vendor/faiss/faiss/IndexNeuralNetCodec.cpp +2 -2
- data/vendor/faiss/faiss/IndexNeuralNetCodec.h +2 -2
- data/vendor/faiss/faiss/IndexPQ.cpp +26 -26
- data/vendor/faiss/faiss/IndexPQ.h +2 -2
- data/vendor/faiss/faiss/IndexPQFastScan.cpp +2 -5
- data/vendor/faiss/faiss/IndexPQFastScan.h +2 -11
- data/vendor/faiss/faiss/IndexPreTransform.cpp +2 -2
- data/vendor/faiss/faiss/IndexPreTransform.h +2 -2
- data/vendor/faiss/faiss/IndexRefine.cpp +41 -4
- data/vendor/faiss/faiss/IndexRefine.h +9 -2
- data/vendor/faiss/faiss/IndexReplicas.cpp +2 -2
- data/vendor/faiss/faiss/IndexReplicas.h +2 -2
- data/vendor/faiss/faiss/IndexRowwiseMinMax.cpp +2 -2
- data/vendor/faiss/faiss/IndexRowwiseMinMax.h +2 -2
- data/vendor/faiss/faiss/IndexScalarQuantizer.cpp +2 -3
- data/vendor/faiss/faiss/IndexScalarQuantizer.h +2 -2
- data/vendor/faiss/faiss/IndexShards.cpp +2 -2
- data/vendor/faiss/faiss/IndexShards.h +2 -2
- data/vendor/faiss/faiss/IndexShardsIVF.cpp +2 -2
- data/vendor/faiss/faiss/IndexShardsIVF.h +2 -2
- data/vendor/faiss/faiss/MatrixStats.cpp +2 -2
- data/vendor/faiss/faiss/MatrixStats.h +2 -2
- data/vendor/faiss/faiss/MetaIndexes.cpp +2 -3
- data/vendor/faiss/faiss/MetaIndexes.h +2 -2
- data/vendor/faiss/faiss/MetricType.h +2 -2
- data/vendor/faiss/faiss/VectorTransform.cpp +2 -2
- data/vendor/faiss/faiss/VectorTransform.h +2 -2
- data/vendor/faiss/faiss/clone_index.cpp +2 -2
- data/vendor/faiss/faiss/clone_index.h +2 -2
- data/vendor/faiss/faiss/cppcontrib/SaDecodeKernels.h +2 -2
- data/vendor/faiss/faiss/cppcontrib/detail/CoarseBitType.h +2 -2
- data/vendor/faiss/faiss/cppcontrib/detail/UintReader.h +2 -2
- data/vendor/faiss/faiss/cppcontrib/factory_tools.cpp +44 -4
- data/vendor/faiss/faiss/cppcontrib/factory_tools.h +7 -2
- data/vendor/faiss/faiss/cppcontrib/sa_decode/Level2-avx2-inl.h +2 -2
- data/vendor/faiss/faiss/cppcontrib/sa_decode/Level2-inl.h +2 -2
- data/vendor/faiss/faiss/cppcontrib/sa_decode/Level2-neon-inl.h +2 -2
- data/vendor/faiss/faiss/cppcontrib/sa_decode/MinMax-inl.h +2 -2
- data/vendor/faiss/faiss/cppcontrib/sa_decode/MinMaxFP16-inl.h +2 -2
- data/vendor/faiss/faiss/cppcontrib/sa_decode/PQ-avx2-inl.h +2 -2
- data/vendor/faiss/faiss/cppcontrib/sa_decode/PQ-inl.h +2 -2
- data/vendor/faiss/faiss/cppcontrib/sa_decode/PQ-neon-inl.h +2 -2
- data/vendor/faiss/faiss/gpu/GpuAutoTune.cpp +2 -5
- data/vendor/faiss/faiss/gpu/GpuAutoTune.h +2 -2
- data/vendor/faiss/faiss/gpu/GpuCloner.cpp +13 -13
- data/vendor/faiss/faiss/gpu/GpuCloner.h +2 -2
- data/vendor/faiss/faiss/gpu/GpuClonerOptions.h +6 -6
- data/vendor/faiss/faiss/gpu/GpuDistance.h +11 -7
- data/vendor/faiss/faiss/gpu/GpuFaissAssert.h +2 -2
- data/vendor/faiss/faiss/gpu/GpuIcmEncoder.h +2 -2
- data/vendor/faiss/faiss/gpu/GpuIndex.h +8 -7
- data/vendor/faiss/faiss/gpu/GpuIndexBinaryFlat.h +2 -2
- data/vendor/faiss/faiss/gpu/GpuIndexCagra.h +6 -3
- data/vendor/faiss/faiss/gpu/GpuIndexFlat.h +2 -2
- data/vendor/faiss/faiss/gpu/GpuIndexIVF.h +2 -2
- data/vendor/faiss/faiss/gpu/GpuIndexIVFFlat.h +2 -2
- data/vendor/faiss/faiss/gpu/GpuIndexIVFPQ.h +3 -3
- data/vendor/faiss/faiss/gpu/GpuIndexIVFScalarQuantizer.h +2 -2
- data/vendor/faiss/faiss/gpu/GpuIndicesOptions.h +2 -2
- data/vendor/faiss/faiss/gpu/GpuResources.cpp +7 -2
- data/vendor/faiss/faiss/gpu/GpuResources.h +11 -4
- data/vendor/faiss/faiss/gpu/StandardGpuResources.cpp +51 -21
- data/vendor/faiss/faiss/gpu/StandardGpuResources.h +15 -5
- data/vendor/faiss/faiss/gpu/impl/IndexUtils.h +2 -2
- data/vendor/faiss/faiss/gpu/impl/InterleavedCodes.cpp +2 -2
- data/vendor/faiss/faiss/gpu/impl/InterleavedCodes.h +2 -2
- data/vendor/faiss/faiss/gpu/impl/RemapIndices.cpp +2 -2
- data/vendor/faiss/faiss/gpu/impl/RemapIndices.h +2 -2
- data/vendor/faiss/faiss/gpu/perf/IndexWrapper-inl.h +2 -2
- data/vendor/faiss/faiss/gpu/perf/IndexWrapper.h +2 -2
- data/vendor/faiss/faiss/gpu/perf/PerfClustering.cpp +2 -2
- data/vendor/faiss/faiss/gpu/perf/PerfIVFPQAdd.cpp +2 -3
- data/vendor/faiss/faiss/gpu/perf/WriteIndex.cpp +2 -2
- data/vendor/faiss/faiss/gpu/test/TestCodePacking.cpp +2 -2
- data/vendor/faiss/faiss/gpu/test/TestGpuIndexBinaryFlat.cpp +2 -2
- data/vendor/faiss/faiss/gpu/test/TestGpuIndexFlat.cpp +54 -54
- data/vendor/faiss/faiss/gpu/test/TestGpuIndexIVFFlat.cpp +80 -78
- data/vendor/faiss/faiss/gpu/test/TestGpuIndexIVFPQ.cpp +51 -51
- data/vendor/faiss/faiss/gpu/test/TestGpuIndexIVFScalarQuantizer.cpp +2 -2
- data/vendor/faiss/faiss/gpu/test/TestGpuMemoryException.cpp +3 -3
- data/vendor/faiss/faiss/gpu/test/TestGpuResidualQuantizer.cpp +70 -0
- data/vendor/faiss/faiss/gpu/test/TestUtils.cpp +74 -4
- data/vendor/faiss/faiss/gpu/test/TestUtils.h +2 -2
- data/vendor/faiss/faiss/gpu/test/demo_ivfpq_indexing_gpu.cpp +2 -2
- data/vendor/faiss/faiss/gpu/utils/{RaftUtils.h → CuvsUtils.h} +12 -11
- data/vendor/faiss/faiss/gpu/utils/DeviceUtils.h +2 -2
- data/vendor/faiss/faiss/gpu/utils/StackDeviceMemory.cpp +2 -2
- data/vendor/faiss/faiss/gpu/utils/StackDeviceMemory.h +2 -2
- data/vendor/faiss/faiss/gpu/utils/StaticUtils.h +2 -2
- data/vendor/faiss/faiss/gpu/utils/Timer.cpp +2 -2
- data/vendor/faiss/faiss/gpu/utils/Timer.h +2 -2
- data/vendor/faiss/faiss/impl/AdditiveQuantizer.cpp +79 -11
- data/vendor/faiss/faiss/impl/AdditiveQuantizer.h +17 -5
- data/vendor/faiss/faiss/impl/AuxIndexStructures.cpp +2 -2
- data/vendor/faiss/faiss/impl/AuxIndexStructures.h +2 -2
- data/vendor/faiss/faiss/impl/CodePacker.cpp +2 -2
- data/vendor/faiss/faiss/impl/CodePacker.h +2 -2
- data/vendor/faiss/faiss/impl/DistanceComputer.h +2 -2
- data/vendor/faiss/faiss/impl/FaissAssert.h +2 -2
- data/vendor/faiss/faiss/impl/FaissException.cpp +2 -2
- data/vendor/faiss/faiss/impl/FaissException.h +2 -3
- data/vendor/faiss/faiss/impl/HNSW.cpp +24 -19
- data/vendor/faiss/faiss/impl/HNSW.h +12 -2
- data/vendor/faiss/faiss/impl/IDSelector.cpp +2 -2
- data/vendor/faiss/faiss/impl/IDSelector.h +2 -2
- data/vendor/faiss/faiss/impl/LocalSearchQuantizer.cpp +2 -2
- data/vendor/faiss/faiss/impl/LocalSearchQuantizer.h +2 -2
- data/vendor/faiss/faiss/impl/LookupTableScaler.h +2 -2
- data/vendor/faiss/faiss/impl/NNDescent.cpp +2 -2
- data/vendor/faiss/faiss/impl/NNDescent.h +2 -2
- data/vendor/faiss/faiss/impl/NSG.cpp +27 -21
- data/vendor/faiss/faiss/impl/NSG.h +20 -8
- data/vendor/faiss/faiss/impl/PolysemousTraining.cpp +2 -2
- data/vendor/faiss/faiss/impl/PolysemousTraining.h +2 -2
- data/vendor/faiss/faiss/impl/ProductAdditiveQuantizer.cpp +2 -4
- data/vendor/faiss/faiss/impl/ProductAdditiveQuantizer.h +2 -2
- data/vendor/faiss/faiss/impl/ProductQuantizer-inl.h +2 -2
- data/vendor/faiss/faiss/impl/ProductQuantizer.cpp +2 -2
- data/vendor/faiss/faiss/impl/ProductQuantizer.h +2 -2
- data/vendor/faiss/faiss/impl/Quantizer.h +2 -2
- data/vendor/faiss/faiss/impl/ResidualQuantizer.cpp +2 -36
- data/vendor/faiss/faiss/impl/ResidualQuantizer.h +3 -13
- data/vendor/faiss/faiss/impl/ResultHandler.h +2 -2
- data/vendor/faiss/faiss/impl/ScalarQuantizer.cpp +2 -2
- data/vendor/faiss/faiss/impl/ScalarQuantizer.h +2 -2
- data/vendor/faiss/faiss/impl/ThreadedIndex-inl.h +2 -2
- data/vendor/faiss/faiss/impl/ThreadedIndex.h +2 -2
- data/vendor/faiss/faiss/impl/code_distance/code_distance-avx2.h +2 -2
- data/vendor/faiss/faiss/impl/code_distance/code_distance-avx512.h +2 -2
- data/vendor/faiss/faiss/impl/code_distance/code_distance-generic.h +2 -2
- data/vendor/faiss/faiss/impl/code_distance/code_distance-sve.h +440 -0
- data/vendor/faiss/faiss/impl/code_distance/code_distance.h +55 -2
- data/vendor/faiss/faiss/impl/index_read.cpp +2 -5
- data/vendor/faiss/faiss/impl/index_read_utils.h +2 -2
- data/vendor/faiss/faiss/impl/index_write.cpp +2 -6
- data/vendor/faiss/faiss/impl/io.cpp +2 -2
- data/vendor/faiss/faiss/impl/io.h +2 -2
- data/vendor/faiss/faiss/impl/io_macros.h +2 -9
- data/vendor/faiss/faiss/impl/kmeans1d.cpp +2 -3
- data/vendor/faiss/faiss/impl/kmeans1d.h +2 -2
- data/vendor/faiss/faiss/impl/lattice_Zn.cpp +2 -3
- data/vendor/faiss/faiss/impl/lattice_Zn.h +2 -2
- data/vendor/faiss/faiss/impl/platform_macros.h +12 -2
- data/vendor/faiss/faiss/impl/pq4_fast_scan.cpp +2 -2
- data/vendor/faiss/faiss/impl/pq4_fast_scan.h +20 -2
- data/vendor/faiss/faiss/impl/pq4_fast_scan_search_1.cpp +2 -2
- data/vendor/faiss/faiss/impl/pq4_fast_scan_search_qbs.cpp +2 -2
- data/vendor/faiss/faiss/impl/residual_quantizer_encode_steps.cpp +3 -3
- data/vendor/faiss/faiss/impl/residual_quantizer_encode_steps.h +2 -2
- data/vendor/faiss/faiss/impl/simd_result_handlers.h +18 -18
- data/vendor/faiss/faiss/index_factory.cpp +20 -21
- data/vendor/faiss/faiss/index_factory.h +2 -2
- data/vendor/faiss/faiss/index_io.h +2 -2
- data/vendor/faiss/faiss/invlists/BlockInvertedLists.cpp +2 -2
- data/vendor/faiss/faiss/invlists/BlockInvertedLists.h +2 -2
- data/vendor/faiss/faiss/invlists/DirectMap.cpp +2 -2
- data/vendor/faiss/faiss/invlists/DirectMap.h +2 -2
- data/vendor/faiss/faiss/invlists/InvertedLists.cpp +2 -2
- data/vendor/faiss/faiss/invlists/InvertedLists.h +2 -2
- data/vendor/faiss/faiss/invlists/InvertedListsIOHook.cpp +2 -2
- data/vendor/faiss/faiss/invlists/InvertedListsIOHook.h +2 -2
- data/vendor/faiss/faiss/invlists/OnDiskInvertedLists.cpp +2 -3
- data/vendor/faiss/faiss/invlists/OnDiskInvertedLists.h +2 -2
- data/vendor/faiss/faiss/python/python_callbacks.cpp +2 -2
- data/vendor/faiss/faiss/python/python_callbacks.h +2 -2
- data/vendor/faiss/faiss/utils/AlignedTable.h +5 -3
- data/vendor/faiss/faiss/utils/Heap.cpp +2 -2
- data/vendor/faiss/faiss/utils/Heap.h +2 -2
- data/vendor/faiss/faiss/utils/NeuralNet.cpp +11 -7
- data/vendor/faiss/faiss/utils/NeuralNet.h +2 -2
- data/vendor/faiss/faiss/utils/WorkerThread.cpp +2 -2
- data/vendor/faiss/faiss/utils/WorkerThread.h +2 -2
- data/vendor/faiss/faiss/utils/approx_topk/approx_topk.h +2 -2
- data/vendor/faiss/faiss/utils/approx_topk/avx2-inl.h +2 -2
- data/vendor/faiss/faiss/utils/approx_topk/generic.h +2 -2
- data/vendor/faiss/faiss/utils/approx_topk/mode.h +2 -2
- data/vendor/faiss/faiss/utils/approx_topk_hamming/approx_topk_hamming.h +2 -2
- data/vendor/faiss/faiss/utils/bf16.h +2 -2
- data/vendor/faiss/faiss/utils/distances.cpp +191 -2
- data/vendor/faiss/faiss/utils/distances.h +3 -3
- data/vendor/faiss/faiss/utils/distances_fused/avx512.cpp +2 -2
- data/vendor/faiss/faiss/utils/distances_fused/avx512.h +2 -2
- data/vendor/faiss/faiss/utils/distances_fused/distances_fused.cpp +2 -2
- data/vendor/faiss/faiss/utils/distances_fused/distances_fused.h +2 -2
- data/vendor/faiss/faiss/utils/distances_fused/simdlib_based.cpp +2 -2
- data/vendor/faiss/faiss/utils/distances_fused/simdlib_based.h +2 -2
- data/vendor/faiss/faiss/utils/distances_simd.cpp +502 -3
- data/vendor/faiss/faiss/utils/extra_distances-inl.h +2 -2
- data/vendor/faiss/faiss/utils/extra_distances.cpp +2 -3
- data/vendor/faiss/faiss/utils/extra_distances.h +2 -2
- data/vendor/faiss/faiss/utils/fp16-arm.h +2 -2
- data/vendor/faiss/faiss/utils/fp16-fp16c.h +2 -2
- data/vendor/faiss/faiss/utils/fp16-inl.h +2 -2
- data/vendor/faiss/faiss/utils/fp16.h +2 -2
- data/vendor/faiss/faiss/utils/hamming-inl.h +2 -2
- data/vendor/faiss/faiss/utils/hamming.cpp +2 -3
- data/vendor/faiss/faiss/utils/hamming.h +2 -2
- data/vendor/faiss/faiss/utils/hamming_distance/avx2-inl.h +2 -2
- data/vendor/faiss/faiss/utils/hamming_distance/avx512-inl.h +490 -0
- data/vendor/faiss/faiss/utils/hamming_distance/common.h +2 -2
- data/vendor/faiss/faiss/utils/hamming_distance/generic-inl.h +2 -2
- data/vendor/faiss/faiss/utils/hamming_distance/hamdis-inl.h +5 -2
- data/vendor/faiss/faiss/utils/hamming_distance/neon-inl.h +5 -5
- data/vendor/faiss/faiss/utils/ordered_key_value.h +2 -2
- data/vendor/faiss/faiss/utils/partitioning.cpp +2 -2
- data/vendor/faiss/faiss/utils/partitioning.h +2 -2
- data/vendor/faiss/faiss/utils/prefetch.h +2 -2
- data/vendor/faiss/faiss/utils/quantize_lut.cpp +2 -2
- data/vendor/faiss/faiss/utils/quantize_lut.h +2 -2
- data/vendor/faiss/faiss/utils/random.cpp +2 -2
- data/vendor/faiss/faiss/utils/random.h +2 -2
- data/vendor/faiss/faiss/utils/simdlib.h +2 -2
- data/vendor/faiss/faiss/utils/simdlib_avx2.h +2 -2
- data/vendor/faiss/faiss/utils/simdlib_avx512.h +2 -2
- data/vendor/faiss/faiss/utils/simdlib_emulated.h +2 -2
- data/vendor/faiss/faiss/utils/simdlib_neon.h +2 -2
- data/vendor/faiss/faiss/utils/simdlib_ppc64.h +2 -2
- data/vendor/faiss/faiss/utils/sorting.cpp +2 -2
- data/vendor/faiss/faiss/utils/sorting.h +2 -2
- data/vendor/faiss/faiss/utils/transpose/transpose-avx2-inl.h +2 -2
- data/vendor/faiss/faiss/utils/transpose/transpose-avx512-inl.h +2 -2
- data/vendor/faiss/faiss/utils/utils.cpp +7 -7
- data/vendor/faiss/faiss/utils/utils.h +4 -3
- metadata +9 -10
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
* Copyright (c)
|
1
|
+
/*
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
3
|
*
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
@@ -29,7 +29,7 @@ struct TestFlatOptions {
|
|
29
29
|
numQueriesOverride(-1),
|
30
30
|
kOverride(-1),
|
31
31
|
dimOverride(-1),
|
32
|
-
|
32
|
+
use_cuvs(false) {}
|
33
33
|
|
34
34
|
faiss::MetricType metric;
|
35
35
|
float metricArg;
|
@@ -39,7 +39,7 @@ struct TestFlatOptions {
|
|
39
39
|
int numQueriesOverride;
|
40
40
|
int kOverride;
|
41
41
|
int dimOverride;
|
42
|
-
bool
|
42
|
+
bool use_cuvs;
|
43
43
|
};
|
44
44
|
|
45
45
|
void testFlat(const TestFlatOptions& opt) {
|
@@ -75,7 +75,7 @@ void testFlat(const TestFlatOptions& opt) {
|
|
75
75
|
faiss::gpu::GpuIndexFlatConfig config;
|
76
76
|
config.device = device;
|
77
77
|
config.useFloat16 = opt.useFloat16;
|
78
|
-
config.
|
78
|
+
config.use_cuvs = opt.use_cuvs;
|
79
79
|
|
80
80
|
faiss::gpu::GpuIndexFlat gpuIndex(&res, dim, opt.metric, config);
|
81
81
|
gpuIndex.metric_arg = opt.metricArg;
|
@@ -114,8 +114,8 @@ TEST(TestGpuIndexFlat, IP_Float32) {
|
|
114
114
|
|
115
115
|
testFlat(opt);
|
116
116
|
|
117
|
-
#if defined
|
118
|
-
opt.
|
117
|
+
#if defined USE_NVIDIA_CUVS
|
118
|
+
opt.use_cuvs = true;
|
119
119
|
testFlat(opt);
|
120
120
|
#endif
|
121
121
|
}
|
@@ -128,8 +128,8 @@ TEST(TestGpuIndexFlat, L1_Float32) {
|
|
128
128
|
|
129
129
|
testFlat(opt);
|
130
130
|
|
131
|
-
#if defined
|
132
|
-
opt.
|
131
|
+
#if defined USE_NVIDIA_CUVS
|
132
|
+
opt.use_cuvs = true;
|
133
133
|
testFlat(opt);
|
134
134
|
#endif
|
135
135
|
}
|
@@ -141,8 +141,8 @@ TEST(TestGpuIndexFlat, Lp_Float32) {
|
|
141
141
|
opt.useFloat16 = false;
|
142
142
|
|
143
143
|
testFlat(opt);
|
144
|
-
#if defined
|
145
|
-
opt.
|
144
|
+
#if defined USE_NVIDIA_CUVS
|
145
|
+
opt.use_cuvs = true;
|
146
146
|
testFlat(opt);
|
147
147
|
#endif
|
148
148
|
}
|
@@ -155,8 +155,8 @@ TEST(TestGpuIndexFlat, L2_Float32) {
|
|
155
155
|
opt.useFloat16 = false;
|
156
156
|
|
157
157
|
testFlat(opt);
|
158
|
-
#if defined
|
159
|
-
opt.
|
158
|
+
#if defined USE_NVIDIA_CUVS
|
159
|
+
opt.use_cuvs = true;
|
160
160
|
testFlat(opt);
|
161
161
|
#endif
|
162
162
|
}
|
@@ -173,8 +173,8 @@ TEST(TestGpuIndexFlat, L2_k_2048) {
|
|
173
173
|
opt.numVecsOverride = 10000;
|
174
174
|
|
175
175
|
testFlat(opt);
|
176
|
-
#if defined
|
177
|
-
opt.
|
176
|
+
#if defined USE_NVIDIA_CUVS
|
177
|
+
opt.use_cuvs = true;
|
178
178
|
testFlat(opt);
|
179
179
|
#endif
|
180
180
|
}
|
@@ -189,8 +189,8 @@ TEST(TestGpuIndexFlat, L2_Float32_K1) {
|
|
189
189
|
opt.kOverride = 1;
|
190
190
|
|
191
191
|
testFlat(opt);
|
192
|
-
#if defined
|
193
|
-
opt.
|
192
|
+
#if defined USE_NVIDIA_CUVS
|
193
|
+
opt.use_cuvs = true;
|
194
194
|
testFlat(opt);
|
195
195
|
#endif
|
196
196
|
}
|
@@ -203,8 +203,8 @@ TEST(TestGpuIndexFlat, IP_Float16) {
|
|
203
203
|
opt.useFloat16 = true;
|
204
204
|
|
205
205
|
testFlat(opt);
|
206
|
-
#if defined
|
207
|
-
opt.
|
206
|
+
#if defined USE_NVIDIA_CUVS
|
207
|
+
opt.use_cuvs = true;
|
208
208
|
testFlat(opt);
|
209
209
|
#endif
|
210
210
|
}
|
@@ -217,8 +217,8 @@ TEST(TestGpuIndexFlat, L2_Float16) {
|
|
217
217
|
opt.useFloat16 = true;
|
218
218
|
|
219
219
|
testFlat(opt);
|
220
|
-
#if defined
|
221
|
-
opt.
|
220
|
+
#if defined USE_NVIDIA_CUVS
|
221
|
+
opt.use_cuvs = true;
|
222
222
|
testFlat(opt);
|
223
223
|
#endif
|
224
224
|
}
|
@@ -233,8 +233,8 @@ TEST(TestGpuIndexFlat, L2_Float16_K1) {
|
|
233
233
|
opt.kOverride = 1;
|
234
234
|
|
235
235
|
testFlat(opt);
|
236
|
-
#if defined
|
237
|
-
opt.
|
236
|
+
#if defined USE_NVIDIA_CUVS
|
237
|
+
opt.use_cuvs = true;
|
238
238
|
testFlat(opt);
|
239
239
|
#endif
|
240
240
|
}
|
@@ -254,8 +254,8 @@ TEST(TestGpuIndexFlat, L2_Tiling) {
|
|
254
254
|
opt.kOverride = 64;
|
255
255
|
|
256
256
|
testFlat(opt);
|
257
|
-
#if defined
|
258
|
-
opt.
|
257
|
+
#if defined USE_NVIDIA_CUVS
|
258
|
+
opt.use_cuvs = true;
|
259
259
|
testFlat(opt);
|
260
260
|
#endif
|
261
261
|
}
|
@@ -268,7 +268,7 @@ TEST(TestGpuIndexFlat, QueryEmpty) {
|
|
268
268
|
faiss::gpu::GpuIndexFlatConfig config;
|
269
269
|
config.device = 0;
|
270
270
|
config.useFloat16 = false;
|
271
|
-
config.
|
271
|
+
config.use_cuvs = false;
|
272
272
|
int dim = 128;
|
273
273
|
faiss::gpu::GpuIndexFlatL2 gpuIndex(&res, dim, config);
|
274
274
|
|
@@ -292,7 +292,7 @@ TEST(TestGpuIndexFlat, QueryEmpty) {
|
|
292
292
|
}
|
293
293
|
}
|
294
294
|
|
295
|
-
void testCopyFrom(bool
|
295
|
+
void testCopyFrom(bool use_cuvs) {
|
296
296
|
int numVecs = faiss::gpu::randVal(100, 200);
|
297
297
|
int dim = faiss::gpu::randVal(1, 1000);
|
298
298
|
|
@@ -310,7 +310,7 @@ void testCopyFrom(bool use_raft) {
|
|
310
310
|
faiss::gpu::GpuIndexFlatConfig config;
|
311
311
|
config.device = device;
|
312
312
|
config.useFloat16 = useFloat16;
|
313
|
-
config.
|
313
|
+
config.use_cuvs = use_cuvs;
|
314
314
|
|
315
315
|
// Fill with garbage values
|
316
316
|
faiss::gpu::GpuIndexFlatL2 gpuIndex(&res, 2000, config);
|
@@ -343,13 +343,13 @@ TEST(TestGpuIndexFlat, CopyFrom) {
|
|
343
343
|
testCopyFrom(false);
|
344
344
|
}
|
345
345
|
|
346
|
-
#if defined
|
347
|
-
TEST(
|
346
|
+
#if defined USE_NVIDIA_CUVS
|
347
|
+
TEST(TestCuvsGpuIndexFlat, CopyFrom) {
|
348
348
|
testCopyFrom(true);
|
349
349
|
}
|
350
350
|
#endif
|
351
351
|
|
352
|
-
void testCopyTo(bool
|
352
|
+
void testCopyTo(bool use_cuvs) {
|
353
353
|
faiss::gpu::StandardGpuResources res;
|
354
354
|
res.noTempMemory();
|
355
355
|
|
@@ -363,7 +363,7 @@ void testCopyTo(bool use_raft) {
|
|
363
363
|
faiss::gpu::GpuIndexFlatConfig config;
|
364
364
|
config.device = device;
|
365
365
|
config.useFloat16 = useFloat16;
|
366
|
-
config.
|
366
|
+
config.use_cuvs = use_cuvs;
|
367
367
|
|
368
368
|
faiss::gpu::GpuIndexFlatL2 gpuIndex(&res, dim, config);
|
369
369
|
gpuIndex.add(numVecs, vecs.data());
|
@@ -394,13 +394,13 @@ TEST(TestGpuIndexFlat, CopyTo) {
|
|
394
394
|
testCopyTo(false);
|
395
395
|
}
|
396
396
|
|
397
|
-
#if defined
|
398
|
-
TEST(
|
397
|
+
#if defined USE_NVIDIA_CUVS
|
398
|
+
TEST(TestCuvsGpuIndexFlat, CopyTo) {
|
399
399
|
testCopyTo(true);
|
400
400
|
}
|
401
401
|
#endif
|
402
402
|
|
403
|
-
void testUnifiedMemory(bool
|
403
|
+
void testUnifiedMemory(bool use_cuvs) {
|
404
404
|
// Construct on a random device to test multi-device, if we have
|
405
405
|
// multiple devices
|
406
406
|
int device = faiss::gpu::randVal(0, faiss::gpu::getNumDevices() - 1);
|
@@ -426,7 +426,7 @@ void testUnifiedMemory(bool use_raft) {
|
|
426
426
|
faiss::gpu::GpuIndexFlatConfig config;
|
427
427
|
config.device = device;
|
428
428
|
config.memorySpace = faiss::gpu::MemorySpace::Unified;
|
429
|
-
config.
|
429
|
+
config.use_cuvs = use_cuvs;
|
430
430
|
|
431
431
|
faiss::gpu::GpuIndexFlatL2 gpuIndexL2(&res, dim, config);
|
432
432
|
|
@@ -452,13 +452,13 @@ TEST(TestGpuIndexFlat, UnifiedMemory) {
|
|
452
452
|
testUnifiedMemory(false);
|
453
453
|
}
|
454
454
|
|
455
|
-
#if defined
|
456
|
-
TEST(
|
455
|
+
#if defined USE_NVIDIA_CUVS
|
456
|
+
TEST(TestCuvsGpuIndexFlat, UnifiedMemory) {
|
457
457
|
testUnifiedMemory(true);
|
458
458
|
}
|
459
459
|
#endif
|
460
460
|
|
461
|
-
void testLargeIndex(bool
|
461
|
+
void testLargeIndex(bool use_cuvs) {
|
462
462
|
// Construct on a random device to test multi-device, if we have
|
463
463
|
// multiple devices
|
464
464
|
int device = faiss::gpu::randVal(0, faiss::gpu::getNumDevices() - 1);
|
@@ -489,7 +489,7 @@ void testLargeIndex(bool use_raft) {
|
|
489
489
|
|
490
490
|
faiss::gpu::GpuIndexFlatConfig config;
|
491
491
|
config.device = device;
|
492
|
-
config.
|
492
|
+
config.use_cuvs = use_cuvs;
|
493
493
|
faiss::gpu::GpuIndexFlatL2 gpuIndexL2(&res, dim, config);
|
494
494
|
|
495
495
|
cpuIndexL2.add(nb, xb.data());
|
@@ -513,13 +513,13 @@ TEST(TestGpuIndexFlat, LargeIndex) {
|
|
513
513
|
testLargeIndex(false);
|
514
514
|
}
|
515
515
|
|
516
|
-
#if defined
|
517
|
-
TEST(
|
516
|
+
#if defined USE_NVIDIA_CUVS
|
517
|
+
TEST(TestCuvsGpuIndexFlat, LargeIndex) {
|
518
518
|
testLargeIndex(true);
|
519
519
|
}
|
520
520
|
#endif
|
521
521
|
|
522
|
-
void testResidual(bool
|
522
|
+
void testResidual(bool use_cuvs) {
|
523
523
|
// Construct on a random device to test multi-device, if we have
|
524
524
|
// multiple devices
|
525
525
|
int device = faiss::gpu::randVal(0, faiss::gpu::getNumDevices() - 1);
|
@@ -529,7 +529,7 @@ void testResidual(bool use_raft) {
|
|
529
529
|
|
530
530
|
faiss::gpu::GpuIndexFlatConfig config;
|
531
531
|
config.device = device;
|
532
|
-
config.
|
532
|
+
config.use_cuvs = use_cuvs;
|
533
533
|
|
534
534
|
int dim = 32;
|
535
535
|
faiss::IndexFlat cpuIndex(dim, faiss::MetricType::METRIC_L2);
|
@@ -566,13 +566,13 @@ TEST(TestGpuIndexFlat, Residual) {
|
|
566
566
|
testResidual(false);
|
567
567
|
}
|
568
568
|
|
569
|
-
#if defined
|
570
|
-
TEST(
|
569
|
+
#if defined USE_NVIDIA_CUVS
|
570
|
+
TEST(TestCuvsGpuIndexFlat, Residual) {
|
571
571
|
testResidual(true);
|
572
572
|
}
|
573
573
|
#endif
|
574
574
|
|
575
|
-
void testReconstruct(bool
|
575
|
+
void testReconstruct(bool use_cuvs) {
|
576
576
|
// Construct on a random device to test multi-device, if we have
|
577
577
|
// multiple devices
|
578
578
|
int device = faiss::gpu::randVal(0, faiss::gpu::getNumDevices() - 1);
|
@@ -589,7 +589,7 @@ void testReconstruct(bool use_raft) {
|
|
589
589
|
faiss::gpu::GpuIndexFlatConfig config;
|
590
590
|
config.device = device;
|
591
591
|
config.useFloat16 = useFloat16;
|
592
|
-
config.
|
592
|
+
config.use_cuvs = use_cuvs;
|
593
593
|
|
594
594
|
faiss::gpu::GpuIndexFlat gpuIndex(
|
595
595
|
&res, dim, faiss::MetricType::METRIC_L2, config);
|
@@ -657,13 +657,13 @@ void testReconstruct(bool use_raft) {
|
|
657
657
|
TEST(TestGpuIndexFlat, Reconstruct) {
|
658
658
|
testReconstruct(false);
|
659
659
|
}
|
660
|
-
#if defined
|
661
|
-
TEST(
|
660
|
+
#if defined USE_NVIDIA_CUVS
|
661
|
+
TEST(TestCuvsGpuIndexFlat, Reconstruct) {
|
662
662
|
testReconstruct(true);
|
663
663
|
}
|
664
664
|
#endif
|
665
665
|
|
666
|
-
void testSearchAndReconstruct(bool
|
666
|
+
void testSearchAndReconstruct(bool use_cuvs) {
|
667
667
|
// Construct on a random device to test multi-device, if we have
|
668
668
|
// multiple devices
|
669
669
|
int device = faiss::gpu::randVal(0, faiss::gpu::getNumDevices() - 1);
|
@@ -683,7 +683,7 @@ void testSearchAndReconstruct(bool use_raft) {
|
|
683
683
|
|
684
684
|
faiss::gpu::GpuIndexFlatConfig config;
|
685
685
|
config.device = device;
|
686
|
-
config.
|
686
|
+
config.use_cuvs = use_cuvs;
|
687
687
|
faiss::gpu::GpuIndexFlatL2 gpuIndex(&res, dim, config);
|
688
688
|
|
689
689
|
cpuIndex.add(nb, xb.data());
|
@@ -754,8 +754,8 @@ TEST(TestGpuIndexFlat, SearchAndReconstruct) {
|
|
754
754
|
testSearchAndReconstruct(false);
|
755
755
|
}
|
756
756
|
|
757
|
-
#if defined
|
758
|
-
TEST(
|
757
|
+
#if defined USE_NVIDIA_CUVS
|
758
|
+
TEST(TestCuvsGpuIndexFlat, SearchAndReconstruct) {
|
759
759
|
testSearchAndReconstruct(true);
|
760
760
|
}
|
761
761
|
#endif
|