Open MarkReedZ opened 1 month 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
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