Re: [eigen] RFC: making a deterministic and reproducable product codepath with Eigen |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Dar Christoph,
Am 08.09.2016 um 19:06 schrieb Christoph Hertzberg:
On 2016-09-06 16:09, Peter wrote:
It's beyond my knowledge, whether scalar products will always be
scheduled in the same way on the FPUs by the hardware,
especially if the scalar product appears after an if-statement.
I'm just sceptical, but maybe I just got surprised too often.
I would be very surprised, if a CPU would give different results for the very same machine instructions (given the same inputs and FPU-configuration, of course), solely based on internal scheduling.
In case you are interested, there's e.g. HP's Dynamo project, <http://www.hpl.hp.com/techreports/1999/HPL-1999-77.html>,
which messes around with binaries. And for scalar products, it's sufficient to change the order of evaluation,
to loose bit-wise accuracy, eg. the scalar product of ( 1, 1e-50, 1) with ( 1, 1, -1 ) is a simple example.
I'm just not sure how far the processors mess around.
For the given use-case, I guess the simplest solution would be to hand-craft a simple library with naive but stable implementations.
I agree, using a F77 BLAS should be sufficient. Although I still don't understand what one learns from bypassing all optimizations.
If correctness is important one should switch to exact scalar product, like in C-XSC,
which removes the dependence on the order of evaluation and just _has_ to provide the same result everywhere.
BTW, exact scalar products could be an interesting extension to Eigen in some future version,
opening the door to verified computing.
Best regards,
Peter