Thread Links | Date Links | ||||
---|---|---|---|---|---|
Thread Prev | Thread Next | Thread Index | Date Prev | Date Next | Date Index |
I would like all implementations to have a mode in which they provide as much reproducibility as possible. I would also like reasonable efficiency. In some cases, where the dragons live, those conflict.
If we allow non-IEEE 754-2008 implementations, then exact reproducibility is impractical. Even implementations fully conforming to IEEE 754-2008 cannot always produce identical results.
One example I've read about is how one handles numbers very close to zero. 754 doesn't specify exactly when rounding takes place, because different architectures implement it differently. If the result is between zero and the smallest nonzero positive number, some implementations make it zero before rounding, while others round first and depending on the exact value and the rounding mode may make it zero or may make it the smallest nonzero positive number.
To guarantee exact reproducibility, 1788 would have to specify which of the two 754 options must be followed, and those who don't follow it would have to check after every arithmetic operation whether they need to correct the answer. You may not care if a lower bound becomes such a tiny amount lower or if an upper bound becomes slightly higher, but if it's the other way around it might be more important. In any case it is impractical for all 754 systems to be fully reproducible for these values.
This is separate from systems with a "flush subnormals to zero" approach or option, which is not 754-compliant.
I wouldn't support requiring "exact reproducibility" because in some cases it's impractical.
I would support requiring languages and implementations to be able to (ie, either always or under an option or pragma or mode) provide as much reproducibility as the underlying floating point system (hardware + microcode + software) is capable of. I would even allow result variance caused by different kinds of intervals (eg Kaucher or not) or by different representations (lower and upper bounds versus mean and radius).
I don't object to optional modes that are either more precise or faster or both (or even slower and less precise), as long as there is a way of getting "essentially reproducible" results. That might include writing the code in a particular way, suppressing all optimizations and using special options and it needn't be the default, but should be available to claim compliance. Of course one could implement an almost-1788 IA or non-1788 IA, just as some implement almost-754 FP or non-754 FP.
Some languages do specify partial reproducibility; eg, Fortran requires evaluating partial expressions inside parentheses before combining them with what's outside - A+(B+C) must be evaluated as B+C before adding A, and C has a pragma to control whether expressions can be combined. These or similar approaches plus avoiding optimization should support 1788 "essentially reproducible" execution.
- Ian McIntosh IBM Canada Lab Compiler Back End Support and Development
"N.M. Maclaren" ---12/06/2012 10:00:59 AM---On Dec 6 2012, Vincent Lefevre wrote: I started to respond to each point, but don't think that it wo
| "N.M. Maclaren" <nmm1@xxxxxxxxx> |
| Ian McIntosh/Toronto/IBM@IBMCA |
| 12/06/2012 10:00 AM |
| Re: Mixing reproducible and non-reproducible code |