-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[C++] vendor a half precision floating point library #22806
Comments
Antoine Pitrou / @pitrou: There may be other projects around. |
Antoine Pitrou / @pitrou:
|
Antoine Pitrou / @pitrou: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=half-precision https://en.wikipedia.org/wiki/F16C
|
I've looked at some libraries to see what is usually used:
Half seems pretty complete so I think it or FP16 would make good candidates. |
Both look rather unmaintained. We could decide to maintain a fork in the source tree, but this would need assessing their technical quality as well. Something as simple as https://github.com/Maratyszcza/FP16/blob/0a92994d729ff76a58f692d3028ca1b64b145d91/include/fp16/bitcasts.h#L30-L34 is undefined behaviour:
|
I think if available software implementations are unsatisfactory, it'd be preferable to write a very minimal version of our own and handle any operations by first converting to 32 bit float. This should be sufficient since we'd be able to use a native type most of the time. In that case, we'd only need to maintain:
|
If the HW-based conversions are available on all major CPUs (and compilers!), and they are fast enough, then I guess it's a sufficient approach. |
Some interesting details discussed here: |
Thanks for the heads up @adamreeve . Yes, you're right, this can be closed now! |
Clang and GCC provide _Float16 and there are numerous polyfills which can emulate a 16 bit float for other platforms. This would fill a hole in the kernels and other code which don't currently support HALF_FLOAT.
Reporter: Ben Kietzman / @bkietz
Watchers: Rok Mihevc / @rok
Related issues:
Note: This issue was originally created as ARROW-6436. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: