Numerical reproducibility issues in floating-point arithmetic Numerical reproducibility issues in interval arithmetic Conclusions Numerical reproducibility of high-performance computations using floating-point or interval arithmetic Nathalie Revol and Philippe Th´ eveny INRIA and ENS de Lyon LIP (UMR 5668 CNRS - ENS de Lyon - INRIA - UCBL) - ENS de Lyon University of Lyon ICERM workshop “Challenges in 21st Century Experimental Mathematical Computation” 21-25 July 2014 Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Numerical reproducibility issues in interval arithmetic Conclusions Interval arithmetic: MPFI, IEEE P1788 MPFI: library for interval arithmetic in arbitrary precision based on MPFR: floating-point arithmetic in arbitrary precision library in C available from http://gforge.inria.fr/projects/mpfi/ Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Numerical reproducibility issues in interval arithmetic Conclusions Interval arithmetic: MPFI, IEEE P1788 MPFI: library for interval arithmetic in arbitrary precision based on MPFR: floating-point arithmetic in arbitrary precision library in C available from http://gforge.inria.fr/projects/mpfi/ IEEE P1788: standardization of interval arithmetic launched in 2008 end: December 2014. . . or a few months afterwards. Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Numerical reproducibility issues in interval arithmetic Conclusions Interval arithmetic: implementation issues My current effort: promote the use of interval arithmetic or some variants: Taylor models, affine arithmetic, through the development and implementation of methods that are not too slow compared to floating-point ones. Goal: slowdown factor less than 10. Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Numerical reproducibility issues in interval arithmetic Conclusions Interval arithmetic: implementation issues My current effort: promote the use of interval arithmetic or some variants: Taylor models, affine arithmetic, through the development and implementation of methods that are not too slow compared to floating-point ones. Goal: slowdown factor less than 10. Interval matrix multiplication: slowdown factor less than 3. Interval linear system solving: slowdown factor around 15. Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Numerical reproducibility issues in interval arithmetic Conclusions Interval arithmetic: implementation issues My current effort: promote the use of interval arithmetic or some variants: Taylor models, affine arithmetic, through the development and implementation of methods that are not too slow compared to floating-point ones. Goal: slowdown factor less than 10. Interval matrix multiplication: slowdown factor less than 3. Interval linear system solving: slowdown factor around 15. Idea to gain performance (execution time): use optimized floating-point routines, such as BLAS. Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Numerical reproducibility issues in interval arithmetic Conclusions Interval arithmetic: implementation issues My current effort: promote the use of interval arithmetic or some variants: Taylor models, affine arithmetic, through the development and implementation of methods that are not too slow compared to floating-point ones. Goal: slowdown factor less than 10. Interval matrix multiplication: slowdown factor less than 3. Interval linear system solving: slowdown factor around 15. Idea to gain performance (execution time): use optimized floating-point routines, such as BLAS. Disappointment due to the lack of numerical reproducibility. Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Numerical reproducibility issues in interval arithmetic Conclusions No numerical reproducibility (Diethelm 2012) Max = 8.96 Max = 9.54 (a) (b) Figure 4. Location of the computed maxima of the sheet thickness change. (a) The simulation with one processor. (b) The second run of the simulation with four processors. The darker the element is colored, the larger the corresponding sheet-thickness change. Elements colored in white have a sheet thickness change of less than 8.5 percent. Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Numerical reproducibility issues in interval arithmetic Conclusions No numerical reproducibility (He and Ding 2001) Results of the summation in different natural orders with different Table 1. methods in double precision Order Result Longitude first 34.414768218994141 Reverse longitude first 32.302734375 Latitude first 0.67326545715332031 Reverse latitude first 0.734375 Longitude first SCS 0.3823695182800293 Longitude first DCS 0.3882288932800293 Latitude first SCS 0.37443733215332031 Latitude first DCS 0.32560920715332031 Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Numerical reproducibility issues in interval arithmetic Conclusions Agenda Numerical reproducibility issues in floating-point arithmetic Why? Example and solutions for the summation Numerical reproducibility Numerical reproducibility issues in interval arithmetic Need of reproducibility Computing precision Order of the operations Rounding modes HPC issues Conclusions Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Why? Numerical reproducibility issues in interval arithmetic Example and solutions for the summation Conclusions Numerical reproducibility Agenda Numerical reproducibility issues in floating-point arithmetic Why? Example and solutions for the summation Numerical reproducibility Numerical reproducibility issues in interval arithmetic Need of reproducibility Computing precision Order of the operations Rounding modes HPC issues Conclusions Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Why? Numerical reproducibility issues in interval arithmetic Example and solutions for the summation Conclusions Numerical reproducibility Handbook of Floating-point Arithmetic (Muller et al. 2010, Chapter 7 – F. de Dinechin 2013) Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Why? Numerical reproducibility issues in interval arithmetic Example and solutions for the summation Conclusions Numerical reproducibility No numerical reproducibility: why? Consider the following program, whatever the language float a,b,c,d,x; x = a+b+c+d; Two questions: ◮ What precision will be used for the intermediate results? ◮ In which order will the three additions be executed? Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Why? Numerical reproducibility issues in interval arithmetic Example and solutions for the summation Conclusions Numerical reproducibility No numerical reproducibility: why? Consider the following program, whatever the language float a,b,c,d,x; x = a+b+c+d; Two questions: ◮ What precision will be used for the intermediate results? ◮ In which order will the three additions be executed? Here we should remind that FP addition is not associative: consider 1 + 2 100 − 2 100 . Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Why? Numerical reproducibility issues in interval arithmetic Example and solutions for the summation Conclusions Numerical reproducibility No numerical reproducibility: why? Consider the following program, whatever the language float a,b,c,d,x; x = a+b+c+d; Two questions: ◮ What precision will be used for the intermediate results? ◮ In which order will the three additions be executed? Here we should remind that FP addition is not associative: consider 1 + 2 100 − 2 100 . Fortran, C and Java have completely different answers. Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Numerical reproducibility issues in floating-point arithmetic Why? Numerical reproducibility issues in interval arithmetic Example and solutions for the summation Conclusions Numerical reproducibility No numerical reproducibility: change of precision float a,b,c,d,x; x = a+b+c+d; Two questions: ◮ What precision will be used for the intermediate results? ◮ Bottom up precision: (here all float) ◮ Use the maximum precision available which is no slower ◮ Is the precision fixed by the language, or is the compiler free to choose? ◮ In which order will the three additions be executed? Nathalie Revol and Philippe Th´ eveny Numerical reproducibility issues
Recommend
More recommend