You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- ✅ [View large indexes from disk](#serialization--serving-index-from-disk) without loading into RAM.
56
56
- ✅ Heterogeneous lookups, renaming/relabeling, and on-the-fly deletions.
57
57
- ✅ Binary Tanimoto and Sorensen coefficients for [Genomics and Chemistry applications](#usearch--rdkit--molecular-search).
@@ -138,7 +138,7 @@ The default storage/quantization level is hardware-dependant for efficiency, but
138
138
index = Index(
139
139
ndim=3, # Define the number of dimensions in input vectors
140
140
metric='cos', # Choose 'l2sq', 'ip', 'haversine' or other metric, default = 'cos'
141
-
dtype='bf16', # Store as 'f64', 'f32', 'f16', 'i8', 'b1'..., default = None
141
+
dtype='bf16', # Store as 'f64', 'f32', 'bf16', 'f16', 'e5m2', 'e4m3', 'e3m2', 'e2m3', 'u8', 'i8', 'b1'..., default = None
142
142
connectivity=16, # Optional: Limit number of neighbors per graph node
143
143
expansion_add=128, # Optional: Control the recall of indexing
144
144
expansion_search=64, # Optional: Control the quality of the search
@@ -251,7 +251,7 @@ assert!(
251
251
Training a quantization model and dimension-reduction is a common approach to accelerate vector search.
252
252
Those, however, are only sometimes reliable, can significantly affect the statistical properties of your data, and require regular adjustments if your distribution shifts.
253
253
Instead, we have focused on high-precision arithmetic over low-precision downcasted vectors.
254
-
The same index, and `add` and `search` operations will automatically down-cast or up-cast between `f64_t`, `f32_t`, `f16_t`, `i8_t`, and single-bit `b1x8_t` representations.
254
+
The same index, and `add` and `search` operations will automatically down-cast or up-cast between `f64_t`, `f32_t`, `bf16_t`, `f16_t`, `e5m2_t`, `e4m3_t`, `e3m2_t`, `e2m3_t`, `u8_t`, `i8_t`, and single-bit `b1x8_t` representations.
255
255
You can use the following command to check, if hardware acceleration is enabled:
In most cases, it's recommended to use half-precision floating-point numbers on modern hardware.
264
+
In most cases, `bf16` is recommended for modern CPUs.
265
+
For even smaller footprints, USearch supports IEEE & MX-compatible Float8 (`e5m2` and `e4m3`) and Float6 (`e3m2` and `e2m3`) formats.
266
+
You can pass pre-quantized buffers from [NumKong](https://github.com/ashvardanian/numkong) with the explicit `dtype=` parameter on `add` and `search`, or let USearch handle the quantization internally from higher-precision inputs.
265
267
When quantization is enabled, the "get"-like functions won't be able to recover the original data, so you may want to replicate the original vectors elsewhere.
266
268
When quantizing to `i8_t` integers, note that it's only valid for cosine-like metrics.
267
269
As part of the quantization process, the vectors are normalized to unit length and later scaled to [-127, 127] range to occupy the full 8-bit range.
@@ -479,46 +481,41 @@ The Haversine distance is available out of the box, but you can also define more
479
481
from numba import cfunc, types, carray
480
482
import math
481
483
482
-
# Define the dimension as 2 for latitude and longitude
0 commit comments