Skip to content
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

Add support for bfloat16 #22

Merged
merged 1 commit into from
Oct 4, 2019
Merged

Conversation

tspiteri
Copy link
Contributor

@tspiteri tspiteri commented Apr 6, 2019

bfloat16 is another 16-bit floating point format which has the same number of exponent bits as f32, making conversion to/from f32 much faster. This PR would add support for bfloat16 floats to the crate.

I'm not sure if there is interest in adding this to the half crate, but since the code is basically a tweaked version of the f16 code, I thought it made sense to add it to the crate.

I'm also not sure about the names. I just prepended b to f16, consts, slice and vec to get bf16, bconsts, bslice and bvec. It looks fine to me, but maybe it makes more sense to keep bf16 but move the others to bfloat::consts, bfloat::slice and bfloat::vec, I don't know.

@tspiteri tspiteri changed the title Add support for bloat16 Add support for bfloat16 Apr 6, 2019
@starkat99 starkat99 merged commit ee2a217 into starkat99:master Oct 4, 2019
@tspiteri tspiteri deleted the bfloat16 branch October 4, 2019 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants