Gerd Bohlender Universität Karlsruhe, Germany

35
Verification of Results in Scientific Computing Gerd Bohlender Universität Karlsruhe, Germany

Transcript of Gerd Bohlender Universität Karlsruhe, Germany

Verification of Results in Scientific Computing

Gerd BohlenderUniversität Karlsruhe, Germany

Karlsruhe Institute of Technology KIT

● Former situation:–Universität Karlsruhe with 11 faculties and about

4500 employees, 16000 students (State of Baden-Württemberg)– Forschungszentrum Karlsruhe with about 3800

employees (Federal Republic of Germany)● October 1, 2009:– Installation of Karlsruhe Institute of Technology

KIT, fusion of these two organizations, more than 9000 employees

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 2

What is Scientific Computing?

● Solving big simulation problems using floating-point arithmetic on very powerful computers (Parallel computers, vector processors,...)

● Typical applications in fluid dynamics, weather forecast, 3D modelling in engineering, virtual crash test, digital prototyping (car design), wind tunnel simulation, theoretical physics and chemistry, astrophysics/general relativity, ...

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 3

Supercomputers at Universität Karlsruhe, September 2009

HP XC6000 (11 Tflop/s)HP XC4000 (16 TFlop/s)

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 4

Top 500 List of Supercomputers

1.Roadrunner, IBM Xcell/Opteron, 1.1 Petaflop/s (=1.1 million Gigaflop/s), Los Alamos Nat. Lab., DOE

2.Jaguar, Cray XT5, 1.05 Petaflop/s, Oak Ridge Nat. Lab., DOE

3.Jugene, IBM Blue Gene, 0.8 Petaflop/s, Jülich/Germany

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 5

What does “Petaflop/s” mean?

● Imagine that you print all computed numbers on paper

● Use a small font, print on both sides of paper● Question: How big will be the amount of paper

printed in 4 seconds, how many files do you need?

4 Petaflop

How much space needed?

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 6

?

What does “Petaflop/s” mean?

Answer: 4 seconds = 400000 kilometres of files! Distance from Earth to Moon!

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 7

Just some questions...

● Who can check these results?● How reliable are these results?

● Manual checking is absolutely impossible● Evidently, tools are needed in the computer for

this purpose

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 8

Just some questions...

● But, can results of a floating-point computation be really wrong?

● We know that most of the time, floating-point results are quite acceptable

● Isn't the rounding error just a few units of the last place, so we don't need to worry?

● Are there examples where floating-point goes noticeably wrong?

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 9

Example 1: sum of 3 numbers

● Compute 1 + 1050 – 1050 ● In single / double / extended precision floating-

point, the result is always 0● The correct result is 1

● This problem is trivial and it can be easily fixed by changing the sequence of operations

● But other examples are not so evident and more difficult to handle

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 10

Example 2: value of an arithmetic expression

● Evaluate the formula333.75b6+a2(11a2b2-b6-121b4-2)+5.5b8+a/(2b) for a = 77617.0, b = 33096.0

● On an IBM mainframe, the following results were computed (rounded to 7 digits):

Single precision: 1.172604Double precision: 1.172604Extended precision: 1.172604

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 11

Example 2: value of an arithmetic expression

● Evaluate the formula333.75b6+a2(11a2b2-b6-121b4-2)+5.5b8+a/(2b) for a = 77617.0, b = 33096.0

● The correct result is:Exact result: - 0.82739605...

● Remember, the computed result wasAll precisions: + 1.172604

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 12

Example 3: plot of a function

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 13

Question: what function is this? It has about 46 zeros in the range shown

Example 3: plot of a function

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 14

Answer: this is a polyomial of degree 5 with integer coefficients – using floating-point evaluation

7378 x5 – 58545 x4 + 103207 x3 + 273285 x2

– 1083971 x + 955710

Example 3: plot of a function

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 15

The same function in the same range – plotted with exact evaluation, there are only 3 zeros

Example 4: rotor of a turbine

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 16

Eigenfrequency analysis of a shaft design [IBM]

Example 4: rotor of a turbine

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 17

Residual frequency determinant flp / exact [IBM]

Example 5: fractal sequence

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 18

Example 6: scalar and vector processorevaluate x - x + y - y for x = 10 i, y = 10 -i

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 19

Alternative tools for result verification

● Manual forward / backward analysis (difficult for large problems)

● Random rounding (Vignes / Chatelin)● Visualization● Computer algebra methods● Automatic differentiation of programs (Griewank,

...)● A priori verification of a range of problems● Verification methods using interval arithmetic

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 20

What is Interval Arithmetic?

● Compute lower and upper bounds l and u for each floating-point number a, so l ≤ a ≤ u

● Notation: a ∈ A = [l,u]● An interval [l,u] is the set of all real (!) numbers

between l and u● Each interval operation requires (at least) 2

floating-point operations, e.g.● Sum [l1,u1] + [l2,u2] = [l1+l2,u1+u2]● All lower bounds must be rounded down, all

upper bounds must be rounded upGerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 21

What is Interval Arithmetic?

● In theory, interval operations require about twice as much execution time as floating-point operations

● In practice, they need much more:● Multiplications and divisions are more

complicated● The rounding mode has to be switched for

upper and lower bounds, this can be very time consuming

● Implementations are not as efficient as they could be

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 22

There seems to be a conflict!

● Scientific Computing: hardware, firmware, software tuned for top performance

● Interval methods: slower performance● So interval methods, at first sight, seem to be

incompatible with Scientific Computing

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 23

There is no conflict between Intervals and Scientific Computing

● From a strictly mathematical point of view, floating-point results must be considered assumptions, not proofs

● The larger and faster computers get, the more we need automatic tools to check the reliability of results

● Interval arithmetic can re-introduce mathematical rigor in scientific computing

● We should not count Flop/s but e.g. “guaranteed correct digits per second”

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 24

Some interval packages

● Pascal-XSC, C-XSC (Kulisch, Karlsruhe / Krämer, Wuppertal)

● Filib (Krämer, Wuppertal / Wolff v. Gudenberg, Würzburg)

● Intlab (Rump, Hamburg)● Sun Forte Interval Extension (Walster, Sun)● others

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 25

What is needed for interval methods with verified results?

● Floating-point arithmetic with directed roundings up / down (IEEE standard, but frequently inefficient, switching of rounding mode is very slow)

● An optimal scalar product (dot product) with maximum accuracy (in hardware or software)

● New numerical algorithms based on this arithmetic

● Programming languages with an appropriate support (e.g. C-XSC)

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 26

Basic idea of algorithm with result verification

● Problem P with an (unknown) solution x● Floating-point algorithm computes

approximation● Highly accurate residue correction method

computes improved approximation● Interval residue correction method computes a

sequence of intervals Xi

● As soon as Xi+1

⊂ Xi, one can prove that X

i+1

contains the exact solution x of the problem P, i.e. x ∈ X

i+1Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 27

Example algorithm: solve linear system with result verification

● Task: solve linear system Ax=b● Compute approximate inverse R of A● Compute interval inclusion z = ##(Rb)● Compute interval inclusion D = ##(I-RA)● Starting with x = z, repeat the following steps until

x ⊂ y or timeout➔ Blow up interval x a little bit, y = blow(x, 0.1)➔ Iterate using interval arithmetic x = z + Dy● If x ⊂ y is achieved, it is mathematically proved

that the interval x contains the exact solution of the linear system

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 28

Which are the advantages of interval methods with verified results?

Intervals represent all real numbers between their lower and upper bounds, therefore interval methods can ...● provide rigorous error bounds● mathematically prove the existence of a solution

of a problem● mathematically prove the uniqueness of a

solution of a problem● mathematically prove that a certain set does not

contain a solution of a problem – e.g. that a function f has no zero in an interval I

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 29

New numerical algorithms

● It does not suffice to replace floating-point operations with interval operations

● Special new algorithms are needed using interval operations

● Large library for standard numerical problems is available, Toolbox I, II

● For applications in science and engineering, adapted algorithms and more research are needed

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 30

Groups working in the field of Intervals and Verified Computing

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 31

● USA: Ramon E. Moore, Vladik Kreinovich / El Paso, George Corliss / Marquette, Bill Walster / Sun, ...

● Germany: Ulrich Kulisch, Götz Alefeld / Karlsruhe, Walter Krämer / Wuppertal, Siegfried Rump / Hamburg, ...

● Brazil: Dalcidio Claudio, Gustavo Fernandes, Mariana Kolberg, Tiaraju Diverio / Porto Alegre, Marcilia Andrade Campos / Recife, Benjamin Bedregal, Regivan Santiago / Natal, ...

● Other countries: Svetoslav Markov / Bulgaria, Tibor Csendes / Hungary, Arnold Neumaier / Austria, Vyacheslav Nesterov / Russia, Jean Michel Muller / France, Mitsuhiro Nakao / Japan, ...

Standardization

● IEEE working group founded on 16 July 2008 ● Work has begun on a new standard, IEEE

P1788™, "Standard for Interval Arithmetic."● Website: http://grouper.ieee.org/groups/1788/

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 32

Conferences on Validated Numerics – scan' xxxx

● International Symposium on Scientific Computing, Computer Arithmetic, and Validated Numerics, every 2 years

● ... Wuppertal / Germany, Karlsruhe / Germany, Paris / France, Fukuoka / Japan, Duisburg / Germany, El Paso / USA

● Next conference: scan'2010, Lyon/France, end of September 2010

● Sections on other conferences

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 33

Project Probral

● Cooperation Brazil / Germany since 1970s, Probral 2008-2009, plans for another year

● Partners: PUCRS in Porto Alegre, Universität Karlsruhe, Universität Wuppertal

● Highly efficient verification of results on parallel architectures

● Implementation of prototypes of programs in Porto Alegre, transfer to supercomputers in Karlsruhe

Gerd Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 34

Conclusion

● No conflict between Interval Computation and High Performance Computing

● On the contrary, close partnership is necessary● For real world applications, more know how has

to be built up, partners in engineering and science are required

● More information on Vladik Kreinovich's Website (literature, links, newsletter, journal, etc.) www.cs.utep.edu/interval-comp/main.html

● Remarks and contact:[email protected] Bohlender, Universität Karlsruhe Brasilia, 2009 Slide 35