Closed MarkReedZ closed 2 months ago
Once they add, we can integrate the native type. Until then, I'd avoid dependencies.
Great. I added a link for bf16 above and will add these when available.
But f16
is already supported, there is even an example!
And this implementation also does not rely on the half
crate. Doesn't this mean that it is also possible to introduce bf16
without a new dependency?
Or is this also blocked by the C implementation of bf16
not being ready yet?
We don't need a C-level or Rust-level support for f16
and bf16
to implement those. Just cast an arbitrary 16-bit scalar to a similarly named type defined in SimSIMD and you ready to go 🤗
Thank you for the quick answer, but I'm a little bit lost. 🙃
So I looked into the Rust code and for example in the case of cos
and f16
, the simsimd_cos_f16
C function is called. But this function based on the platform uses f16
specific intrinsics (e.g. svmla_f16_x
).
So I would expect that the bf16
-based metrics also have some corresponding C-functions (e.g. simsimd_cos_bf16
), which would rely on bf16
specific intrinsics. But I haven't found anything specific.
Do such bf16
intrinsics actually exist? I saw some bf16
related stuff for ARM NEON, and some for AVX512 but, I'm not sure what to do.
bf16 isn't implemented yet, you can track the progress here: https://github.com/ashvardanian/SimSIMD/issues/80
Hey @Wyctus! As you may have seen, the bf16
is now implemented. Have you tried using it? Do you still have any questions?
Hey @Wyctus! As you may have seen, the
bf16
is now implemented. Have you tried using it? Do you still have any questions?
Awesome! I haven't seen it yet, but I'm gonna try it tomorrow! 🚀 Thanks!
I tried to test bf16
in Rust, but I couldn't find a struct bf16(u16)
new type and the traits SpatialSimilarity
, ProbabilitySimilarity
and ComplexProducts
implemented for it.
Am I missing something?
Oh, wow, we forgot to expose it to Rust 🙈 Any chance you could contribute, @Wyctus? Should be identical to f16.
Sure, I'll send a PR, hopefully I'll have time today!
Hey, @Wyctus! How is it going? Would be great to merge those extensions into #154 - gonna be an epic release, and even better with your contributions 🤗
Hey, I'm going to send the PR later today! 🙂
Epic! The next release is going to be the coolest in the history of this library!
Rust has a crate half that has an f16 and bf16 we could be using. Users would probably be using this?
Rust will be adding f16 into the core language.
The addition of bf16 into the core is tracked here