unum-cloud / usearch

Fast Open-Source Search & Clustering engine × for Vectors & 🔜 Strings × in C++, C, Python, JavaScript, Rust, Java, Objective-C, Swift, C#, GoLang, and Wolfram 🔍
https://unum-cloud.github.io/usearch/
Apache License 2.0
2.28k stars 143 forks source link

Feature: Windows build is not compiled with SimSIMD, f16 support for cosine distance #325

Closed monatis closed 8 months ago

monatis commented 11 months ago

Describe what you are looking for

The pip-installable package for Windows seems to be not compiled with SimSIMD (can be seen in index.specs), which makes it ~3-10x slower than the Linux build.

Additionally, It seems that cosine distance supports AVX512 with dtype='f32' , but it fallbacks to AVX2 with dtype='f16'. So we need to make a choice between optimization for speed or optimization for storage. It would be great to support AVX512 with float16 as well and of course, to have SimSIMD support in pip-installable package for Windows. I can contribute to the implementation if there is no known limitation for these.

Can you contribute to the implementation?

Is your feature request specific to a certain interface?

It applies to everything

Contact Details

yusufsarigoz@gmail.com

Is there an existing issue for this?

Code of Conduct

ashvardanian commented 11 months ago

Hi, @monatis! Indeed, that issue exists. I use GCC attributes to annotate function-level compilation settings in SimSIMD. If you can find a way to make them work with MSVC - we will be able to accelerate the Windows build 🤗 Would you have time to work on that?

monatis commented 11 months ago

Hi @ashvardanian thanks for the quick response!

Yes, I can work on it this weekend.

My use case is semantic search on consumer-grade hardware, so every bit of optimization counts.

ashvardanian commented 10 months ago

Hi @monatis! How is it going? Would be happy to merge if its ready 🤗

ashvardanian commented 8 months ago

:tada: This issue has been resolved in version 2.10.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: