Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch > #33704

Re: floating-point range

From Terje Mathisen <terje.mathisen@tmsw.no>
Newsgroups comp.arch
Subject Re: floating-point range
Date 2016-02-17 11:42 +0100
Organization Aioe.org NNTP Server
Message-ID <na1iqc$do$1@gioia.aioe.org> (permalink)
References <n5n1p5$k1h$1@reader1.panix.com> <60r6cb1gmrr1hgls467t7f2ratnmu2q5th@4ax.com> <h8ecpc-hnr.ln1@sambook.reistad.name> <i8b7cb5nn8ioj863g7b90bljpuq47857sj@4ax.com> <na1frv$usi$1@dont-email.me>

Show all headers | View raw


Nick Maclaren wrote:
> In article <i8b7cb5nn8ioj863g7b90bljpuq47857sj@4ax.com>,
> Robert Wessel  <robertwessel2@yahoo.com> wrote:
>> My point was that intermediate results will often need much larger
>> exponents.  If you prefer, lets compute the volume of the universe
>> instead, and you'll exceed 2**255 if the resolution is a few tens of
>> meters.
>
> Yes.  And it's not just the square, either, because many algorithms
> use much higher order polynomials.  This is also the basis of the
> old rule that the exponent range needs to be at least four times the
> mantissa precision (i.e. to ensure that X^4 doesn't underflow).

This rule means that the smaller fp sizes like fp16 and fp8 really 
should not be used for complicated calculations, only as a storage format.
>
> I have seen programs overflow in IEEE 754 double precision purely
> due to this effect, and that's 11 bits, not 8.

fp16 is normally encoded as 1:5:10, so an 11-bit mantissa and the 
exponent would only cover 0-31, i.e. about 3X.

Using 1:6:9 instead would work according to that rule.

fp8 in 1:3:4 is even worse while 1:4:3 hits the 4X point exactly.

Going even further down does not make too much sense. If you want to 
implement the full ieee754 rule set then you cannot have less than 3 
mantissa bits and the exponent range reserves both endpoints for special 
values so 2 bits is effectively the minimum reasonable value.

The nice thing about fp8 is that you can implement all two-operand fp 
operations as  direct lookups in 64KB (256x256) texture maps, i.e. it 
should be dead simple to implement on a GPU. :-)

Terje

-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Back to comp.arch | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

floating-point range jgk@panix.com (Joe keane) - 2015-12-26 21:45 +0000
  Re: floating-point range MitchAlsup <MitchAlsup@aol.com> - 2015-12-26 18:49 -0800
    Re: floating-point range Quadibloc <jsavard@ecn.ab.ca> - 2015-12-26 20:19 -0800
  Re: floating-point range Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-27 09:53 +0100
    Re: floating-point range Morten Reistad <first@last.name.invalid> - 2016-02-16 18:23 +0100
      Re: floating-point range Robert Wessel <robertwessel2@yahoo.com> - 2016-02-16 12:28 -0600
        Re: floating-point range Robert Wessel <robertwessel2@yahoo.com> - 2016-02-16 12:41 -0600
          Re: floating-point range Morten Reistad <first@last.name.invalid> - 2016-02-16 21:43 +0100
            Re: floating-point range Robert Wessel <robertwessel2@yahoo.com> - 2016-02-16 17:27 -0600
              Re: floating-point range Terje Mathisen <terje.mathisen@tmsw.no> - 2016-02-17 08:35 +0100
              Re: floating-point range nmm@wheeler.UUCP (Nick Maclaren) - 2016-02-17 09:51 +0000
                Re: floating-point range Terje Mathisen <terje.mathisen@tmsw.no> - 2016-02-17 11:42 +0100
                Re: floating-point range nmm@wheeler.UUCP (Nick Maclaren) - 2016-02-17 11:56 +0000
                Re: floating-point range BGB <cr88192@hotmail.com> - 2016-02-17 09:56 -0600
                Re: floating-point range nmm@wheeler.UUCP (Nick Maclaren) - 2016-02-17 16:14 +0000
                Re: floating-point range Terje Mathisen <terje.mathisen@tmsw.no> - 2016-02-18 07:42 +0100
                Re: floating-point range BGB <cr88192@hotmail.com> - 2016-02-18 10:09 -0600
                Re: floating-point range jim.brakefield@ieee.org - 2016-02-18 12:33 -0800
                Re: floating-point range Terje Mathisen <terje.mathisen@tmsw.no> - 2016-02-18 22:08 +0100
                Re: floating-point range BGB <cr88192@hotmail.com> - 2016-02-18 15:45 -0600
                Re: floating-point range MitchAlsup <MitchAlsup@aol.com> - 2016-02-18 16:42 -0800
                Re: floating-point range BGB <cr88192@hotmail.com> - 2016-02-19 08:04 -0600
                Re: floating-point range nmm@wheeler.UUCP (Nick Maclaren) - 2016-02-19 11:55 +0000
                Re: floating-point range BGB <cr88192@hotmail.com> - 2016-02-19 08:24 -0600
                Re: floating-point range MitchAlsup <MitchAlsup@aol.com> - 2016-02-19 07:09 -0800
                Re: floating-point range BGB <cr88192@hotmail.com> - 2016-02-19 10:51 -0600
                Re: floating-point range Terje Mathisen <terje.mathisen@tmsw.no> - 2016-02-19 18:02 +0100
                Re: floating-point range Quadibloc <jsavard@ecn.ab.ca> - 2016-02-19 11:55 -0800
                Re: floating-point range Terje Mathisen <terje.mathisen@tmsw.no> - 2016-02-19 21:14 +0100
                Re: floating-point range MitchAlsup <MitchAlsup@aol.com> - 2016-02-19 16:20 -0800
                Re: floating-point range Terje Mathisen <terje.mathisen@tmsw.no> - 2016-02-20 10:14 +0100
                Re: floating-point range anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-20 12:51 +0000
                Re: floating-point range anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-20 12:30 +0000
                Re: floating-point range paul wallich <pw@panix.com> - 2016-02-19 12:37 -0500
                Re: floating-point range Quadibloc <jsavard@ecn.ab.ca> - 2016-02-19 11:58 -0800
                Re: floating-point range jim.brakefield@ieee.org - 2016-02-19 14:29 -0800
                Re: floating-point range "James Van Buskirk" <not_valid@comcast.net> - 2016-02-17 10:21 -0700
                Re: floating-point range nmm@wheeler.UUCP (Nick Maclaren) - 2016-02-17 17:34 +0000
          Re: floating-point range Quadibloc <jsavard@ecn.ab.ca> - 2016-02-17 11:13 -0800
      Re: floating-point range "wolfgang kern" <nowhere@never.at> - 2016-02-16 19:39 +0100
      Re: floating-point range MitchAlsup <MitchAlsup@aol.com> - 2016-02-16 16:36 -0800
  Re: floating-point range Piotr Wyderski <peter.pan@neverland.mil> - 2016-02-19 11:40 +0100

csiph-web