-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simsimd_avx512_i8_cos under vnni #91
Comments
Great catch, thank you too, @my-vegetable-has-exploded! Would you have time to submit a patch? |
I may need some time to familiarize myself with the project. Maybe several days later. |
@my-vegetable-has-exploded, much appreciated! The CONTRIBUTING.md contents may help. The very first command should be enough to compile 🤗 |
Sorry, I meet some problems. The situation of my codes is computing dot product of int8 after quantization, I can promise that all numbers fall in [-127,127] in this situation. So it is okay to convert |
@my-vegetable-has-exploded not sure about what you mean, but your Rust snippet looked reasonable. I think adjusting the C variant in this repo to work the same way is the way to go 🤷♂️ |
For example, we have a=[1,-2,3,-4] and b=[11,12,13,14]. We would convert it to a'=[1,2,3,4], b'=[11,-12,13,-14]. But if b=[-128,-128,-128,-128], than b'=[128,128,128,128], 128 would overflow in 8bit presentation. |
@my-vegetable-has-exploded I think the best route is to upcast to 16-but and use |
# [3.9.0](v3.8.1...v3.9.0) (2024-03-04) ### Add * Complex numbers support ([0a0665a](0a0665a)) * Hamming & Jaccard for pre-AVX512 CPUs ([4f1eba1](4f1eba1)), closes [#69](#69) * Rust binary distances ([960af05](960af05)), closes [#84](#84) ### Fix * `datatype` variable repeated ([8558c4a](8558c4a)) * VNNI casting on AVX-512 ([c4398d1](c4398d1)), closes [#91](#91) ### Improve * Python type inference ([227de70](227de70)) ### Make * Bump ip from 2.0.0 to 2.0.1 (#92) ([559a16d](559a16d)), closes [#92](#92)
🎉 This issue has been resolved in version 3.9.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Thanks for your great work!
When i reading codes in simsimd_avx512_i8_cos, https://github.com/ashvardanian/SimSIMD/blob/main/include/simsimd/spatial.h#L1120
I am a little confusing about that both input
a
andb
is signed, but_mm512_dpbusd_epi32
is product ofZeroExtend16
andSignedExtend16
, I think there maybe some problem when vectora
contain negative number like-1
.I think may it need to add more codes like this.
https://github.com/my-vegetable-has-exploded/dot-bench/blob/main/src/lib.rs#L54-L57
The text was updated successfully, but these errors were encountered: