Skip to content

Commit

Permalink
std::simd runs with nightly added DistDot, DistL2 on f32
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-pierreBoth committed Apr 16, 2024
1 parent 7c1a6ff commit 5fb4519
Show file tree
Hide file tree
Showing 8 changed files with 529 additions and 2,089 deletions.
11 changes: 5 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ cfg-if = { version = "1.0" }

# for //
parking_lot = "0.12"
rayon = { version = "1.8" }
num_cpus = { version = "1.15.0" }
rayon = { version = "1.10" }
num_cpus = { version = "1.16" }

cpu-time = { version = "1.0" }
num-traits = { version = "0.2" }
Expand All @@ -89,8 +89,7 @@ anyhow = { version = "1.0" }

# x86_64 simd stuff , enabled by simdeez_f feature
simdeez = { version = "1.0", optional = true }
# beta
packed_simd = { version = "0.3", optional = true }


# for benchmark reading, so the lbrary do not depend on hdf5 nor ndarray
[dev-dependencies]
Expand All @@ -102,7 +101,7 @@ ndarray = { version = "0.15" }

default = []

# simd on x86/x86_64
# feature for std simd on nightly
stdsimd = []
# feature for simd on stable for x86*
simdeez_f = ["simdeez"]
# a beta feature experimental
6 changes: 3 additions & 3 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
when using mmap, the points less frequently used (points in lower layers) are preferentially mmap-ed while upper layers are preferentially
explcitly read from file.

Hnswio is now Sync (request from https://www.patreon.com/jodiethemathgenius)
Hnswio is now Sync.

feature stdsimd runs with nightly on Hamming with u32,u64 and DisL1 with f32
feature stdsimd, based on std::simd, runs with nightly on Hamming with u32,u64 and DisL1,DistL2, DistDot with f32

- The **version 0.2** introduces
1. possibility to use mmap on the data file storing the vectors represented in the hnsw structure. This is mostly usefule for
Expand All @@ -14,7 +14,7 @@
In case of mmap usage, a dump after inserting new elements must ensure that the old file is not overwritten, so a unique file name is
generated if necessary. See documentation of module Hnswio

1. the filtering trait
2. the filtering trait


- Upgrade of many dependencies. Change from simple_logger to env_logger. The logger is initialized one for all in file src/lib.rs and cannot be intialized twice. The level of log can be modulated by the RUST_LOG env variable on a module basis or switched off. See the *env_logger* crate doc.
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ Simd Avx2 implementation, currently based on the **simdeez** crate, is provided
* The simd provided by the simdeez crate is accessible with the feature "simdeez_f" for x86_64 processors.
Compile with **cargo build --release --features "simdeez_f"** ....
To compile this crate on a M1 chip just do not activate this feature.
As soon as std::simd lands in rust stable, it will be the default.

* It is nevertheless possible to experiment with std::simd. Compiling with the feature stdsimd
(**cargo build --release --features "stdsimd"**), activates the transitory crate packed_simd, this requires rust nightly.
**only the Hamming distance with the u32x16 and u64x8 types and DistL1 on f32 are provided**.
(**cargo build --release --features "stdsimd"**), activates the portable_simd features on rust nightly.
**Only the Hamming distance with the u32x16 and u64x8 types and DistL1,DistL2 and DistDot on f32 are provided**.

### Julia interface

Expand Down
Loading

0 comments on commit 5fb4519

Please sign in to comment.