usearch 0.9.1 → 0.9.3
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.
- package/.github/workflows/release.yml +3 -0
- package/Cargo.toml +1 -1
- package/README.md +5 -5
- package/VERSION +1 -1
- package/conanfile.py +1 -1
- package/include/usearch/usearch.hpp +1 -1
- package/package.json +1 -1
- package/python/scripts/bench.py +6 -6
- package/setup.py +8 -8
- package/src/punned.hpp +1 -1
package/Cargo.toml
CHANGED
package/README.md
CHANGED
|
@@ -66,11 +66,11 @@ Both USearch and FAISS implement the same HNSW algorithm.
|
|
|
66
66
|
But they differ in a lot of design decisions.
|
|
67
67
|
USearch is designed to be compact and broadly compatible without sacrificing performance.
|
|
68
68
|
|
|
69
|
-
| | FAISS, `f32` | USearch, `f32` | USearch, `f16` | USearch, `f8` |
|
|
70
|
-
| :--------- | -----------: | -------------: | -------------: | ------------: |
|
|
71
|
-
| Insertions | 76 K/s | 89 K/s | 73 K/s | **137 K/s** |
|
|
72
|
-
| Queries | 118 K/s | 167 K/s | 140 K/s | **281 K/s** |
|
|
73
|
-
| Recall @1 | 99% | 99.2% | 98% | **99.2%** |
|
|
69
|
+
| | FAISS, `f32` | USearch, `f32` | USearch, `f16` | USearch, `f8` | USearch + Numba, `f32` |
|
|
70
|
+
| :--------- | -----------: | -------------: | -------------: | ------------: | ---------------------: |
|
|
71
|
+
| Insertions | 76 K/s | 89 K/s | 73 K/s | **137 K/s** | 99 K/s |
|
|
72
|
+
| Queries | 118 K/s | 167 K/s | 140 K/s | **281 K/s** | 165 K/s |
|
|
73
|
+
| Recall @1 | 99% | 99.2% | 98% | **99.2%** | 99.2% |
|
|
74
74
|
|
|
75
75
|
> Dataset: 1M vectors sample of the Deep1B dataset.
|
|
76
76
|
> Hardware: `c7g.metal` AWS instance with 64 cores and DDR5 memory.
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.9.
|
|
1
|
+
0.9.3
|
package/conanfile.py
CHANGED
|
@@ -4,7 +4,7 @@ from conans import ConanFile
|
|
|
4
4
|
class USearchConan(ConanFile):
|
|
5
5
|
|
|
6
6
|
name = 'USearch'
|
|
7
|
-
version = '0.9.
|
|
7
|
+
version = '0.9.3'
|
|
8
8
|
license = 'Apache 2.0'
|
|
9
9
|
url = 'https://github.com/unum-cloud/usearch'
|
|
10
10
|
description = 'Smaller & Faster Single-File Vector Search Engine from Unum'
|
|
@@ -732,7 +732,7 @@ class usearch_pack_m uint40_t {
|
|
|
732
732
|
inline uint40_t() noexcept { std::memset(octets, 0, 5); }
|
|
733
733
|
inline uint40_t(std::uint32_t n) noexcept { std::memcpy(octets + 1, (char*)&n, 4), octets[0] = 0; }
|
|
734
734
|
inline uint40_t(std::uint64_t n) noexcept { std::memcpy(octets, (char*)&n + 3, 5); }
|
|
735
|
-
#if defined(USEARCH_IS_CLANG)
|
|
735
|
+
#if defined(USEARCH_IS_CLANG) && defined(USEARCH_IS_APPLE)
|
|
736
736
|
inline uint40_t(std::size_t n) noexcept { std::memcpy(octets, (char*)&n + 3, 5); }
|
|
737
737
|
#endif
|
|
738
738
|
|
package/package.json
CHANGED
package/python/scripts/bench.py
CHANGED
|
@@ -106,10 +106,10 @@ def main(
|
|
|
106
106
|
|
|
107
107
|
@cfunc(signature_f32)
|
|
108
108
|
def inner_product_f32(a, b, n, m):
|
|
109
|
-
a_array = carray(a,
|
|
110
|
-
b_array = carray(b,
|
|
109
|
+
a_array = carray(a, dim)
|
|
110
|
+
b_array = carray(b, dim)
|
|
111
111
|
c = types.float32(0)
|
|
112
|
-
for i in range(
|
|
112
|
+
for i in range(dim):
|
|
113
113
|
c += a_array[i] * b_array[i]
|
|
114
114
|
return types.float32(1 - c)
|
|
115
115
|
|
|
@@ -120,12 +120,12 @@ def main(
|
|
|
120
120
|
|
|
121
121
|
@cfunc(signature_f8)
|
|
122
122
|
def cos_f8(a, b, n, m):
|
|
123
|
-
a_array = carray(a,
|
|
124
|
-
b_array = carray(b,
|
|
123
|
+
a_array = carray(a, dim)
|
|
124
|
+
b_array = carray(b, dim)
|
|
125
125
|
c = types.int32(0)
|
|
126
126
|
a_sq = types.int32(0)
|
|
127
127
|
b_sq = types.int32(0)
|
|
128
|
-
for i in range(
|
|
128
|
+
for i in range(dim):
|
|
129
129
|
ai = types.int16(a_array[i])
|
|
130
130
|
bi = types.int16(b_array[i])
|
|
131
131
|
c += ai * bi
|
package/setup.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import sys
|
|
3
|
-
import platform
|
|
4
3
|
from setuptools import setup
|
|
4
|
+
|
|
5
5
|
from pybind11.setup_helpers import Pybind11Extension
|
|
6
6
|
|
|
7
7
|
|
|
@@ -22,11 +22,6 @@ if sys.platform == 'darwin':
|
|
|
22
22
|
if sys.platform == 'win32':
|
|
23
23
|
compile_args = ['/std:c++14', '/O2']
|
|
24
24
|
|
|
25
|
-
if platform.machine() == 'arm64':
|
|
26
|
-
compile_args.append('-march=armv8.2-a+simd+fp16+fp16fml+dotprod')
|
|
27
|
-
elif platform.machine() in ('i386', 'AMD64', 'x86_64'):
|
|
28
|
-
compile_args.append('-march=haswell')
|
|
29
|
-
|
|
30
25
|
ext_modules = [
|
|
31
26
|
Pybind11Extension(
|
|
32
27
|
'usearch.index',
|
|
@@ -58,16 +53,21 @@ setup(
|
|
|
58
53
|
license='Apache-2.0',
|
|
59
54
|
|
|
60
55
|
classifiers=[
|
|
61
|
-
'Development Status ::
|
|
56
|
+
'Development Status :: 5 - Production/Stable',
|
|
62
57
|
|
|
63
58
|
'Natural Language :: English',
|
|
64
59
|
'Intended Audience :: Developers',
|
|
65
60
|
'Intended Audience :: Information Technology',
|
|
66
61
|
'License :: OSI Approved :: Apache Software License',
|
|
67
62
|
|
|
63
|
+
'Programming Language :: C++',
|
|
68
64
|
'Programming Language :: Python :: 3 :: Only',
|
|
69
65
|
'Programming Language :: Python :: Implementation :: CPython',
|
|
70
|
-
'Programming Language ::
|
|
66
|
+
'Programming Language :: Java',
|
|
67
|
+
'Programming Language :: JavaScript',
|
|
68
|
+
'Programming Language :: Objective C',
|
|
69
|
+
'Programming Language :: Rust',
|
|
70
|
+
'Programming Language :: Other',
|
|
71
71
|
|
|
72
72
|
'Operating System :: MacOS',
|
|
73
73
|
'Operating System :: Unix',
|
package/src/punned.hpp
CHANGED
|
@@ -595,7 +595,7 @@ class punned_gt {
|
|
|
595
595
|
if (casted)
|
|
596
596
|
vector_data = casted_data, vector_bytes = casted_vector_bytes_;
|
|
597
597
|
|
|
598
|
-
return index_->search_around(hint, {vector_data, vector_bytes}, wanted, config);
|
|
598
|
+
return index_->search_around(static_cast<id_t>(hint), {vector_data, vector_bytes}, wanted, config);
|
|
599
599
|
}
|
|
600
600
|
|
|
601
601
|
template <typename scalar_at> add_result_t add_(label_t label, scalar_at const* vector, cast_t const& cast) {
|