Floating point computing has dominated scientific computations since the 1950s because of its versatile ability to approximate real numbers with both sufficiently high precision and sufficiently great range. Since…

64 points•matt_d•5 days ago•22 comments•

22 comments

Lercabout 5 hours ago
With fp4 you only have 16 values, if you define it to be symmetric by sign you only have 8 absolute values.

That seems like a low enough size that you could measure the effectiveness of any set of 8 values across a wide variety of neural net tasks. I would think that it could be possible to do a search for the optimal generally useful 4-bit representation.

Would the ideal values fall on a simple function? would they seem randomly spaced?

nivterabout 5 hours ago
NVFP4 and MXFP4 actually have block scaling to adapt to a wide range of values. NVFP4 has an additional tensor scale.
gregatesabout 9 hours ago
I learned recently that Excel rounds numbers (which it stores as IEEE 754 binary64) as though they were 80-bit extended precision, a la x87. It seems the "we don't actually need that much precision" trend has been going for a long time.
pornelabout 1 hour ago
This sounds like a backwards compat solution. Microsoft probably didn't want customers freaking out that their spreadsheets show slightly different numbers on different platforms.
TeMPOraLabout 6 hours ago
Definitely has been.

One of the biggest mystery for me in terms of computing is precisely the proliferation of floating point numbers. We spent almost half a year of numerical methods classes dealing with floating points numbers, at it never sit right with me, precisely because it was serious science.

The way I think computing should have evolved, given their history in scientific and military applications:

1. Starting with arbitrary precision formats

2. Noticing it's sometimes too slow

3. Developing IEEE-754 and surrounding set of maths as principled hacks to speed up key computations.

What reality seems to look like:

1. Limited precision calculations are the default.

2. There is a side branch of CS developing principled ways of dealing with it, and you hope hope hope at least some scientists are aware of that, instead of just using floats and thinking computers are always right.

3. Everyone assumes this is how things should be, and the only somewhat known exception is finance, specifically "don't use floats to add moneys".

WTF.

Someoneabout 5 hours ago
> The way I think computing should have evolved, given their history in scientific and military applications:

> 1. Starting with arbitrary precision formats

> 2. Noticing it's sometimes too slow

And always too costly. Both were so bloody obvious that they didn’t consider 1 at all.

> What reality seems to look like:

> 1. Limited precision calculations are the default

Historically, fixed precision integer calculations with implied decimal points were the default.

Von Neumann, in 1946 (https://www.arithmazium.org/library/lib/wk_floating_point_hi...):

“Several of the digital computers being planned or built in this country or in England are to contain a so-called floating decimal point.' ... There appear to be two major purposes in a 'floating' decimal point system both of which arise from the fact that the number of digits in a word is constant, fixed by design considerations for each particular machine. The first of these purposes is to retain in a sum or product as many significant digits as possible and the second of these is to free the human operator from the burden of estimating and inserting into a problem 'scale factors' multiplication constants which serve to keep numbers within the limits of the machine.

There is, of course, no denying the fact that human time is consumed in arranging for the introduction of suitable scale factors. We only argue that the time consumed is a very small percentage of the total time we will spend in preparing an interesting problem for our machine. The first advantage of the floating point is, we feel, somewhat illusory. In order to have such a floating point one must waste memory capacity which could otherwise be used for carrying more digits per word. It would therefore seem to us not at all clear whether the modest advantages of a floating binary point offset the loss of memory capacity and the increased complexity of the arithmetic and control circuits”

(Historically, the idea of fixed-point floats go back centuries, to the first mechanical calculators and the slide rule)

shaknaabout 5 hours ago
> and the only somewhat known exception is finance, specifically "don't use floats to add moneys".

Even that one is mostly a myth. A whole heap of investment-oriented things just round to the nearest cent and use floats anyway.

lmzabout 6 hours ago
Arbitrary precision was not a thing before computers. Why would the first computers default to that given how expensive memory was?
topspinabout 4 hours ago
> given their history in scientific and military applications

Ah, but there is the answer to the mystery. This history is dominated by the successes of processing elements that have been pressed to their absolute limits continuously, from the first day till today. At no point in that history have the most ambitious new applications had the luxury of foregoing the essential performance benefits of suffering imprecision: the ambitions of new applications invariably require whatever performance can be had. This self-evidently explains why there has not been a time in which these techniques have been reconsidered: the focus is always whatever is now just plausibly possible with whatever new performance frontier we are provided, and so these techniques win yet more battles.

It is possible to find this disappointing, and perhaps even cynical: there is no force to restrain the chronic habit of compromising precision for the sake of some application, as long as it yields useful results. I can understand that, but I recommend not indulging the fantasy of some hypothetical world where this will not happen.

What I find interesting is this question: What ugly truth about the universe do we miss by failing to recognize and appreciate whatever this pattern is telling us?

buildbotabout 1 hour ago
This is a fun coincidence to see here.

I was hoping this would talk more about the intuition behind the creation of the actual formats… And a bit more of the history.

nivterabout 5 hours ago
Since FP precisions and bits is getting some attention today, I just whipped up a floating point bit explorer tool: https://www.linearalgebraforprogrammers.com/tools/floating_p...
carraabout 10 hours ago
I do wonder if we will be getting specialized hardware support for these, aimed at running quantized models. You could fit many FP8 or FP4 units in the same die space as a single FP32 one. Even more if you remove capabilities other than strictly needed (mainly addition and multiplication).
gr_normabout 9 hours ago
NVFP4 seems like what you're after. It's a hardware supported datatype purpose-built for running quantized models. Inkling 2 mini uses it.
nivterabout 5 hours ago
And MXFP4 for non-CUDA devices like ROCm.
buildbotabout 2 hours ago
Plenty of hardware now supports the microscaled FP4 and FP8 types - for example Blackwell GPUs.

Read the full thread on Hacker News →

Related stories