faiss 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (293) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/LICENSE.txt +1 -1
  4. data/lib/faiss/version.rb +1 -1
  5. data/vendor/faiss/faiss/AutoTune.cpp +2 -2
  6. data/vendor/faiss/faiss/AutoTune.h +3 -3
  7. data/vendor/faiss/faiss/Clustering.cpp +37 -6
  8. data/vendor/faiss/faiss/Clustering.h +12 -3
  9. data/vendor/faiss/faiss/IVFlib.cpp +6 -3
  10. data/vendor/faiss/faiss/IVFlib.h +2 -2
  11. data/vendor/faiss/faiss/Index.cpp +6 -2
  12. data/vendor/faiss/faiss/Index.h +30 -8
  13. data/vendor/faiss/faiss/Index2Layer.cpp +2 -2
  14. data/vendor/faiss/faiss/Index2Layer.h +2 -2
  15. data/vendor/faiss/faiss/IndexAdditiveQuantizer.cpp +7 -7
  16. data/vendor/faiss/faiss/IndexAdditiveQuantizer.h +2 -2
  17. data/vendor/faiss/faiss/IndexAdditiveQuantizerFastScan.cpp +14 -16
  18. data/vendor/faiss/faiss/IndexAdditiveQuantizerFastScan.h +2 -2
  19. data/vendor/faiss/faiss/IndexBinary.cpp +13 -2
  20. data/vendor/faiss/faiss/IndexBinary.h +8 -2
  21. data/vendor/faiss/faiss/IndexBinaryFlat.cpp +2 -3
  22. data/vendor/faiss/faiss/IndexBinaryFlat.h +2 -2
  23. data/vendor/faiss/faiss/IndexBinaryFromFloat.cpp +2 -2
  24. data/vendor/faiss/faiss/IndexBinaryFromFloat.h +2 -2
  25. data/vendor/faiss/faiss/IndexBinaryHNSW.cpp +2 -7
  26. data/vendor/faiss/faiss/IndexBinaryHNSW.h +3 -3
  27. data/vendor/faiss/faiss/IndexBinaryHash.cpp +2 -3
  28. data/vendor/faiss/faiss/IndexBinaryHash.h +2 -2
  29. data/vendor/faiss/faiss/IndexBinaryIVF.cpp +3 -3
  30. data/vendor/faiss/faiss/IndexBinaryIVF.h +2 -2
  31. data/vendor/faiss/faiss/IndexFastScan.cpp +32 -18
  32. data/vendor/faiss/faiss/IndexFastScan.h +11 -2
  33. data/vendor/faiss/faiss/IndexFlat.cpp +13 -10
  34. data/vendor/faiss/faiss/IndexFlat.h +2 -2
  35. data/vendor/faiss/faiss/IndexFlatCodes.cpp +170 -7
  36. data/vendor/faiss/faiss/IndexFlatCodes.h +25 -5
  37. data/vendor/faiss/faiss/IndexHNSW.cpp +156 -96
  38. data/vendor/faiss/faiss/IndexHNSW.h +54 -5
  39. data/vendor/faiss/faiss/IndexIDMap.cpp +19 -3
  40. data/vendor/faiss/faiss/IndexIDMap.h +5 -2
  41. data/vendor/faiss/faiss/IndexIVF.cpp +5 -6
  42. data/vendor/faiss/faiss/IndexIVF.h +13 -4
  43. data/vendor/faiss/faiss/IndexIVFAdditiveQuantizer.cpp +21 -7
  44. data/vendor/faiss/faiss/IndexIVFAdditiveQuantizer.h +5 -2
  45. data/vendor/faiss/faiss/IndexIVFAdditiveQuantizerFastScan.cpp +3 -14
  46. data/vendor/faiss/faiss/IndexIVFAdditiveQuantizerFastScan.h +2 -4
  47. data/vendor/faiss/faiss/IndexIVFFastScan.cpp +201 -91
  48. data/vendor/faiss/faiss/IndexIVFFastScan.h +33 -9
  49. data/vendor/faiss/faiss/IndexIVFFlat.cpp +2 -2
  50. data/vendor/faiss/faiss/IndexIVFFlat.h +2 -2
  51. data/vendor/faiss/faiss/IndexIVFIndependentQuantizer.cpp +2 -2
  52. data/vendor/faiss/faiss/IndexIVFIndependentQuantizer.h +2 -2
  53. data/vendor/faiss/faiss/IndexIVFPQ.cpp +3 -6
  54. data/vendor/faiss/faiss/IndexIVFPQ.h +2 -2
  55. data/vendor/faiss/faiss/IndexIVFPQFastScan.cpp +7 -14
  56. data/vendor/faiss/faiss/IndexIVFPQFastScan.h +2 -4
  57. data/vendor/faiss/faiss/IndexIVFPQR.cpp +2 -2
  58. data/vendor/faiss/faiss/IndexIVFPQR.h +2 -2
  59. data/vendor/faiss/faiss/IndexIVFSpectralHash.cpp +2 -3
  60. data/vendor/faiss/faiss/IndexIVFSpectralHash.h +2 -2
  61. data/vendor/faiss/faiss/IndexLSH.cpp +2 -3
  62. data/vendor/faiss/faiss/IndexLSH.h +2 -2
  63. data/vendor/faiss/faiss/IndexLattice.cpp +3 -21
  64. data/vendor/faiss/faiss/IndexLattice.h +5 -24
  65. data/vendor/faiss/faiss/IndexNNDescent.cpp +2 -31
  66. data/vendor/faiss/faiss/IndexNNDescent.h +3 -3
  67. data/vendor/faiss/faiss/IndexNSG.cpp +2 -5
  68. data/vendor/faiss/faiss/IndexNSG.h +3 -3
  69. data/vendor/faiss/faiss/IndexNeuralNetCodec.cpp +56 -0
  70. data/vendor/faiss/faiss/IndexNeuralNetCodec.h +49 -0
  71. data/vendor/faiss/faiss/IndexPQ.cpp +26 -26
  72. data/vendor/faiss/faiss/IndexPQ.h +2 -2
  73. data/vendor/faiss/faiss/IndexPQFastScan.cpp +2 -5
  74. data/vendor/faiss/faiss/IndexPQFastScan.h +2 -11
  75. data/vendor/faiss/faiss/IndexPreTransform.cpp +2 -2
  76. data/vendor/faiss/faiss/IndexPreTransform.h +3 -3
  77. data/vendor/faiss/faiss/IndexRefine.cpp +46 -9
  78. data/vendor/faiss/faiss/IndexRefine.h +9 -2
  79. data/vendor/faiss/faiss/IndexReplicas.cpp +2 -2
  80. data/vendor/faiss/faiss/IndexReplicas.h +2 -2
  81. data/vendor/faiss/faiss/IndexRowwiseMinMax.cpp +2 -2
  82. data/vendor/faiss/faiss/IndexRowwiseMinMax.h +2 -2
  83. data/vendor/faiss/faiss/IndexScalarQuantizer.cpp +5 -4
  84. data/vendor/faiss/faiss/IndexScalarQuantizer.h +2 -2
  85. data/vendor/faiss/faiss/IndexShards.cpp +2 -2
  86. data/vendor/faiss/faiss/IndexShards.h +2 -2
  87. data/vendor/faiss/faiss/IndexShardsIVF.cpp +2 -2
  88. data/vendor/faiss/faiss/IndexShardsIVF.h +2 -2
  89. data/vendor/faiss/faiss/MatrixStats.cpp +2 -2
  90. data/vendor/faiss/faiss/MatrixStats.h +2 -2
  91. data/vendor/faiss/faiss/MetaIndexes.cpp +2 -3
  92. data/vendor/faiss/faiss/MetaIndexes.h +2 -2
  93. data/vendor/faiss/faiss/MetricType.h +9 -4
  94. data/vendor/faiss/faiss/VectorTransform.cpp +2 -2
  95. data/vendor/faiss/faiss/VectorTransform.h +2 -2
  96. data/vendor/faiss/faiss/clone_index.cpp +2 -2
  97. data/vendor/faiss/faiss/clone_index.h +2 -2
  98. data/vendor/faiss/faiss/cppcontrib/SaDecodeKernels.h +2 -2
  99. data/vendor/faiss/faiss/cppcontrib/detail/CoarseBitType.h +2 -2
  100. data/vendor/faiss/faiss/cppcontrib/detail/UintReader.h +97 -19
  101. data/vendor/faiss/faiss/cppcontrib/factory_tools.cpp +192 -0
  102. data/vendor/faiss/faiss/cppcontrib/factory_tools.h +29 -0
  103. data/vendor/faiss/faiss/cppcontrib/sa_decode/Level2-avx2-inl.h +2 -2
  104. data/vendor/faiss/faiss/cppcontrib/sa_decode/Level2-inl.h +85 -32
  105. data/vendor/faiss/faiss/cppcontrib/sa_decode/Level2-neon-inl.h +2 -2
  106. data/vendor/faiss/faiss/cppcontrib/sa_decode/MinMax-inl.h +2 -2
  107. data/vendor/faiss/faiss/cppcontrib/sa_decode/MinMaxFP16-inl.h +2 -2
  108. data/vendor/faiss/faiss/cppcontrib/sa_decode/PQ-avx2-inl.h +2 -2
  109. data/vendor/faiss/faiss/cppcontrib/sa_decode/PQ-inl.h +2 -2
  110. data/vendor/faiss/faiss/cppcontrib/sa_decode/PQ-neon-inl.h +2 -2
  111. data/vendor/faiss/faiss/gpu/GpuAutoTune.cpp +2 -5
  112. data/vendor/faiss/faiss/gpu/GpuAutoTune.h +2 -2
  113. data/vendor/faiss/faiss/gpu/GpuCloner.cpp +45 -13
  114. data/vendor/faiss/faiss/gpu/GpuCloner.h +2 -2
  115. data/vendor/faiss/faiss/gpu/GpuClonerOptions.h +12 -6
  116. data/vendor/faiss/faiss/gpu/GpuDistance.h +11 -7
  117. data/vendor/faiss/faiss/gpu/GpuFaissAssert.h +3 -3
  118. data/vendor/faiss/faiss/gpu/GpuIcmEncoder.h +2 -2
  119. data/vendor/faiss/faiss/gpu/GpuIndex.h +10 -15
  120. data/vendor/faiss/faiss/gpu/GpuIndexBinaryFlat.h +2 -2
  121. data/vendor/faiss/faiss/gpu/GpuIndexCagra.h +285 -0
  122. data/vendor/faiss/faiss/gpu/GpuIndexFlat.h +2 -2
  123. data/vendor/faiss/faiss/gpu/GpuIndexIVF.h +8 -2
  124. data/vendor/faiss/faiss/gpu/GpuIndexIVFFlat.h +4 -2
  125. data/vendor/faiss/faiss/gpu/GpuIndexIVFPQ.h +3 -3
  126. data/vendor/faiss/faiss/gpu/GpuIndexIVFScalarQuantizer.h +2 -2
  127. data/vendor/faiss/faiss/gpu/GpuIndicesOptions.h +2 -2
  128. data/vendor/faiss/faiss/gpu/GpuResources.cpp +7 -2
  129. data/vendor/faiss/faiss/gpu/GpuResources.h +11 -4
  130. data/vendor/faiss/faiss/gpu/StandardGpuResources.cpp +66 -11
  131. data/vendor/faiss/faiss/gpu/StandardGpuResources.h +15 -5
  132. data/vendor/faiss/faiss/gpu/impl/IndexUtils.h +2 -2
  133. data/vendor/faiss/faiss/gpu/impl/InterleavedCodes.cpp +28 -23
  134. data/vendor/faiss/faiss/gpu/impl/InterleavedCodes.h +2 -2
  135. data/vendor/faiss/faiss/gpu/impl/RemapIndices.cpp +2 -2
  136. data/vendor/faiss/faiss/gpu/impl/RemapIndices.h +2 -2
  137. data/vendor/faiss/faiss/gpu/perf/IndexWrapper-inl.h +2 -2
  138. data/vendor/faiss/faiss/gpu/perf/IndexWrapper.h +2 -2
  139. data/vendor/faiss/faiss/gpu/perf/PerfClustering.cpp +8 -2
  140. data/vendor/faiss/faiss/gpu/perf/PerfIVFPQAdd.cpp +2 -3
  141. data/vendor/faiss/faiss/gpu/perf/WriteIndex.cpp +2 -2
  142. data/vendor/faiss/faiss/gpu/test/TestCodePacking.cpp +10 -7
  143. data/vendor/faiss/faiss/gpu/test/TestGpuIndexBinaryFlat.cpp +2 -2
  144. data/vendor/faiss/faiss/gpu/test/TestGpuIndexFlat.cpp +54 -54
  145. data/vendor/faiss/faiss/gpu/test/TestGpuIndexIVFFlat.cpp +144 -77
  146. data/vendor/faiss/faiss/gpu/test/TestGpuIndexIVFPQ.cpp +51 -51
  147. data/vendor/faiss/faiss/gpu/test/TestGpuIndexIVFScalarQuantizer.cpp +2 -2
  148. data/vendor/faiss/faiss/gpu/test/TestGpuMemoryException.cpp +3 -3
  149. data/vendor/faiss/faiss/gpu/test/TestGpuResidualQuantizer.cpp +70 -0
  150. data/vendor/faiss/faiss/gpu/test/TestUtils.cpp +74 -4
  151. data/vendor/faiss/faiss/gpu/test/TestUtils.h +2 -2
  152. data/vendor/faiss/faiss/gpu/test/demo_ivfpq_indexing_gpu.cpp +3 -3
  153. data/vendor/faiss/faiss/gpu/utils/{RaftUtils.h → CuvsUtils.h} +12 -11
  154. data/vendor/faiss/faiss/gpu/utils/DeviceUtils.h +8 -2
  155. data/vendor/faiss/faiss/gpu/utils/StackDeviceMemory.cpp +2 -2
  156. data/vendor/faiss/faiss/gpu/utils/StackDeviceMemory.h +2 -2
  157. data/vendor/faiss/faiss/gpu/utils/StaticUtils.h +2 -2
  158. data/vendor/faiss/faiss/gpu/utils/Timer.cpp +6 -3
  159. data/vendor/faiss/faiss/gpu/utils/Timer.h +3 -3
  160. data/vendor/faiss/faiss/impl/AdditiveQuantizer.cpp +79 -11
  161. data/vendor/faiss/faiss/impl/AdditiveQuantizer.h +17 -5
  162. data/vendor/faiss/faiss/impl/AuxIndexStructures.cpp +27 -2
  163. data/vendor/faiss/faiss/impl/AuxIndexStructures.h +11 -3
  164. data/vendor/faiss/faiss/impl/CodePacker.cpp +2 -2
  165. data/vendor/faiss/faiss/impl/CodePacker.h +2 -2
  166. data/vendor/faiss/faiss/impl/DistanceComputer.h +48 -2
  167. data/vendor/faiss/faiss/impl/FaissAssert.h +6 -4
  168. data/vendor/faiss/faiss/impl/FaissException.cpp +2 -2
  169. data/vendor/faiss/faiss/impl/FaissException.h +2 -3
  170. data/vendor/faiss/faiss/impl/HNSW.cpp +378 -205
  171. data/vendor/faiss/faiss/impl/HNSW.h +55 -24
  172. data/vendor/faiss/faiss/impl/IDSelector.cpp +2 -2
  173. data/vendor/faiss/faiss/impl/IDSelector.h +2 -2
  174. data/vendor/faiss/faiss/impl/LocalSearchQuantizer.cpp +10 -10
  175. data/vendor/faiss/faiss/impl/LocalSearchQuantizer.h +2 -2
  176. data/vendor/faiss/faiss/impl/LookupTableScaler.h +36 -2
  177. data/vendor/faiss/faiss/impl/NNDescent.cpp +15 -10
  178. data/vendor/faiss/faiss/impl/NNDescent.h +2 -2
  179. data/vendor/faiss/faiss/impl/NSG.cpp +26 -49
  180. data/vendor/faiss/faiss/impl/NSG.h +20 -8
  181. data/vendor/faiss/faiss/impl/PolysemousTraining.cpp +2 -2
  182. data/vendor/faiss/faiss/impl/PolysemousTraining.h +2 -2
  183. data/vendor/faiss/faiss/impl/ProductAdditiveQuantizer.cpp +2 -4
  184. data/vendor/faiss/faiss/impl/ProductAdditiveQuantizer.h +2 -2
  185. data/vendor/faiss/faiss/impl/ProductQuantizer-inl.h +2 -2
  186. data/vendor/faiss/faiss/impl/ProductQuantizer.cpp +3 -2
  187. data/vendor/faiss/faiss/impl/ProductQuantizer.h +7 -3
  188. data/vendor/faiss/faiss/impl/Quantizer.h +2 -2
  189. data/vendor/faiss/faiss/impl/ResidualQuantizer.cpp +2 -36
  190. data/vendor/faiss/faiss/impl/ResidualQuantizer.h +3 -13
  191. data/vendor/faiss/faiss/impl/ResultHandler.h +153 -34
  192. data/vendor/faiss/faiss/impl/ScalarQuantizer.cpp +721 -104
  193. data/vendor/faiss/faiss/impl/ScalarQuantizer.h +5 -2
  194. data/vendor/faiss/faiss/impl/ThreadedIndex-inl.h +2 -2
  195. data/vendor/faiss/faiss/impl/ThreadedIndex.h +2 -2
  196. data/vendor/faiss/faiss/impl/code_distance/code_distance-avx2.h +7 -2
  197. data/vendor/faiss/faiss/impl/code_distance/code_distance-avx512.h +248 -0
  198. data/vendor/faiss/faiss/impl/code_distance/code_distance-generic.h +2 -2
  199. data/vendor/faiss/faiss/impl/code_distance/code_distance-sve.h +440 -0
  200. data/vendor/faiss/faiss/impl/code_distance/code_distance.h +55 -2
  201. data/vendor/faiss/faiss/impl/index_read.cpp +31 -20
  202. data/vendor/faiss/faiss/impl/index_read_utils.h +37 -0
  203. data/vendor/faiss/faiss/impl/index_write.cpp +30 -16
  204. data/vendor/faiss/faiss/impl/io.cpp +15 -7
  205. data/vendor/faiss/faiss/impl/io.h +6 -6
  206. data/vendor/faiss/faiss/impl/io_macros.h +8 -9
  207. data/vendor/faiss/faiss/impl/kmeans1d.cpp +2 -3
  208. data/vendor/faiss/faiss/impl/kmeans1d.h +2 -2
  209. data/vendor/faiss/faiss/impl/lattice_Zn.cpp +2 -3
  210. data/vendor/faiss/faiss/impl/lattice_Zn.h +2 -2
  211. data/vendor/faiss/faiss/impl/platform_macros.h +34 -2
  212. data/vendor/faiss/faiss/impl/pq4_fast_scan.cpp +13 -2
  213. data/vendor/faiss/faiss/impl/pq4_fast_scan.h +20 -2
  214. data/vendor/faiss/faiss/impl/pq4_fast_scan_search_1.cpp +3 -3
  215. data/vendor/faiss/faiss/impl/pq4_fast_scan_search_qbs.cpp +450 -3
  216. data/vendor/faiss/faiss/impl/residual_quantizer_encode_steps.cpp +8 -8
  217. data/vendor/faiss/faiss/impl/residual_quantizer_encode_steps.h +3 -3
  218. data/vendor/faiss/faiss/impl/simd_result_handlers.h +151 -67
  219. data/vendor/faiss/faiss/index_factory.cpp +51 -34
  220. data/vendor/faiss/faiss/index_factory.h +2 -2
  221. data/vendor/faiss/faiss/index_io.h +14 -7
  222. data/vendor/faiss/faiss/invlists/BlockInvertedLists.cpp +30 -10
  223. data/vendor/faiss/faiss/invlists/BlockInvertedLists.h +5 -2
  224. data/vendor/faiss/faiss/invlists/DirectMap.cpp +11 -3
  225. data/vendor/faiss/faiss/invlists/DirectMap.h +2 -2
  226. data/vendor/faiss/faiss/invlists/InvertedLists.cpp +57 -19
  227. data/vendor/faiss/faiss/invlists/InvertedLists.h +20 -11
  228. data/vendor/faiss/faiss/invlists/InvertedListsIOHook.cpp +2 -2
  229. data/vendor/faiss/faiss/invlists/InvertedListsIOHook.h +2 -2
  230. data/vendor/faiss/faiss/invlists/OnDiskInvertedLists.cpp +23 -9
  231. data/vendor/faiss/faiss/invlists/OnDiskInvertedLists.h +4 -3
  232. data/vendor/faiss/faiss/python/python_callbacks.cpp +5 -5
  233. data/vendor/faiss/faiss/python/python_callbacks.h +2 -2
  234. data/vendor/faiss/faiss/utils/AlignedTable.h +5 -3
  235. data/vendor/faiss/faiss/utils/Heap.cpp +2 -2
  236. data/vendor/faiss/faiss/utils/Heap.h +107 -2
  237. data/vendor/faiss/faiss/utils/NeuralNet.cpp +346 -0
  238. data/vendor/faiss/faiss/utils/NeuralNet.h +147 -0
  239. data/vendor/faiss/faiss/utils/WorkerThread.cpp +2 -2
  240. data/vendor/faiss/faiss/utils/WorkerThread.h +2 -2
  241. data/vendor/faiss/faiss/utils/approx_topk/approx_topk.h +2 -2
  242. data/vendor/faiss/faiss/utils/approx_topk/avx2-inl.h +2 -2
  243. data/vendor/faiss/faiss/utils/approx_topk/generic.h +2 -2
  244. data/vendor/faiss/faiss/utils/approx_topk/mode.h +2 -2
  245. data/vendor/faiss/faiss/utils/approx_topk_hamming/approx_topk_hamming.h +2 -2
  246. data/vendor/faiss/faiss/utils/bf16.h +36 -0
  247. data/vendor/faiss/faiss/utils/distances.cpp +249 -90
  248. data/vendor/faiss/faiss/utils/distances.h +8 -8
  249. data/vendor/faiss/faiss/utils/distances_fused/avx512.cpp +2 -2
  250. data/vendor/faiss/faiss/utils/distances_fused/avx512.h +2 -2
  251. data/vendor/faiss/faiss/utils/distances_fused/distances_fused.cpp +2 -2
  252. data/vendor/faiss/faiss/utils/distances_fused/distances_fused.h +2 -2
  253. data/vendor/faiss/faiss/utils/distances_fused/simdlib_based.cpp +2 -2
  254. data/vendor/faiss/faiss/utils/distances_fused/simdlib_based.h +2 -2
  255. data/vendor/faiss/faiss/utils/distances_simd.cpp +1543 -56
  256. data/vendor/faiss/faiss/utils/extra_distances-inl.h +72 -2
  257. data/vendor/faiss/faiss/utils/extra_distances.cpp +87 -140
  258. data/vendor/faiss/faiss/utils/extra_distances.h +5 -4
  259. data/vendor/faiss/faiss/utils/fp16-arm.h +2 -2
  260. data/vendor/faiss/faiss/utils/fp16-fp16c.h +2 -2
  261. data/vendor/faiss/faiss/utils/fp16-inl.h +2 -2
  262. data/vendor/faiss/faiss/utils/fp16.h +2 -2
  263. data/vendor/faiss/faiss/utils/hamming-inl.h +2 -2
  264. data/vendor/faiss/faiss/utils/hamming.cpp +3 -4
  265. data/vendor/faiss/faiss/utils/hamming.h +2 -2
  266. data/vendor/faiss/faiss/utils/hamming_distance/avx2-inl.h +2 -2
  267. data/vendor/faiss/faiss/utils/hamming_distance/avx512-inl.h +490 -0
  268. data/vendor/faiss/faiss/utils/hamming_distance/common.h +2 -2
  269. data/vendor/faiss/faiss/utils/hamming_distance/generic-inl.h +6 -3
  270. data/vendor/faiss/faiss/utils/hamming_distance/hamdis-inl.h +7 -3
  271. data/vendor/faiss/faiss/utils/hamming_distance/neon-inl.h +5 -5
  272. data/vendor/faiss/faiss/utils/ordered_key_value.h +2 -2
  273. data/vendor/faiss/faiss/utils/partitioning.cpp +2 -2
  274. data/vendor/faiss/faiss/utils/partitioning.h +2 -2
  275. data/vendor/faiss/faiss/utils/prefetch.h +2 -2
  276. data/vendor/faiss/faiss/utils/quantize_lut.cpp +2 -2
  277. data/vendor/faiss/faiss/utils/quantize_lut.h +2 -2
  278. data/vendor/faiss/faiss/utils/random.cpp +45 -2
  279. data/vendor/faiss/faiss/utils/random.h +27 -2
  280. data/vendor/faiss/faiss/utils/simdlib.h +12 -3
  281. data/vendor/faiss/faiss/utils/simdlib_avx2.h +2 -2
  282. data/vendor/faiss/faiss/utils/simdlib_avx512.h +296 -0
  283. data/vendor/faiss/faiss/utils/simdlib_emulated.h +2 -2
  284. data/vendor/faiss/faiss/utils/simdlib_neon.h +7 -4
  285. data/vendor/faiss/faiss/utils/simdlib_ppc64.h +1084 -0
  286. data/vendor/faiss/faiss/utils/sorting.cpp +2 -2
  287. data/vendor/faiss/faiss/utils/sorting.h +2 -2
  288. data/vendor/faiss/faiss/utils/transpose/transpose-avx2-inl.h +2 -2
  289. data/vendor/faiss/faiss/utils/transpose/transpose-avx512-inl.h +176 -0
  290. data/vendor/faiss/faiss/utils/utils.cpp +17 -10
  291. data/vendor/faiss/faiss/utils/utils.h +7 -3
  292. metadata +22 -11
  293. data/vendor/faiss/faiss/impl/code_distance/code_distance_avx512.h +0 -102
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e41b15bbcda6c4d2a250df5b98d86e9baf51b34b90fc2fccb6f0a37f486ef417
4
- data.tar.gz: 768074275062ed45f1752e3a5c9d55a9695a6aa453e925aa0a6e607ce3215bab
3
+ metadata.gz: ae4ad57a987514417c76771a7318c454a505d108c60ee312eef12548c97bb21a
4
+ data.tar.gz: ccb724de6af1ea2b4e1a820ff28827cfdc881ca953ef9f0c03c2dcf3602567f1
5
5
  SHA512:
6
- metadata.gz: cecc466dd24e03206219b63e750e48b554355c1c5dfc8e911879988a6f31eb628617133f5b584b3de29efcbe65d087cf5b4e219371cee959e8248c989a4dbffc
7
- data.tar.gz: 3e0c6be53825949f9c51a0195d85cbed87bc198dd06852c88c537b13e6bcc8e7fa65a3e3c88667eefef44e95278fe2c73ece89d5f92bd24f8c0d27b543488b56
6
+ metadata.gz: 0d936042d4e70c21abfa584b1154a23bf312e6f2418df963a1a076abd7f7b3179782c10aa5eefa8e3f95a0984594e7e1ebecb858ca3673dd28208a895a2c3252
7
+ data.tar.gz: 45588388c9d15510d57f3d0db66d2ff9868f59c5eddc49507d72e247b962f270e62b5a44a7b70d38c570b31af5cc604156ab71dd7477a0240baa089d73a709af
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.3.3 (2025-01-30)
2
+
3
+ - Updated Faiss to 1.10.0
4
+
5
+ ## 0.3.2 (2024-10-05)
6
+
7
+ - Updated Faiss to 1.9.0
8
+
1
9
  ## 0.3.1 (2024-03-13)
2
10
 
3
11
  - Updated Faiss to 1.8.0
data/LICENSE.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  MIT License
2
2
 
3
3
  Copyright (c) Facebook, Inc. and its affiliates.
4
- Copyright (c) 2020-2024 Andrew Kane
4
+ Copyright (c) 2020-2025 Andrew Kane
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  of this software and associated documentation files (the "Software"), to deal
data/lib/faiss/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Faiss
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -86,7 +86,7 @@ struct OperatingPoint {
86
86
  double perf; ///< performance measure (output of a Criterion)
87
87
  double t; ///< corresponding execution time (ms)
88
88
  std::string key; ///< key that identifies this op pt
89
- int64_t cno; ///< integer identifer
89
+ int64_t cno; ///< integer identifier
90
90
  };
91
91
 
92
92
  struct OperatingPoints {
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -11,6 +11,7 @@
11
11
  #include <faiss/VectorTransform.h>
12
12
  #include <faiss/impl/AuxIndexStructures.h>
13
13
 
14
+ #include <chrono>
14
15
  #include <cinttypes>
15
16
  #include <cmath>
16
17
  #include <cstdio>
@@ -74,6 +75,14 @@ void Clustering::train(
74
75
 
75
76
  namespace {
76
77
 
78
+ uint64_t get_actual_rng_seed(const int seed) {
79
+ return (seed >= 0)
80
+ ? seed
81
+ : static_cast<uint64_t>(std::chrono::high_resolution_clock::now()
82
+ .time_since_epoch()
83
+ .count());
84
+ }
85
+
77
86
  idx_t subsample_training_set(
78
87
  const Clustering& clus,
79
88
  idx_t nx,
@@ -87,11 +96,30 @@ idx_t subsample_training_set(
87
96
  clus.k * clus.max_points_per_centroid,
88
97
  nx);
89
98
  }
90
- std::vector<int> perm(nx);
91
- rand_perm(perm.data(), nx, clus.seed);
99
+
100
+ const uint64_t actual_seed = get_actual_rng_seed(clus.seed);
101
+
102
+ std::vector<int> perm;
103
+ if (clus.use_faster_subsampling) {
104
+ // use subsampling with splitmix64 rng
105
+ SplitMix64RandomGenerator rng(actual_seed);
106
+
107
+ const idx_t new_nx = clus.k * clus.max_points_per_centroid;
108
+ perm.resize(new_nx);
109
+ for (idx_t i = 0; i < new_nx; i++) {
110
+ perm[i] = rng.rand_int(nx);
111
+ }
112
+ } else {
113
+ // use subsampling with a default std rng
114
+ perm.resize(nx);
115
+ rand_perm(perm.data(), nx, actual_seed);
116
+ }
117
+
92
118
  nx = clus.k * clus.max_points_per_centroid;
93
119
  uint8_t* x_new = new uint8_t[nx * line_size];
94
120
  *x_out = x_new;
121
+
122
+ // might be worth omp-ing as well
95
123
  for (idx_t i = 0; i < nx; i++) {
96
124
  memcpy(x_new + i * line_size, x + perm[i] * line_size, line_size);
97
125
  }
@@ -280,7 +308,7 @@ void Clustering::train_encoded(
280
308
 
281
309
  double t0 = getmillisecs();
282
310
 
283
- if (!codec) {
311
+ if (!codec && check_input_data_for_NaNs) {
284
312
  // Check for NaNs in input data. Normally it is the user's
285
313
  // responsibility, but it may spare us some hard-to-debug
286
314
  // reports.
@@ -383,6 +411,9 @@ void Clustering::train_encoded(
383
411
  }
384
412
  t0 = getmillisecs();
385
413
 
414
+ // initialize seed
415
+ const uint64_t actual_seed = get_actual_rng_seed(seed);
416
+
386
417
  // temporary buffer to decode vectors during the optimization
387
418
  std::vector<float> decode_buffer(codec ? d * decode_block_size : 0);
388
419
 
@@ -395,7 +426,7 @@ void Clustering::train_encoded(
395
426
  centroids.resize(d * k);
396
427
  std::vector<int> perm(nx);
397
428
 
398
- rand_perm(perm.data(), nx, seed + 1 + redo * 15486557L);
429
+ rand_perm(perm.data(), nx, actual_seed + 1 + redo * 15486557L);
399
430
 
400
431
  if (!codec) {
401
432
  for (int i = n_input_centroids; i < k; i++) {
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -43,11 +43,20 @@ struct ClusteringParameters {
43
43
  int min_points_per_centroid = 39;
44
44
  /// to limit size of dataset, otherwise the training set is subsampled
45
45
  int max_points_per_centroid = 256;
46
- /// seed for the random number generator
46
+ /// seed for the random number generator.
47
+ /// negative values lead to seeding an internal rng with
48
+ /// std::high_resolution_clock.
47
49
  int seed = 1234;
48
50
 
49
51
  /// when the training set is encoded, batch size of the codec decoder
50
52
  size_t decode_block_size = 32768;
53
+
54
+ /// whether to check for NaNs in an input data
55
+ bool check_input_data_for_NaNs = true;
56
+
57
+ /// Whether to use splitmix64-based random number generator for subsampling,
58
+ /// which is faster, but may pick duplicate points.
59
+ bool use_faster_subsampling = false;
51
60
  };
52
61
 
53
62
  struct ClusteringIterationStats {
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -352,7 +352,10 @@ void search_with_parameters(
352
352
  const IndexIVF* index_ivf = dynamic_cast<const IndexIVF*>(index);
353
353
  FAISS_THROW_IF_NOT(index_ivf);
354
354
 
355
- index_ivf->quantizer->search(n, x, params->nprobe, Dq.data(), Iq.data());
355
+ SearchParameters* quantizer_params =
356
+ (params) ? params->quantizer_params : nullptr;
357
+ index_ivf->quantizer->search(
358
+ n, x, params->nprobe, Dq.data(), Iq.data(), quantizer_params);
356
359
 
357
360
  if (nb_dis_ptr) {
358
361
  *nb_dis_ptr = count_ndis(index_ivf, n * params->nprobe, Iq.data());
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -134,6 +134,10 @@ void Index::sa_decode(idx_t, const uint8_t*, float*) const {
134
134
  FAISS_THROW_MSG("standalone codec not implemented for this type of index");
135
135
  }
136
136
 
137
+ void Index::add_sa_codes(idx_t, const uint8_t*, const idx_t*) {
138
+ FAISS_THROW_MSG("add_sa_codes not implemented for this type of index");
139
+ }
140
+
137
141
  namespace {
138
142
 
139
143
  // storage that explicitly reconstructs vectors before computing distances
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -17,9 +17,21 @@
17
17
  #include <typeinfo>
18
18
 
19
19
  #define FAISS_VERSION_MAJOR 1
20
- #define FAISS_VERSION_MINOR 8
20
+ #define FAISS_VERSION_MINOR 10
21
21
  #define FAISS_VERSION_PATCH 0
22
22
 
23
+ // Macro to combine the version components into a single string
24
+ #ifndef FAISS_STRINGIFY
25
+ #define FAISS_STRINGIFY(ARG) #ARG
26
+ #endif
27
+ #ifndef FAISS_TOSTRING
28
+ #define FAISS_TOSTRING(ARG) FAISS_STRINGIFY(ARG)
29
+ #endif
30
+ #define VERSION_STRING \
31
+ FAISS_TOSTRING(FAISS_VERSION_MAJOR) \
32
+ "." FAISS_TOSTRING(FAISS_VERSION_MINOR) "." FAISS_TOSTRING( \
33
+ FAISS_VERSION_PATCH)
34
+
23
35
  /**
24
36
  * @namespace faiss
25
37
  *
@@ -38,8 +50,8 @@
38
50
 
39
51
  namespace faiss {
40
52
 
41
- /// Forward declarations see impl/AuxIndexStructures.h, impl/IDSelector.h and
42
- /// impl/DistanceComputer.h
53
+ /// Forward declarations see impl/AuxIndexStructures.h, impl/IDSelector.h
54
+ /// and impl/DistanceComputer.h
43
55
  struct IDSelector;
44
56
  struct RangeSearchResult;
45
57
  struct DistanceComputer;
@@ -56,7 +68,8 @@ struct SearchParameters {
56
68
  virtual ~SearchParameters() {}
57
69
  };
58
70
 
59
- /** Abstract structure for an index, supports adding vectors and searching them.
71
+ /** Abstract structure for an index, supports adding vectors and searching
72
+ * them.
60
73
  *
61
74
  * All vectors provided at add or search time are 32-bit float arrays,
62
75
  * although the internal representation may vary.
@@ -154,7 +167,8 @@ struct Index {
154
167
 
155
168
  /** return the indexes of the k vectors closest to the query x.
156
169
  *
157
- * This function is identical as search but only return labels of neighbors.
170
+ * This function is identical as search but only return labels of
171
+ * neighbors.
158
172
  * @param n number of vectors
159
173
  * @param x input vectors to search, size n * d
160
174
  * @param labels output labels of the NNs, size n*k
@@ -179,7 +193,8 @@ struct Index {
179
193
  */
180
194
  virtual void reconstruct(idx_t key, float* recons) const;
181
195
 
182
- /** Reconstruct several stored vectors (or an approximation if lossy coding)
196
+ /** Reconstruct several stored vectors (or an approximation if lossy
197
+ * coding)
183
198
  *
184
199
  * this function may not be defined for some indexes
185
200
  * @param n number of vectors to reconstruct
@@ -292,6 +307,13 @@ struct Index {
292
307
  * trained in the same way and have the same
293
308
  * parameters). Otherwise throw. */
294
309
  virtual void check_compatible_for_merge(const Index& otherIndex) const;
310
+
311
+ /** Add vectors that are computed with the standalone codec
312
+ *
313
+ * @param codes codes to add size n * sa_code_size()
314
+ * @param xids corresponding ids, size n
315
+ */
316
+ virtual void add_sa_codes(idx_t n, const uint8_t* codes, const idx_t* xids);
295
317
  };
296
318
 
297
319
  } // namespace faiss
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -16,7 +16,6 @@
16
16
  #include <faiss/impl/ResultHandler.h>
17
17
  #include <faiss/utils/distances.h>
18
18
  #include <faiss/utils/extra_distances.h>
19
- #include <faiss/utils/utils.h>
20
19
 
21
20
  namespace faiss {
22
21
 
@@ -273,6 +272,7 @@ void IndexAdditiveQuantizer::search(
273
272
  DISPATCH(ST_norm_qint8)
274
273
  DISPATCH(ST_norm_qint4)
275
274
  DISPATCH(ST_norm_cqint4)
275
+ DISPATCH(ST_norm_from_LUT)
276
276
  case AdditiveQuantizer::ST_norm_cqint8:
277
277
  case AdditiveQuantizer::ST_norm_lsq2x4:
278
278
  case AdditiveQuantizer::ST_norm_rq2x4:
@@ -527,7 +527,7 @@ void ResidualCoarseQuantizer::search(
527
527
  float* distances,
528
528
  idx_t* labels,
529
529
  const SearchParameters* params_in) const {
530
- float beam_factor = this->beam_factor;
530
+ float actual_beam_factor = this->beam_factor;
531
531
  if (params_in) {
532
532
  auto params =
533
533
  dynamic_cast<const SearchParametersResidualCoarseQuantizer*>(
@@ -535,15 +535,15 @@ void ResidualCoarseQuantizer::search(
535
535
  FAISS_THROW_IF_NOT_MSG(
536
536
  params,
537
537
  "need SearchParametersResidualCoarseQuantizer parameters");
538
- beam_factor = params->beam_factor;
538
+ actual_beam_factor = params->beam_factor;
539
539
  }
540
540
 
541
- if (beam_factor < 0) {
541
+ if (actual_beam_factor < 0) {
542
542
  AdditiveCoarseQuantizer::search(n, x, k, distances, labels);
543
543
  return;
544
544
  }
545
545
 
546
- int beam_size = int(k * beam_factor);
546
+ int beam_size = int(k * actual_beam_factor);
547
547
  if (beam_size > ntotal) {
548
548
  beam_size = ntotal;
549
549
  }
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -8,11 +8,8 @@
8
8
  #include <faiss/IndexAdditiveQuantizerFastScan.h>
9
9
 
10
10
  #include <cassert>
11
- #include <climits>
12
11
  #include <memory>
13
12
 
14
- #include <omp.h>
15
-
16
13
  #include <faiss/impl/FaissAssert.h>
17
14
  #include <faiss/impl/LocalSearchQuantizer.h>
18
15
  #include <faiss/impl/LookupTableScaler.h>
@@ -35,30 +32,31 @@ IndexAdditiveQuantizerFastScan::IndexAdditiveQuantizerFastScan(
35
32
  }
36
33
 
37
34
  void IndexAdditiveQuantizerFastScan::init(
38
- AdditiveQuantizer* aq_2,
35
+ AdditiveQuantizer* aq_init,
39
36
  MetricType metric,
40
37
  int bbs) {
41
- FAISS_THROW_IF_NOT(aq_2 != nullptr);
42
- FAISS_THROW_IF_NOT(!aq_2->nbits.empty());
43
- FAISS_THROW_IF_NOT(aq_2->nbits[0] == 4);
38
+ FAISS_THROW_IF_NOT(aq_init != nullptr);
39
+ FAISS_THROW_IF_NOT(!aq_init->nbits.empty());
40
+ FAISS_THROW_IF_NOT(aq_init->nbits[0] == 4);
44
41
  if (metric == METRIC_INNER_PRODUCT) {
45
42
  FAISS_THROW_IF_NOT_MSG(
46
- aq_2->search_type == AdditiveQuantizer::ST_LUT_nonorm,
43
+ aq_init->search_type == AdditiveQuantizer::ST_LUT_nonorm,
47
44
  "Search type must be ST_LUT_nonorm for IP metric");
48
45
  } else {
49
46
  FAISS_THROW_IF_NOT_MSG(
50
- aq_2->search_type == AdditiveQuantizer::ST_norm_lsq2x4 ||
51
- aq_2->search_type == AdditiveQuantizer::ST_norm_rq2x4,
47
+ aq_init->search_type == AdditiveQuantizer::ST_norm_lsq2x4 ||
48
+ aq_init->search_type ==
49
+ AdditiveQuantizer::ST_norm_rq2x4,
52
50
  "Search type must be lsq2x4 or rq2x4 for L2 metric");
53
51
  }
54
52
 
55
- this->aq = aq_2;
53
+ this->aq = aq_init;
56
54
  if (metric == METRIC_L2) {
57
- M = aq_2->M + 2; // 2x4 bits AQ
55
+ M = aq_init->M + 2; // 2x4 bits AQ
58
56
  } else {
59
- M = aq_2->M;
57
+ M = aq_init->M;
60
58
  }
61
- init_fastscan(aq_2->d, M, 4, metric, bbs);
59
+ init_fastscan(aq_init->d, M, 4, metric, bbs);
62
60
 
63
61
  max_train_points = 1024 * ksub * M;
64
62
  }
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -103,4 +103,15 @@ void IndexBinary::check_compatible_for_merge(
103
103
  FAISS_THROW_MSG("check_compatible_for_merge() not implemented");
104
104
  }
105
105
 
106
+ size_t IndexBinary::sa_code_size() const {
107
+ return code_size;
108
+ }
109
+
110
+ void IndexBinary::add_sa_codes(
111
+ idx_t n,
112
+ const uint8_t* codes,
113
+ const idx_t* xids) {
114
+ add_with_ids(n, codes, xids);
115
+ }
116
+
106
117
  } // namespace faiss
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -171,6 +171,12 @@ struct IndexBinary {
171
171
  * parameters). Otherwise throw. */
172
172
  virtual void check_compatible_for_merge(
173
173
  const IndexBinary& otherIndex) const;
174
+
175
+ /** size of the produced codes in bytes */
176
+ virtual size_t sa_code_size() const;
177
+
178
+ /** Same as add_with_ids for IndexBinary. */
179
+ virtual void add_sa_codes(idx_t n, const uint8_t* codes, const idx_t* xids);
174
180
  };
175
181
 
176
182
  } // namespace faiss
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -14,7 +14,6 @@
14
14
  #include <faiss/impl/IDSelector.h>
15
15
  #include <faiss/utils/Heap.h>
16
16
  #include <faiss/utils/hamming.h>
17
- #include <faiss/utils/utils.h>
18
17
  #include <cstring>
19
18
 
20
19
  namespace faiss {
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -15,11 +15,6 @@
15
15
  #include <cstring>
16
16
  #include <memory>
17
17
 
18
- #include <queue>
19
- #include <unordered_set>
20
-
21
- #include <sys/stat.h>
22
- #include <sys/types.h>
23
18
  #include <cstdint>
24
19
 
25
20
  #include <faiss/IndexBinaryFlat.h>
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -21,7 +21,7 @@ namespace faiss {
21
21
  struct IndexBinaryHNSW : IndexBinary {
22
22
  typedef HNSW::storage_idx_t storage_idx_t;
23
23
 
24
- // the link strcuture
24
+ // the link structure
25
25
  HNSW hnsw;
26
26
 
27
27
  // the sequential storage
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -19,7 +19,6 @@
19
19
 
20
20
  #include <faiss/impl/AuxIndexStructures.h>
21
21
  #include <faiss/impl/FaissAssert.h>
22
- #include <faiss/impl/platform_macros.h>
23
22
 
24
23
  namespace faiss {
25
24
 
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.
@@ -456,7 +456,7 @@ void search_knn_hamming_heap(
456
456
  }
457
457
 
458
458
  } // parallel for
459
- } // parallel
459
+ } // parallel
460
460
 
461
461
  indexIVF_stats.nq += n;
462
462
  indexIVF_stats.nlist += nlistv;
@@ -1,5 +1,5 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
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.