[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clause 10, Expression Evaluation



The claim is that an optimal implementation  
of non-deterministic FLOATING POINT semantics will provide  
significant performance gains on APPROPRIATE code, compared with an  
optimal implementation of deterministic floating point. Several  
people, including Malcolm, have provided detailed arguments as to why  
this should be true. They have also argued that experience has not  
only validated this argument,but indicated that the gains are often  
significant.

There are actually two possible 
meanings for non-deterministic that are relevant here:
reproducible on one platform but not reproducible across platforms 
(call this non-reproducible), 
and not reproducible on the same platform with the same executable
(call this non-deterministic - usually occurs in conjunction with
parallelism).     Both forms offer performance
advantages and debugging challenges.

I for one can't imagine disputing these statements as they are consistent
with my experience.    The argument I propose is one analogous to
the following:

1. For programs whose performance is dominated by floating-point arithmetic,
binary floating-point arithmetic is always faster and more accurate
than decimal floating-point arithmetic, other things being equal.

2. The total life-cycle economic
cost of the vast majority of programs and programmers is dominated
by development and debug time rather than execution time.

3. In contrast, the total life-cycle economic cost of the MOST IMPORTANT
floating-point programs is dominated by execution time, but these programs
represent a tiny minority of programs and programmers.

4. So 754R should specify both binary and decimal floating-point arithmetic
since both are important in different senses and contexts.


Substituting "reproducible" or "deterministic" for decimal, 
and "non-reproducible" or "non-deterministic" for binary,
the arguments are the same but even stronger:   the debug cost is greater,
but the performance impact is greater for non-reproducible vs
reproducible arithmetic, compared to binary vs decimal arithmetic.

A program that evolves toward high performance might start out being coded
in reproducible deterministic decimal sequential fashion, 
and when the basic logic
is correct in that scheme, the elements of parallelism, binary arithmetic,
non-reproducible arithmetic, and non-deterministic arithmetic 
get added back in, if and when the economic benefits justify the increasing
coding and debugging efforts.     At the higher levels one is often 
debugging the hardware, operating system, compilers, and libraries, as well
as one's own source code, which is part of the increasing effort and expense.

Unfortunately there are interactions between algorithm design and 
decisions about parallelism and non-determinism so these steps aren't as
orthogonal as one would like.

"Better programming languages" and "better hardware architectures" to match
them are part of the long-term solution, but in the meantime, 754R can do
its little bit to encourage languages to encourage compilers to make things
easier on a shorter time scale.

754 | revision | FAQ | references | list archive