Re: Making Lemonade (Floating-point format changes)

Liste des GroupesRevenir à c arch 
Sujet : Re: Making Lemonade (Floating-point format changes)
De : terje.mathisen (at) *nospam* tmsw.no (Terje Mathisen)
Groupes : comp.arch
Date : 20. May 2024, 21:17:15
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v2g7js$4vi9$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
User-Agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.18.2
Michael S wrote:
On Mon, 20 May 2024 14:22:00 +0200
Terje Mathisen <terje.mathisen@tmsw.no> wrote:
 
Michael S wrote:
On Mon, 20 May 2024 09:24:16 +0200
Terje Mathisen <terje.mathisen@tmsw.no> wrote:
  
Michael S wrote:
On Sun, 19 May 2024 18:37:51 +0200
Terje Mathisen <terje.mathisen@tmsw.no> wrote:
     
Thomas Koenig wrote:
So, I did some more measurements on the POWER9 machine, and it
came to around 18 cycles per FMA.  Compared to the 13 cycles for
the FMA instruction, this actually sounds reasonable.
>
The big problem appears to be that, in this particular
implementation, multiplication is not pipelined, but done by
piecewise by addition.  This can be explained by the fact that
this is mostly a decimal unit, with the 128-bit QP just added as
an afterthought, and decimal multiplication does not happen all
that often.
>
A fully pipelined FMA unit capable of 128-bit arithmetic would
be an entirely different beast, I would expect a throughput of
1 per cycle and a latency of (maybe) one cycle more than 64-bit
FMA.
The FMA normalizer has to handle a maximally bad cancellation, so
it needs to be around 350 bits wide. Mitch knows of course but
I'm guessing that this could at least be close to needing an
extra cycle on its own and/or heroic hardware?
>
Terje
    
>
Why so wide?
Assuming that subnormal multiplier inputs are normalized before
>
They are not, this is part of what you do to make subnormal numbers
exactly the same speed as normal inputs.
>
Terje
 
>
1. I am not sure that "the same speed" is a worthy goal even for
binary64 (for binary32 it is).
2. It's certainly does not sound like a worthy goal for binary128,
where probability of encountering sub-normal inputs in real user
code, rather than in test vector, is lower than DP by another order
of magnitude,
3. Even if, for reason unclear to me, it is considered the goal, it
can be achieved by introduction of one more pipeline stage
everywhere. Since we are discussing high-latency design akin to
POWER9, the relative cost of another stage would be lower. BTW,
according to POWER9 manual, even for SP/DP FMA the latency is not
constant. It varies from 5 to 7.
>
So, IMHO, what you do to handle sub-normal inputs should depend on
what ends up smaller or faster, not on some abstract principles.
For less important unit, like binary128, 'smaller' would likely take
relative precedence over 'faster'. It's possible that you'll end up
with not doing pre-normalization, but the reason for it would be
different from 'same speed'.
>
Besides, pre-normalization vs wider post-normalization are not the
only available choices. When multiplier is naturally segmented into
57-bit section, there exists, for example, an option of
pre-normalization by full section. It looks very simple on the
front and saves quite a lot of shifter's width on the back.
>
But the best option is probably described in above post by Mitch.
If I understood his post correctly, he suggests to have two
alignment stages: one after multiplication and another one after
add/sub. The shift count for a first stage is calculated from
inputs in parallel with multiplication. The first alignment stage
does not try to achieve a perfect normalizations, but it does
enough for cutting the width of following adder from 3N to 2N+eps.
>
I do agree with Mitch's suggestion: Allow subnormal inputs but do the
partial muls from the top and move the normalization starting point
down for each all-zero input block.
>
In an extreme case (subnormal x subnormal) this would allow you to
discard a lot of partial products.
>
Terje
>
 For subnormal x subnormal you don't need result of multiplication at
all. All you need to know is if it's zero or not and what sign.
Even that is needed only in non-default rounding modes and for inexact
flag in default mode.
Yeah, Mea Culpa! I did correct that particular brain fart a few minutes later in my subsequent post, but it is not possible for the multiplication to produce a result far below the subnormal limit.
As you note, it is only when using RoundToPlus (or Minus) Infinity that an arbitrary small product can still produce a non-zero result.
Terje
--
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Date Sujet#  Auteur
12 May 24 * Making Lemonade (Floating-point format changes)101John Savard
12 May 24 +* Re: Making Lemonade (Floating-point format changes)3wolfgang kern
15 May 24 i`* Re: Making Lemonade (Floating-point format changes)2Michael S
15 May 24 i `- Re: Making Lemonade (Floating-point format changes)1BGB
12 May 24 +* Re: Making Lemonade (Floating-point format changes)6Thomas Koenig
12 May 24 i`* Re: Making Lemonade (Floating-point format changes)5John Savard
12 May 24 i +- Re: Making Lemonade (Floating-point format changes)1John Savard
12 May 24 i `* Re: Making Lemonade (Floating-point format changes)3MitchAlsup1
13 May 24 i  `* Re: Making Lemonade (Floating-point format changes)2John Savard
13 May 24 i   `- Re: Making Lemonade (Floating-point format changes)1BGB
12 May 24 `* Re: Making Lemonade (Floating-point format changes)91John Dallman
12 May 24  `* Re: Making Lemonade (Floating-point format changes)90Thomas Koenig
13 May 24   `* Re: Making Lemonade (Floating-point format changes)89Michael S
13 May 24    +* Re: Making Lemonade (Floating-point format changes)56Thomas Koenig
14 May 24    i`* Re: Making Lemonade (Floating-point format changes)55Michael S
15 May 24    i `* Re: Making Lemonade (Floating-point format changes)54Thomas Koenig
15 May 24    i  `* Re: Making Lemonade (Floating-point format changes)53Michael S
19 May 24    i   `* Re: Making Lemonade (Floating-point format changes)52Thomas Koenig
19 May 24    i    +* Re: Making Lemonade (Floating-point format changes)3Michael S
19 May 24    i    i+- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
20 May 24    i    i`- Re: Making Lemonade (Floating-point format changes)1Thomas Koenig
19 May 24    i    `* Re: Making Lemonade (Floating-point format changes)48Terje Mathisen
19 May 24    i     +* Re: Making Lemonade (Floating-point format changes)40Michael S
19 May 24    i     i+- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
20 May 24    i     i+* Re: Making Lemonade (Floating-point format changes)30Terje Mathisen
20 May 24    i     ii`* Re: Making Lemonade (Floating-point format changes)29Michael S
20 May 24    i     ii `* Re: Making Lemonade (Floating-point format changes)28Terje Mathisen
20 May 24    i     ii  `* Re: Making Lemonade (Floating-point format changes)27Michael S
20 May 24    i     ii   +* Re: Making Lemonade (Floating-point format changes)19BGB
20 May 24    i     ii   i`* Re: Making Lemonade (Floating-point format changes)18MitchAlsup1
20 May 24    i     ii   i +- Re: Making Lemonade (Floating-point format changes)1Chris M. Thomasson
20 May 24    i     ii   i +- Re: Making Lemonade (Floating-point format changes)1Thomas Koenig
21 May 24    i     ii   i `* Re: Making Lemonade (Floating-point format changes)15BGB
21 May 24    i     ii   i  +* Re: Making Lemonade (Floating-point format changes)12Thomas Koenig
21 May 24    i     ii   i  i+* Re: Making Lemonade (Floating-point format changes)7Michael S
21 May 24    i     ii   i  ii+* Re: Making Lemonade (Floating-point format changes)5Terje Mathisen
21 May 24    i     ii   i  iii+- Re: Making Lemonade (Floating-point format changes)1Michael S
21 May 24    i     ii   i  iii`* Re: Making Lemonade (Floating-point format changes)3BGB
22 May 24    i     ii   i  iii `* Re: Making Lemonade (Floating-point format changes)2MitchAlsup1
22 May 24    i     ii   i  iii  `- Re: Making Lemonade (Floating-point format changes)1BGB-Alt
21 May 24    i     ii   i  ii`- Re: Making Lemonade (Floating-point format changes)1Thomas Koenig
21 May 24    i     ii   i  i`* Re: Making Lemonade (Floating-point format changes)4BGB
21 May 24    i     ii   i  i `* Re: Making Lemonade (Floating-point format changes)3MitchAlsup1
21 May 24    i     ii   i  i  +- Re: Making Lemonade (Floating-point format changes)1BGB
22 May 24    i     ii   i  i  `- Re: Making Lemonade (Floating-point format changes)1Terje Mathisen
21 May 24    i     ii   i  `* Re: Making Lemonade (Floating-point format changes)2MitchAlsup1
21 May 24    i     ii   i   `- Re: Making Lemonade (Floating-point format changes)1BGB
20 May 24    i     ii   `* Re: Making Lemonade (Floating-point format changes)7Terje Mathisen
21 May 24    i     ii    `* Re: Making Lemonade (Floating-point format changes)6Michael S
21 May 24    i     ii     `* Re: Making Lemonade (Floating-point format changes)5MitchAlsup1
21 May 24    i     ii      +* Re: Making Lemonade (Floating-point format changes)2Stefan Monnier
22 May 24    i     ii      i`- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
22 May 24    i     ii      +- Re: Making Lemonade (Floating-point format changes)1Terje Mathisen
22 May 24    i     ii      `- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
20 May 24    i     i`* binary128 implementation (was: Making Lemonade (Floating-point format changes)8Anton Ertl
20 May 24    i     i `* Re: binary128 implementation7Terje Mathisen
23 May 24    i     i  `* Re: binary128 implementation6BGB-Alt
23 May 24    i     i   `* Re: binary128 implementation5MitchAlsup1
24 May 24    i     i    `* Re: binary128 implementation4Terje Mathisen
24 May 24    i     i     `* Re: binary128 implementation3BGB-Alt
25 May 24    i     i      `* Re: binary128 implementation2MitchAlsup1
25 May 24    i     i       `- Re: binary128 implementation1BGB
19 May 24    i     +* Re: Making Lemonade (Floating-point format changes)6BGB
19 May 24    i     i`* Re: Making Lemonade (Floating-point format changes)5MitchAlsup1
20 May 24    i     i `* Re: Making Lemonade (Floating-point format changes)4BGB
20 May 24    i     i  `* Re: Making Lemonade (Floating-point format changes)3MitchAlsup1
20 May 24    i     i   `* Re: Making Lemonade (Floating-point format changes)2BGB
20 May 24    i     i    `- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
19 May 24    i     `- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
13 May 24    `* Re: Making Lemonade (Floating-point format changes)32BGB
13 May 24     `* Re: Making Lemonade (Floating-point format changes)31MitchAlsup1
14 May 24      +* Re: Making Lemonade (Floating-point format changes)22BGB
14 May 24      i`* Re: Making Lemonade (Floating-point format changes)21MitchAlsup1
14 May 24      i `* Re: Making Lemonade (Floating-point format changes)20BGB
14 May 24      i  `* Re: Making Lemonade (Floating-point format changes)19MitchAlsup1
14 May 24      i   +* Re: Making Lemonade (Floating-point format changes)2Michael S
15 May 24      i   i`- Re: Making Lemonade (Floating-point format changes)1Michael S
14 May 24      i   +- Re: Making Lemonade (Floating-point format changes)1BGB
16 May 24      i   `* Re: Making Lemonade (Floating-point format changes)15MitchAlsup1
17 May 24      i    `* Re: Making Lemonade (Floating-point format changes)14MitchAlsup1
17 May 24      i     +* Re: Making Lemonade (Floating-point format changes)2MitchAlsup1
18 May 24      i     i`- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
18 May 24      i     `* Re: Making Lemonade (Floating-point format changes)11Chris M. Thomasson
19 May 24      i      `* Re: Making Lemonade (Floating-point format changes)10Chris M. Thomasson
19 May 24      i       `* Re: Making Lemonade (Floating-point format changes)9Chris M. Thomasson
19 May 24      i        `* Re: Making Lemonade (Floating-point format changes)8Chris M. Thomasson
20 May 24      i         `* Re: Making Lemonade (Floating-point format changes)7Chris M. Thomasson
20 May 24      i          `* Re: Making Lemonade (Floating-point format changes)6Chris M. Thomasson
20 May 24      i           `* Re: Making Lemonade (Floating-point format changes)5Chris M. Thomasson
24 May 24      i            `* Re: Making Lemonade (Floating-point format changes)4Chris M. Thomasson
26 May 24      i             `* Re: Making Lemonade (Floating-point format changes)3George Neuner
27 May 24      i              +- Re: Making Lemonade (Floating-point format changes)1Chris M. Thomasson
1 Jun 24      i              `- Re: Making Lemonade (Floating-point format changes)1Chris M. Thomasson
14 May 24      +* Re: Making Lemonade (Floating-point format changes)4Anton Ertl
14 May 24      i`* Re: Making Lemonade (Floating-point format changes)3MitchAlsup1
14 May 24      i +- Re: Making Lemonade (Floating-point format changes)1MitchAlsup1
14 May 24      i `- Re: Making Lemonade (Floating-point format changes)1BGB
10 Jun 24      `* Re: Making Lemonade (Floating-point format changes)4Lawrence D'Oliveiro
10 Jun 24       `* Re: Making Lemonade (Floating-point format changes)3Terje Mathisen
10 Jun 24        `* Re: Making Lemonade (Floating-point format changes)2Niklas Holsti
11 Jun 24         `- Re: Making Lemonade (Floating-point format changes)1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal