faiss 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/faiss/version.rb +1 -1
- data/vendor/faiss/faiss/Index.h +1 -1
- data/vendor/faiss/faiss/IndexBinaryHNSW.cpp +6 -7
- data/vendor/faiss/faiss/IndexBinaryIVF.cpp +3 -3
- data/vendor/faiss/faiss/IndexHNSW.cpp +173 -143
- data/vendor/faiss/faiss/IndexIVF.cpp +2 -2
- data/vendor/faiss/faiss/IndexIVFAdditiveQuantizer.cpp +2 -2
- data/vendor/faiss/faiss/IndexIVFFlat.cpp +3 -1
- data/vendor/faiss/faiss/IndexIVFFlatPanorama.cpp +3 -3
- data/vendor/faiss/faiss/IndexIVFPQ.cpp +2 -3
- data/vendor/faiss/faiss/IndexIVFPQR.cpp +2 -3
- data/vendor/faiss/faiss/IndexIVFRaBitQ.cpp +4 -13
- data/vendor/faiss/faiss/IndexNNDescent.cpp +1 -1
- data/vendor/faiss/faiss/IndexNSG.cpp +1 -2
- data/vendor/faiss/faiss/IndexScalarQuantizer.cpp +68 -6
- data/vendor/faiss/faiss/IndexScalarQuantizer.h +10 -0
- data/vendor/faiss/faiss/cppcontrib/SaDecodeKernels.h +1 -1
- data/vendor/faiss/faiss/cppcontrib/sa_decode/Level2-neon-inl.h +902 -12
- data/vendor/faiss/faiss/cppcontrib/sa_decode/PQ-neon-inl.h +702 -10
- data/vendor/faiss/faiss/factory_tools.cpp +4 -0
- data/vendor/faiss/faiss/gpu/GpuResources.h +3 -2
- data/vendor/faiss/faiss/gpu/StandardGpuResources.cpp +11 -12
- data/vendor/faiss/faiss/gpu/StandardGpuResources.h +3 -3
- data/vendor/faiss/faiss/gpu_metal/MetalDistance.h +87 -0
- data/vendor/faiss/faiss/gpu_metal/MetalIndex.h +7 -0
- data/vendor/faiss/faiss/gpu_metal/MetalIndexIVFFlat.h +181 -0
- data/vendor/faiss/faiss/gpu_metal/MetalKernels.h +48 -3
- data/vendor/faiss/faiss/gpu_metal/MetalPythonBridge.h +45 -0
- data/vendor/faiss/faiss/gpu_metal/impl/MetalIVFFlat.h +193 -0
- data/vendor/faiss/faiss/impl/HNSW.cpp +556 -199
- data/vendor/faiss/faiss/impl/HNSW.h +51 -13
- data/vendor/faiss/faiss/impl/NSG.cpp +15 -11
- data/vendor/faiss/faiss/impl/Panorama.h +11 -0
- data/vendor/faiss/faiss/impl/ProductQuantizer.cpp +25 -2
- data/vendor/faiss/faiss/impl/RaBitQUtils.cpp +1 -1
- data/vendor/faiss/faiss/impl/RaBitQuantizer.cpp +7 -1
- data/vendor/faiss/faiss/impl/ResultHandler.h +1 -0
- data/vendor/faiss/faiss/impl/ScalarQuantizer.cpp +271 -8
- data/vendor/faiss/faiss/impl/ScalarQuantizer.h +50 -0
- data/vendor/faiss/faiss/impl/VisitedTable.cpp +10 -10
- data/vendor/faiss/faiss/impl/VisitedTable.h +69 -34
- data/vendor/faiss/faiss/impl/fast_scan/dispatching.h +3 -1
- data/vendor/faiss/faiss/impl/hnsw/MinimaxHeap.cpp +35 -43
- data/vendor/faiss/faiss/impl/hnsw/MinimaxHeap.h +64 -15
- data/vendor/faiss/faiss/impl/hnsw/avx2.cpp +86 -40
- data/vendor/faiss/faiss/impl/hnsw/avx512.cpp +81 -50
- data/vendor/faiss/faiss/impl/index_read.cpp +100 -39
- data/vendor/faiss/faiss/impl/index_write.cpp +1 -0
- data/vendor/faiss/faiss/impl/io_macros.h +25 -0
- data/vendor/faiss/faiss/impl/platform_macros.h +12 -8
- data/vendor/faiss/faiss/impl/pq_code_distance/avx2.cpp +2 -0
- data/vendor/faiss/faiss/impl/pq_code_distance/avx512.cpp +2 -0
- data/vendor/faiss/faiss/impl/pq_code_distance/neon.cpp +2 -0
- data/vendor/faiss/faiss/impl/pq_code_distance/pq_code_distance-generic.cpp +20 -0
- data/vendor/faiss/faiss/impl/pq_code_distance/pq_code_distance-inl.h +36 -0
- data/vendor/faiss/faiss/impl/pq_code_distance/pq_code_distance-sve.cpp +5 -0
- data/vendor/faiss/faiss/impl/pq_code_distance/pq_scan_impl.h +105 -0
- data/vendor/faiss/faiss/impl/pq_code_distance/rvv.cpp +2 -0
- data/vendor/faiss/faiss/impl/scalar_quantizer/distance_computers.h +6 -0
- data/vendor/faiss/faiss/impl/scalar_quantizer/quantizers.h +327 -18
- data/vendor/faiss/faiss/impl/scalar_quantizer/sq-avx2.cpp +264 -27
- data/vendor/faiss/faiss/impl/scalar_quantizer/sq-avx512-impl.h +553 -0
- data/vendor/faiss/faiss/impl/scalar_quantizer/sq-avx512-spr.cpp +559 -0
- data/vendor/faiss/faiss/impl/scalar_quantizer/sq-avx512.cpp +199 -27
- data/vendor/faiss/faiss/impl/scalar_quantizer/sq-dispatch.h +366 -3
- data/vendor/faiss/faiss/impl/scalar_quantizer/sq-neon.cpp +144 -19
- data/vendor/faiss/faiss/impl/scalar_quantizer/sq-rvv.cpp +26 -0
- data/vendor/faiss/faiss/impl/simd_dispatch.h +65 -8
- data/vendor/faiss/faiss/index_factory.cpp +5 -1
- data/vendor/faiss/faiss/index_io.h +16 -0
- data/vendor/faiss/faiss/invlists/DirectMap.cpp +4 -1
- data/vendor/faiss/faiss/invlists/InvertedLists.cpp +13 -13
- data/vendor/faiss/faiss/invlists/InvertedLists.h +2 -2
- data/vendor/faiss/faiss/svs/IndexSVSVamana.cpp +119 -22
- data/vendor/faiss/faiss/svs/IndexSVSVamana.h +15 -5
- data/vendor/faiss/faiss/svs/IndexSVSVamanaLVQ.cpp +3 -2
- data/vendor/faiss/faiss/svs/IndexSVSVamanaLVQ.h +2 -1
- data/vendor/faiss/faiss/svs/IndexSVSVamanaLeanVec.cpp +65 -24
- data/vendor/faiss/faiss/svs/IndexSVSVamanaLeanVec.h +3 -2
- data/vendor/faiss/faiss/utils/bf16.h +34 -0
- data/vendor/faiss/faiss/utils/distances_simd.cpp +0 -1
- data/vendor/faiss/faiss/utils/hamming.cpp +8 -8
- data/vendor/faiss/faiss/utils/hamming_distance/hamming_avx2.cpp +2 -1
- data/vendor/faiss/faiss/utils/hamming_distance/hamming_avx512_spr.cpp +15 -0
- data/vendor/faiss/faiss/utils/hamming_distance/hamming_computer-avx512.h +6 -30
- data/vendor/faiss/faiss/utils/hamming_distance/hamming_computer-avx512_spr.h +171 -0
- data/vendor/faiss/faiss/utils/partitioning.cpp +0 -2
- data/vendor/faiss/faiss/utils/simd_impl/partitioning_simdlib256.h +14 -68
- data/vendor/faiss/faiss/utils/simd_impl/rabitq_avx512_spr.cpp +343 -0
- data/vendor/faiss/faiss/utils/simd_levels.cpp +12 -2
- metadata +12 -2
|
@@ -110,12 +110,6 @@ inline int __builtin_clzll(uint64_t x) {
|
|
|
110
110
|
#define FAISS_PACK_STRUCTS_BEGIN __pragma(pack(push, 1))
|
|
111
111
|
#define FAISS_PACK_STRUCTS_END __pragma(pack(pop))
|
|
112
112
|
|
|
113
|
-
#ifdef SWIG
|
|
114
|
-
#define FAISS_MAYBE_UNUSED
|
|
115
|
-
#else
|
|
116
|
-
#define FAISS_MAYBE_UNUSED [[maybe_unused]]
|
|
117
|
-
#endif
|
|
118
|
-
|
|
119
113
|
#else
|
|
120
114
|
/*******************************************************
|
|
121
115
|
* Linux and OSX
|
|
@@ -130,12 +124,10 @@ inline int __builtin_clzll(uint64_t x) {
|
|
|
130
124
|
#define ALIGNED(x)
|
|
131
125
|
#define FAISS_PACKED
|
|
132
126
|
#define FAISS_RESTRICT
|
|
133
|
-
#define FAISS_MAYBE_UNUSED
|
|
134
127
|
#else
|
|
135
128
|
#define ALIGNED(x) __attribute__((aligned(x)))
|
|
136
129
|
#define FAISS_PACKED __attribute__((packed))
|
|
137
130
|
#define FAISS_RESTRICT __restrict
|
|
138
|
-
#define FAISS_MAYBE_UNUSED [[maybe_unused]]
|
|
139
131
|
#endif
|
|
140
132
|
|
|
141
133
|
// On non-Windows, FAISS_PACKED handles packing, so these are no-ops
|
|
@@ -220,3 +212,15 @@ inline int __builtin_clzll(uint64_t x) {
|
|
|
220
212
|
#define Swap4Bytes(val) \
|
|
221
213
|
((((val) >> 24) & 0x000000FF) | (((val) >> 8) & 0x0000FF00) | \
|
|
222
214
|
(((val) << 8) & 0x00FF0000) | (((val) << 24) & 0xFF000000))
|
|
215
|
+
|
|
216
|
+
/*******************************************************
|
|
217
|
+
* A few things that SWIG has trouble parsing
|
|
218
|
+
*******************************************************/
|
|
219
|
+
|
|
220
|
+
#ifdef SWIG
|
|
221
|
+
#define FAISS_MAYBE_UNUSED
|
|
222
|
+
#define FAISS_FINAL
|
|
223
|
+
#else
|
|
224
|
+
#define FAISS_MAYBE_UNUSED [[maybe_unused]]
|
|
225
|
+
#define FAISS_FINAL final
|
|
226
|
+
#endif
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
#include <faiss/impl/pq_code_distance/pq_code_distance-avx2.h>
|
|
14
14
|
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
15
15
|
#include <faiss/utils/hamming_distance/hamming_computer-avx2.h>
|
|
16
|
+
// NOLINTNEXTLINE(facebook-hte-InlineHeader,facebook-unused-include-check)
|
|
17
|
+
#include <faiss/impl/pq_code_distance/pq_scan_impl.h>
|
|
16
18
|
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
17
19
|
#include <faiss/impl/pq_code_distance/PQDistanceComputer_impl.h>
|
|
18
20
|
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
15
15
|
#include <faiss/utils/hamming_distance/hamming_computer-avx512.h>
|
|
16
16
|
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
17
|
+
#include <faiss/impl/pq_code_distance/pq_scan_impl.h>
|
|
18
|
+
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
17
19
|
#include <faiss/impl/pq_code_distance/PQDistanceComputer_impl.h>
|
|
18
20
|
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
19
21
|
#include <faiss/impl/pq_code_distance/IVFPQScanner_impl.h>
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
15
15
|
#include <faiss/utils/hamming_distance/hamming_computer-neon.h>
|
|
16
16
|
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
17
|
+
#include <faiss/impl/pq_code_distance/pq_scan_impl.h>
|
|
18
|
+
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
17
19
|
#include <faiss/impl/pq_code_distance/PQDistanceComputer_impl.h>
|
|
18
20
|
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
19
21
|
#include <faiss/impl/pq_code_distance/IVFPQScanner_impl.h>
|
|
@@ -17,9 +17,29 @@
|
|
|
17
17
|
|
|
18
18
|
#include <faiss/impl/pq_code_distance/pq_code_distance-generic.h>
|
|
19
19
|
|
|
20
|
+
#define THE_SIMD_LEVEL SIMDLevel::NONE
|
|
21
|
+
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
22
|
+
#include <faiss/impl/pq_code_distance/pq_scan_impl.h>
|
|
23
|
+
#undef THE_SIMD_LEVEL
|
|
24
|
+
|
|
20
25
|
namespace faiss {
|
|
21
26
|
namespace pq_code_distance {
|
|
22
27
|
|
|
28
|
+
void pq_scan_8bit(
|
|
29
|
+
size_t M,
|
|
30
|
+
const float* dis_table,
|
|
31
|
+
const uint8_t* codes,
|
|
32
|
+
size_t ncodes,
|
|
33
|
+
size_t k,
|
|
34
|
+
float* heap_dis,
|
|
35
|
+
int64_t* heap_ids,
|
|
36
|
+
bool max_heap) {
|
|
37
|
+
with_simd_level([&]<SIMDLevel SL>() {
|
|
38
|
+
pq_scan_8bit_impl<SL>(
|
|
39
|
+
M, dis_table, codes, ncodes, k, heap_dis, heap_ids, max_heap);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
23
43
|
float pq_code_distance_8bit_single(
|
|
24
44
|
size_t M,
|
|
25
45
|
const float* sim_table,
|
|
@@ -245,11 +245,47 @@ FAISS_API void pq_code_distance_8bit_four(
|
|
|
245
245
|
float& result2,
|
|
246
246
|
float& result3);
|
|
247
247
|
|
|
248
|
+
/*********************************************************************
|
|
249
|
+
* Standalone PQ scan — SIMD-dispatched full-index scan.
|
|
250
|
+
*
|
|
251
|
+
* Scans all ncodes PQ codes against a precomputed distance table,
|
|
252
|
+
* maintaining a k-nearest-neighbor heap. Uses the SIMD PQ distance
|
|
253
|
+
* kernels (AVX2 gathers, etc.) for the inner loop, with the SIMD
|
|
254
|
+
* gathers inlined into the scan loop in each per-SIMD TU.
|
|
255
|
+
*
|
|
256
|
+
* Definitions are in pq_scan_impl.h (per-SIMD TUs) and
|
|
257
|
+
* pq_code_distance-generic.cpp (dispatch wrapper).
|
|
258
|
+
*********************************************************************/
|
|
259
|
+
|
|
260
|
+
template <SIMDLevel SL>
|
|
261
|
+
void pq_scan_8bit_impl(
|
|
262
|
+
size_t M,
|
|
263
|
+
const float* dis_table,
|
|
264
|
+
const uint8_t* codes,
|
|
265
|
+
size_t ncodes,
|
|
266
|
+
size_t k,
|
|
267
|
+
float* heap_dis,
|
|
268
|
+
int64_t* heap_ids,
|
|
269
|
+
bool max_heap);
|
|
270
|
+
|
|
271
|
+
/// Scan all ncodes 8-bit PQ codes, dispatching to the best SIMD level.
|
|
272
|
+
/// max_heap=true for L2 (CMax), false for IP (CMin).
|
|
273
|
+
FAISS_API void pq_scan_8bit(
|
|
274
|
+
size_t M,
|
|
275
|
+
const float* dis_table,
|
|
276
|
+
const uint8_t* codes,
|
|
277
|
+
size_t ncodes,
|
|
278
|
+
size_t k,
|
|
279
|
+
float* heap_dis,
|
|
280
|
+
int64_t* heap_ids,
|
|
281
|
+
bool max_heap);
|
|
282
|
+
|
|
248
283
|
} // namespace pq_code_distance
|
|
249
284
|
|
|
250
285
|
// Re-export public API into namespace faiss for convenience
|
|
251
286
|
using pq_code_distance::pq_code_distance_8bit_four;
|
|
252
287
|
using pq_code_distance::pq_code_distance_8bit_single;
|
|
288
|
+
using pq_code_distance::pq_scan_8bit;
|
|
253
289
|
using pq_code_distance::PQCodeDistance;
|
|
254
290
|
using pq_code_distance::PQCodeDistanceScalar;
|
|
255
291
|
|
|
@@ -347,4 +347,9 @@ void pq_code_distance_8bit_four_impl<SIMDLevel::ARM_SVE>(
|
|
|
347
347
|
} // namespace pq_code_distance
|
|
348
348
|
} // namespace faiss
|
|
349
349
|
|
|
350
|
+
#define THE_SIMD_LEVEL SIMDLevel::ARM_SVE
|
|
351
|
+
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
352
|
+
#include <faiss/impl/pq_code_distance/pq_scan_impl.h>
|
|
353
|
+
#undef THE_SIMD_LEVEL
|
|
354
|
+
|
|
350
355
|
#endif // COMPILE_SIMD_ARM_SVE
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#ifndef THE_SIMD_LEVEL
|
|
11
|
+
#error "THE_SIMD_LEVEL must be defined before including pq_scan_impl.h"
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
#include <faiss/impl/pq_code_distance/pq_code_distance-inl.h>
|
|
15
|
+
#include <faiss/utils/Heap.h>
|
|
16
|
+
|
|
17
|
+
namespace faiss {
|
|
18
|
+
namespace pq_code_distance {
|
|
19
|
+
|
|
20
|
+
namespace {
|
|
21
|
+
|
|
22
|
+
template <class C>
|
|
23
|
+
void pq_scan_8bit_at_level(
|
|
24
|
+
size_t M,
|
|
25
|
+
const float* dis_table,
|
|
26
|
+
const uint8_t* codes,
|
|
27
|
+
size_t ncodes,
|
|
28
|
+
size_t k,
|
|
29
|
+
float* heap_dis,
|
|
30
|
+
int64_t* heap_ids) {
|
|
31
|
+
const size_t code_size = M;
|
|
32
|
+
|
|
33
|
+
size_t j = 0;
|
|
34
|
+
for (; j + 3 < ncodes; j += 4) {
|
|
35
|
+
float d0, d1, d2, d3;
|
|
36
|
+
pq_code_distance_8bit_four_impl<THE_SIMD_LEVEL>( // NOLINT(facebook-modularize-issue-check)
|
|
37
|
+
M,
|
|
38
|
+
dis_table,
|
|
39
|
+
codes + j * code_size,
|
|
40
|
+
codes + (j + 1) * code_size,
|
|
41
|
+
codes + (j + 2) * code_size,
|
|
42
|
+
codes + (j + 3) * code_size,
|
|
43
|
+
d0,
|
|
44
|
+
d1,
|
|
45
|
+
d2,
|
|
46
|
+
d3);
|
|
47
|
+
|
|
48
|
+
if (C::cmp(heap_dis[0], d0)) {
|
|
49
|
+
heap_replace_top<C>(k, heap_dis, heap_ids, d0, j);
|
|
50
|
+
}
|
|
51
|
+
if (C::cmp(heap_dis[0], d1)) {
|
|
52
|
+
heap_replace_top<C>(k, heap_dis, heap_ids, d1, j + 1);
|
|
53
|
+
}
|
|
54
|
+
if (C::cmp(heap_dis[0], d2)) {
|
|
55
|
+
heap_replace_top<C>(k, heap_dis, heap_ids, d2, j + 2);
|
|
56
|
+
}
|
|
57
|
+
if (C::cmp(heap_dis[0], d3)) {
|
|
58
|
+
heap_replace_top<C>(k, heap_dis, heap_ids, d3, j + 3);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
for (; j < ncodes; j++) {
|
|
63
|
+
float dis = pq_code_distance_8bit_single_impl<THE_SIMD_LEVEL>( // NOLINT(facebook-modularize-issue-check)
|
|
64
|
+
M, dis_table, codes + j * code_size);
|
|
65
|
+
if (C::cmp(heap_dis[0], dis)) {
|
|
66
|
+
heap_replace_top<C>(k, heap_dis, heap_ids, dis, j);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
} // anonymous namespace
|
|
72
|
+
|
|
73
|
+
template <SIMDLevel SL>
|
|
74
|
+
void pq_scan_8bit_impl(
|
|
75
|
+
size_t M,
|
|
76
|
+
const float* dis_table,
|
|
77
|
+
const uint8_t* codes,
|
|
78
|
+
size_t ncodes,
|
|
79
|
+
size_t k,
|
|
80
|
+
float* heap_dis,
|
|
81
|
+
int64_t* heap_ids,
|
|
82
|
+
bool max_heap);
|
|
83
|
+
|
|
84
|
+
// NOLINTNEXTLINE(facebook-hte-MisplacedTemplateSpecialization,facebook-modularize-issue-check)
|
|
85
|
+
template <>
|
|
86
|
+
void pq_scan_8bit_impl<THE_SIMD_LEVEL>(
|
|
87
|
+
size_t M,
|
|
88
|
+
const float* dis_table,
|
|
89
|
+
const uint8_t* codes,
|
|
90
|
+
size_t ncodes,
|
|
91
|
+
size_t k,
|
|
92
|
+
float* heap_dis,
|
|
93
|
+
int64_t* heap_ids,
|
|
94
|
+
bool max_heap) {
|
|
95
|
+
if (max_heap) {
|
|
96
|
+
pq_scan_8bit_at_level<CMax<float, int64_t>>(
|
|
97
|
+
M, dis_table, codes, ncodes, k, heap_dis, heap_ids);
|
|
98
|
+
} else {
|
|
99
|
+
pq_scan_8bit_at_level<CMin<float, int64_t>>(
|
|
100
|
+
M, dis_table, codes, ncodes, k, heap_dis, heap_ids);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
} // namespace pq_code_distance
|
|
105
|
+
} // namespace faiss
|
|
@@ -56,6 +56,8 @@ void pq_code_distance_8bit_four_impl<SIMDLevel::RISCV_RVV>(
|
|
|
56
56
|
|
|
57
57
|
#define THE_SIMD_LEVEL SIMDLevel::RISCV_RVV
|
|
58
58
|
|
|
59
|
+
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
60
|
+
#include <faiss/impl/pq_code_distance/pq_scan_impl.h>
|
|
59
61
|
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
60
62
|
#include <faiss/utils/hamming_distance/hamming_computer-rvv.h>
|
|
61
63
|
// NOLINTNEXTLINE(facebook-hte-InlineHeader)
|
|
@@ -77,6 +77,12 @@ struct DCTemplate<Quantizer, Similarity, SIMDLevel::NONE> : SQDistanceComputer {
|
|
|
77
77
|
template <class Similarity, SIMDLevel SL>
|
|
78
78
|
struct DistanceComputerByte : SQDistanceComputer {};
|
|
79
79
|
|
|
80
|
+
// Byte-domain distance computer for QT_8bit_direct_signed (storage is
|
|
81
|
+
// value+128). Only specialized for AVX512_SPR; other levels fall back to
|
|
82
|
+
// the float-domain DCTemplate path via the dispatch logic.
|
|
83
|
+
template <class Similarity, SIMDLevel SL>
|
|
84
|
+
struct DistanceComputerByteSigned : SQDistanceComputer {};
|
|
85
|
+
|
|
80
86
|
template <class Similarity>
|
|
81
87
|
struct DistanceComputerByte<Similarity, SIMDLevel::NONE> : SQDistanceComputer {
|
|
82
88
|
using Sim = Similarity;
|