[docs] Clarify that Float16 is supported natively when possible#57725
[docs] Clarify that Float16 is supported natively when possible#57725
Conversation
|
|
||
| Half-precision floating-point numbers are also supported ([`Float16`](@ref)), but they are | ||
| implemented in software and use [`Float32`](@ref) for calculations. | ||
| Half-precision floating-point numbers are also supported ([`Float16`](@ref)) on all platforms, with native instructions used on hardware which supports this number format, otherwise operations are implemented in software and use [`Float32`](@ref) for intermediate calculations. |
There was a problem hiding this comment.
Maybe point out that this equivalent to gcc -fexcess-precision=ieee
There was a problem hiding this comment.
I presume you meant -fexcess-precision=standard?
There was a problem hiding this comment.
I think we actually implement -fexcess-precision=16 https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fexcess-precision
There was a problem hiding this comment.
On x86 targets with SSE2 enabled, without -mavx512fp16, all operations will be emulated by software emulation and the float instructions. The default behavior for FLT_EVAL_METHOD is to keep the intermediate result of the operation as 32-bit precision. This may lead to inconsistent behavior between software emulation and AVX512-FP16 instructions. Using -fexcess-precision=16 will force round back after each operation.
Yeah we force round back after each operation.
There was a problem hiding this comment.
We techically just do the LLVM default nowadays, the demote float16 pass is basically unused since #55486
There was a problem hiding this comment.
Ok, I tried to incorporate both comments above, explaining this is an implementation detail (but I think some non-Julia people reading the manual may be interested in knowing it)
|
LGTM |
Co-authored-by: Jishnu Bhattacharya <jishnub.github@gmail.com>
Co-authored-by: Jishnu Bhattacharya <jishnub.github@gmail.com> (cherry picked from commit 3e57a8a)
Co-authored-by: Jishnu Bhattacharya <jishnub.github@gmail.com> (cherry picked from commit 3e57a8a)
Co-authored-by: Jishnu Bhattacharya <jishnub.github@gmail.com> (cherry picked from commit 3e57a8a)
Co-authored-by: Jishnu Bhattacharya <jishnub.github@gmail.com> (cherry picked from commit 3e57a8a)
Co-authored-by: Jishnu Bhattacharya <jishnub.github@gmail.com> (cherry picked from commit 3e57a8a)
Co-authored-by: Jishnu Bhattacharya <jishnub.github@gmail.com> (cherry picked from commit 3e57a8a)
Pointed out in casangi/xradio#304 (comment)