Re: Misc: Applications of small floating point formats.

Liste des GroupesRevenir à c arch 
Sujet : Re: Misc: Applications of small floating point formats.
De : cr88192 (at) *nospam* gmail.com (BGB)
Groupes : comp.arch
Date : 03. Aug 2024, 22:04:29
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v8m2gj$3jr42$1@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 8/3/2024 4:47 AM, Terje Mathisen wrote:
Lawrence D'Oliveiro wrote:
On Wed, 31 Jul 2024 18:31:35 -0500, BGB wrote:
>
Binary16 is useful for graphics and audio processing.
>
The common format for CG work is OpenEXR, and that allows for 32-bit and
even 64-bit floats, per pixel component. So for example R-G-B-Alpha is 4
components.
>
The 8-bit formats get a bit more niche; main use-cases mostly to save
memory.
>
Heavily used in AI work.
 The nicest property of fp8, as seen from a GPUs point of view, is that arbitrary operations can be seen as texture map lookups. I don't think that's how they are implemented but an 8x8->16 FMUL would only need a few very small lookup tables, probably doable even on a regular CPU with 16-element permute operations.
 
At least for a 3-bit mantissa on FPGA, you can also stick the multiply directly into LUT6 lookups.
The widening FP8*FP8 -> FP16 SIMD multiply was cheap enough to seemingly "disappear in the noise" (can't easily check its LUT cost, as there is no obvious change in LUT cost for the FPGA).
My estimated cost (very crude): would be in the area of around 8 LUTs and 1 or 2 CARRY4's per FP8 operation (with 4 in a SIMD vector). Likely with more LUTs related to signal routing than actually calculating the value.
Would have been higher with a 4-bit mantissa though (core operator would likely need around 18 LUTs and 2 or 3 CARRY4s for the mantissa), with some additional LUTs and CARRY4's for the exponent and to compose the final result. Multiple strategies exist, but this is assuming a strategy of breaking the multiply into 2x2 bit pieces.
Another strategy could be splitting the high 3x3 multiply, and some conditional adders for the low-order results (though, could truncate the low-order results, maybe 8 LUTs and 2 CARRY4's for the mantissa).
Here, one could do a lookup for the LSB of each mantissa multiplied by the high 2 bits of the other, with the lookup table holding the sum of these two partial products. This is then added to the result of the 3x3 lookup.
If the result is intended to be FP8U though (rather than Binary16), could save cost:
One would merely need to ADD or OR the AND of the LSB of each mantissa to the LSB of the result (while ADD is theoretically needed, seemingly in the cases checked with both MSB bits are 1, the output LSB bit is 0, so a CARRY4 may not be needed here).
In software on a CPU, one can do FMUL and FADD (for the full operation) with 64K lookup tables (or 128K if widening to Binary16).

Terje
 

Date Sujet#  Auteur
1 Aug 24 * Misc: Applications of small floating point formats.47BGB
1 Aug 24 +* Re: Misc: Applications of small floating point formats.12MitchAlsup1
1 Aug 24 i+- Re: Misc: Applications of small floating point formats.1BGB
2 Aug 24 i+- Re: Misc: Applications of small floating point formats.1MitchAlsup1
2 Aug 24 i+* Re: Misc: Applications of small floating point formats.2Thomas Koenig
2 Aug 24 ii`- Re: Misc: Applications of small floating point formats.1BGB
3 Aug 24 i`* Re: Misc: Applications of small floating point formats.7Terje Mathisen
3 Aug 24 i +- Re: Misc: Applications of small floating point formats.1BGB
3 Aug 24 i `* Re: Misc: Applications of small floating point formats.5Lawrence D'Oliveiro
5 Aug 24 i  `* Re: Misc: Applications of small floating point formats.4George Neuner
6 Aug 24 i   `* Re: Misc: Applications of small floating point formats.3BGB-Alt
6 Aug 24 i    `* Re: Misc: Applications of small floating point formats.2George Neuner
6 Aug 24 i     `- Re: Misc: Applications of small floating point formats.1BGB
1 Aug 24 `* Re: Misc: Applications of small floating point formats.34Lawrence D'Oliveiro
1 Aug 24  +* Re: Misc: Applications of small floating point formats.31BGB
2 Aug 24  i`* Re: Misc: Applications of small floating point formats.30Lawrence D'Oliveiro
2 Aug 24  i `* Re: Misc: Applications of small floating point formats.29BGB
2 Aug 24  i  `* Re: Misc: Applications of small floating point formats.28Lawrence D'Oliveiro
2 Aug 24  i   `* Re: Misc: Applications of small floating point formats.27BGB
2 Aug 24  i    `* Re: Misc: Applications of small floating point formats.26BGB
2 Aug 24  i     `* Re: Misc: Applications of small floating point formats.25Lawrence D'Oliveiro
2 Aug 24  i      `* Re: Misc: Applications of small floating point formats.24BGB
3 Aug 24  i       `* Re: Misc: Applications of small floating point formats.23Lawrence D'Oliveiro
3 Aug 24  i        +* Re: Misc: Applications of small floating point formats.11Chris M. Thomasson
3 Aug 24  i        i+* Re: Misc: Applications of small floating point formats.7Lawrence D'Oliveiro
3 Aug 24  i        ii`* Re: Misc: Applications of small floating point formats.6BGB
3 Aug 24  i        ii `* Re: Misc: Applications of small floating point formats.5Lawrence D'Oliveiro
3 Aug 24  i        ii  `* Re: Misc: Applications of small floating point formats.4Chris M. Thomasson
3 Aug 24  i        ii   `* Re: Misc: Applications of small floating point formats.3BGB
3 Aug 24  i        ii    `* Re: Misc: Applications of small floating point formats.2Chris M. Thomasson
4 Aug 24  i        ii     `- Re: Misc: Applications of small floating point formats.1Lawrence D'Oliveiro
3 Aug 24  i        i`* Re: Misc: Applications of small floating point formats.3BGB
3 Aug 24  i        i `* Re: Misc: Applications of small floating point formats.2Lawrence D'Oliveiro
3 Aug 24  i        i  `- Re: Misc: Applications of small floating point formats.1BGB
3 Aug 24  i        `* Re: Misc: Applications of small floating point formats.11BGB
3 Aug 24  i         `* Re: Misc: Applications of small floating point formats.10Lawrence D'Oliveiro
3 Aug 24  i          `* Re: Misc: Applications of small floating point formats.9BGB
3 Aug 24  i           `* Re: Misc: Applications of small floating point formats.8Lawrence D'Oliveiro
3 Aug 24  i            `* Re: Misc: Applications of small floating point formats.7Chris M. Thomasson
4 Aug 24  i             `* Re: Misc: Applications of small floating point formats.6Lawrence D'Oliveiro
4 Aug 24  i              `* Re: Misc: Applications of small floating point formats.5Chris M. Thomasson
4 Aug 24  i               `* Re: Misc: Applications of small floating point formats.4BGB
5 Aug 24  i                +* Re: Misc: Applications of small floating point formats.2Chris M. Thomasson
5 Aug 24  i                i`- Re: Misc: Applications of small floating point formats.1Chris M. Thomasson
5 Aug 24  i                `- Re: Misc: Applications of small floating point formats.1Lawrence D'Oliveiro
3 Aug 24  `* Re: Misc: Applications of small floating point formats.2Terje Mathisen
3 Aug 24   `- Re: Misc: Applications of small floating point formats.1BGB

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal