bug#68871: Can't use od to print half-precision floats

2024-02-05 Thread Pádraig Brady
On 04/02/2024 21:59, Paul Eggert wrote: Thanks. One minor comment about this: +@item B +brain 16 bit float +@item H +half precision float It might be helpful explain these two formats, e.g., to cite: https://en.wikipedia.org/wiki/Bfloat16_floating-point_format and

bug#68871: Can't use od to print half-precision floats

2024-02-04 Thread Paul Eggert
Thanks. One minor comment about this: +@item B +brain 16 bit float +@item H +half precision float It might be helpful explain these two formats, e.g., to cite: https://en.wikipedia.org/wiki/Bfloat16_floating-point_format and

bug#68871: Can't use od to print half-precision floats

2024-02-04 Thread Pádraig Brady
On 02/02/2024 01:47, Paul Eggert wrote: On 2/1/24 13:59, Pádraig Brady wrote: bfloat16 looks like a truncated single precision IEEE, so we should be able to just pad the extra 16 bits with zeros when converting to single precision internally for processing. Sounds good. This would mean od

bug#68871: Can't use od to print half-precision floats

2024-02-02 Thread Rozenberg, Eyal (Consultant)
-Original Message- From: Paul Eggert Sent: Friday, 2 February 2024 3:47 To: Pádraig Brady ; Rozenberg, Eyal (Consultant) ; 68...@debbugs.gnu.org Subject: Re: bug#68871: Can't use od to print half-precision floats WARNING: This email originated from outside of GE HealthCare. Please validate

bug#68871: Can't use od to print half-precision floats

2024-02-01 Thread Paul Eggert
On 2/1/24 13:59, Pádraig Brady wrote: bfloat16 looks like a truncated single precision IEEE, so we should be able to just pad the extra 16 bits with zeros when converting to single precision internally for processing. Sounds good. This would mean od could work even the platform doesn't

bug#68871: Can't use od to print half-precision floats

2024-02-01 Thread Pádraig Brady
On 01/02/2024 19:16, Paul Eggert wrote: Oh, and another thought: suppose someone wants to use od on bfloat16_t values? They're popular in machine learning applications, and likely will be more popular than float16_t overall. See:

bug#68871: Can't use od to print half-precision floats

2024-02-01 Thread Paul Eggert
Oh, and another thought: suppose someone wants to use od on bfloat16_t values? They're popular in machine learning applications, and likely will be more popular than float16_t overall. See: https://sourceware.org/pipermail/libc-alpha/2024-February/154382.html

bug#68871: Can't use od to print half-precision floats

2024-02-01 Thread Paul Eggert
Thanks for writing that. One suggestion I'd make is to change this: #ifndef FLT16_MAX /* This is just a place-holder to avoid a few '#if' directives. In this case, the type isn't actually used. */ typedef float _Float16; #endif to something like this: #ifdef FLT16_MAX typedef

bug#68871: Can't use od to print half-precision floats

2024-02-01 Thread Pádraig Brady
On 01/02/2024 12:43, Rozenberg, Eyal (Consultant) wrote: If I try to use the od utility to print half-precision (FP16) floating-point values, I get: $ od -t f2 myfloats.bin od: invalid type string 'f2'; this system doesn't provide a 2-byte floating point type I'm not exactly sure what "this

bug#68871: Can't use od to print half-precision floats

2024-02-01 Thread Rozenberg, Eyal (Consultant)
If I try to use the od utility to print half-precision (FP16) floating-point values, I get: $ od -t f2 myfloats.bin od: invalid type string 'f2'; this system doesn't provide a 2-byte floating point type I'm not exactly sure what "this system" means, but that should work and print out my