Automated Precision Tuning using Semidefinite Programming Victor - - PowerPoint PPT Presentation

automated precision tuning using semidefinite programming
SMART_READER_LITE
LIVE PREVIEW

Automated Precision Tuning using Semidefinite Programming Victor - - PowerPoint PPT Presentation

Automated Precision Tuning using Semidefinite Programming Victor Magron , RA Imperial College joint work with G. Constantinides and A. Donaldson British-French-German Conference on Optimization 15 June 2015 Victor Magron Automated Precision


slide-1
SLIDE 1

Automated Precision Tuning using Semidefinite Programming

Victor Magron, RA Imperial College

joint work with G. Constantinides and A. Donaldson

British-French-German Conference on Optimization 15 June 2015

Victor Magron Automated Precision Tuning using Semidefinite Programming 1 / 27

slide-2
SLIDE 2

Errors and Proofs

Mathematicians and Computer Scientists want to eliminate all the uncertainties on their results. Why?

Victor Magron Automated Precision Tuning using Semidefinite Programming 2 / 27

slide-3
SLIDE 3

Errors and Proofs

Mathematicians and Computer Scientists want to eliminate all the uncertainties on their results. Why?

  • M. Lecat, Erreurs des Mathématiciens des origines à nos

jours, 1935. ❀ 130 pages of errors! (Euler, Fermat, Sylvester, . . . )

Victor Magron Automated Precision Tuning using Semidefinite Programming 2 / 27

slide-4
SLIDE 4

Errors and Proofs

Mathematicians and Computer Scientists want to eliminate all the uncertainties on their results. Why?

  • M. Lecat, Erreurs des Mathématiciens des origines à nos

jours, 1935. ❀ 130 pages of errors! (Euler, Fermat, Sylvester, . . . ) Ariane 5 launch failure, Pentium FDIV bug

Victor Magron Automated Precision Tuning using Semidefinite Programming 2 / 27

slide-5
SLIDE 5

Errors and Proofs

GUARANTEED OPTIMIZATION Input : Linear problem

(LP), geometric, semidefinite (SDP)

Output : solution + certificate

numeric-symbolic ❀ formal

Victor Magron Automated Precision Tuning using Semidefinite Programming 3 / 27

slide-6
SLIDE 6

Errors and Proofs

GUARANTEED OPTIMIZATION Input : Linear problem

(LP), geometric, semidefinite (SDP)

Output : solution + certificate

numeric-symbolic ❀ formal

VERIFICATION OF CRITICAL SYSTEMS

Reliable software/hardware embedded codes Aerospace control

molecular biology, robotics, code synthesis, . . .

Victor Magron Automated Precision Tuning using Semidefinite Programming 3 / 27

slide-7
SLIDE 7

Errors and Proofs

GUARANTEED OPTIMIZATION Input : Linear problem

(LP), geometric, semidefinite (SDP)

Output : solution + certificate

numeric-symbolic ❀ formal

VERIFICATION OF CRITICAL SYSTEMS

Reliable software/hardware embedded codes Aerospace control

molecular biology, robotics, code synthesis, . . .

Efficient Verification of Nonlinear Systems

Automated precision tuning of systems/programs

analysis/synthesis

Efficiency sparsity correlation patterns Certified approximation algorithms

Victor Magron Automated Precision Tuning using Semidefinite Programming 3 / 27

slide-8
SLIDE 8

Rounding Error Bounds

Real : p(x) := x1 × x2 + x3 Floating-point : ˆ p(x, e) := [x1x2(1 + e1) + x3](1 + e2) Input variable uncertainties x ∈ S Finite precision ❀ bounds over e | ei | 2−m m = 24 (single) or 53 (double) Guarantees on absolute round-off error | ˆ p − p | ?

Victor Magron Automated Precision Tuning using Semidefinite Programming 4 / 27

slide-9
SLIDE 9

Nonlinear Programs

Polynomials programs : +, −, × x2x5 + x3x6 + x1(−x1 + x2 + x3 − x4 + x5 + x6)

Victor Magron Automated Precision Tuning using Semidefinite Programming 5 / 27

slide-10
SLIDE 10

Nonlinear Programs

Polynomials programs : +, −, × x2x5 + x3x6 + x1(−x1 + x2 + x3 − x4 + x5 + x6) Semialgebraic programs: | · |, √, /, sup, inf 4x 1 + x 1.11

Victor Magron Automated Precision Tuning using Semidefinite Programming 5 / 27

slide-11
SLIDE 11

Nonlinear Programs

Polynomials programs : +, −, × x2x5 + x3x6 + x1(−x1 + x2 + x3 − x4 + x5 + x6) Semialgebraic programs: | · |, √, /, sup, inf 4x 1 + x 1.11 Transcendental programs: arctan, exp, log, . . . log(1 + exp(x))

Victor Magron Automated Precision Tuning using Semidefinite Programming 5 / 27

slide-12
SLIDE 12

Existing Frameworks

Classical methods: Abstract domains [Goubault-Putot 11] FLUCTUAT: intervals, octagons, zonotopes Interval arithmetic [Daumas-Melquiond 10] GAPPA: interface with COQ proof assistant

Victor Magron Automated Precision Tuning using Semidefinite Programming 6 / 27

slide-13
SLIDE 13

Existing Frameworks

Recent progress: Affine arithmetic + SMT [Darulova 14] rosa: sound compiler for reals (in SCALA) Symbolic Taylor expansions [Solovyev 15] FPTaylor: certified optimization (in OCAML and HOL-LIGHT)

Victor Magron Automated Precision Tuning using Semidefinite Programming 6 / 27

slide-14
SLIDE 14

Contributions

Maximal Rounding error of the program implementation of f: r⋆ := max | ˆ f (x, e) − f (x)| Decomposition: linear term l w.r.t. e + nonlinear term h r⋆ max |l(x, e)| + max |h(x, e)| Sparse SDP bounds for l Coarse bound of h with interval arithmetic

Victor Magron Automated Precision Tuning using Semidefinite Programming 7 / 27

slide-15
SLIDE 15

Contributions

1 Comparison with SMT and linear/affine arithmetic:

❀ More Efficient optimization + Tighter upper bounds

2 Extensions to transcendental/conditional programs 3 Formal verification of SDP bounds 4 Open source tool Real2Float (in OCAML and COQ)

Victor Magron Automated Precision Tuning using Semidefinite Programming 7 / 27

slide-16
SLIDE 16

Introduction Semidefinite Programming for Polynomial Optimization Rounding Error Bounds with Sparse SDP Conclusion

slide-17
SLIDE 17

What is Semidefinite Programming?

Linear Programming (LP): min

z

c

⊤z

s.t. A z d .

Linear cost c Linear inequalities “∑i Aij zj di”

Polyhedron

Victor Magron Automated Precision Tuning using Semidefinite Programming 8 / 27

slide-18
SLIDE 18

What is Semidefinite Programming?

Semidefinite Programming (SDP): min

z

c

⊤z

s.t.

i

Fi zi F0 .

Linear cost c Symmetric matrices F0, Fi Linear matrix inequalities “F 0” (F has nonnegative eigenvalues)

Spectrahedron

Victor Magron Automated Precision Tuning using Semidefinite Programming 9 / 27

slide-19
SLIDE 19

What is Semidefinite Programming?

Semidefinite Programming (SDP): min

z

c

⊤z

s.t.

i

Fi zi F0 , A z = d .

Linear cost c Symmetric matrices F0, Fi Linear matrix inequalities “F 0” (F has nonnegative eigenvalues)

Spectrahedron

Victor Magron Automated Precision Tuning using Semidefinite Programming 10 / 27

slide-20
SLIDE 20

Applications of SDP

Combinatorial optimization Control theory Matrix completion Unique Games Conjecture (Khot ’02) : “A single concrete algorithm provides optimal guarantees among all efficient algorithms for a large class of computational problems.” (Barak and Steurer survey at ICM’14) Solving polynomial optimization (Lasserre ’01)

Victor Magron Automated Precision Tuning using Semidefinite Programming 11 / 27

slide-21
SLIDE 21

SDP for Polynomial Optimization

Prove polynomial inequalities with SDP: p(a, b) := a2 − 2ab + b2 0 . Find z s.t. p(a, b) =

  • a

b z1 z2 z2 z3

  • a

b

  • .

Find z s.t. a2 − 2ab + b2 = z1a2 + 2z2ab + z3b2 (A z = d)

z1 z2 z2 z3

  • =

1

  • F1

z1 + 1 1

  • F2

z2 + 1

  • F3

z3

  • F0

Victor Magron Automated Precision Tuning using Semidefinite Programming 12 / 27

slide-22
SLIDE 22

SDP for Polynomial Optimization

Choose a cost c e.g. (1, 0, 1) and solve: min

z

c

⊤z

s.t.

i

Fi zi F0 , A z = d . Solution

z1 z2 z2 z3

  • =

1 −1 −1 1

  • (eigenvalues 0 and 1)

a2 − 2ab + b2 =

  • a

b 1 −1 −1 1

  • a

b

  • = (a − b)2 .

Solving SDP = ⇒ Finding SUMS OF SQUARES certificates

Victor Magron Automated Precision Tuning using Semidefinite Programming 13 / 27

slide-23
SLIDE 23

SDP for Polynomial Optimization

General case: Semialgebraic set S := {x ∈ Rn : g1(x) 0, . . . , gm(x) 0} p∗ := min

x∈S p(x): NP hard

Sums of squares (SOS) Σ[x] (e.g. (x1 − x2)2) Q(S) :=

  • σ0(x) + ∑m

j=1 σj(x)gj(x), with σj ∈ Σ[x]

  • Fix the degree 2k of sums of squares

Qk(S) := Q(S) ∩ R2k[x]

Victor Magron Automated Precision Tuning using Semidefinite Programming 14 / 27

slide-24
SLIDE 24

SDP for Polynomial Optimization

Hierarchy of SDP relaxations: λk := sup

λ

  • λ : p − λ ∈ Qk(S)
  • Convergence guarantees λk ↑ p∗ [Lasserre 01]

Can be computed with SDP solvers (CSDP, SDPA) “No Free Lunch” Rule: (n+2k

n ) SDP variables

Extension to semialgebraic functions r(x) = p(x)/

  • q(x)

[Lasserre-Putinar 10]

Victor Magron Automated Precision Tuning using Semidefinite Programming 15 / 27

slide-25
SLIDE 25

Sparse SDP Optimization [Waki, Lasserre 06]

Correlative sparsity pattern (csp) of variables x2x5 + x3x6 − x2x3 − x5x6 + x1(−x1 + x2 + x3 − x4 + x5 + x6)

6 4 5 1 2 3

1 Maximal cliques C1, . . . , Cl 2 Average size κ ❀ (κ+2k κ )

variables C1 := {1, 4} C2 := {1, 2, 3, 5} C3 := {1, 3, 5, 6} Dense SDP: 210 variables Sparse SDP: 115 variables

Victor Magron Automated Precision Tuning using Semidefinite Programming 16 / 27

slide-26
SLIDE 26

Introduction Semidefinite Programming for Polynomial Optimization Rounding Error Bounds with Sparse SDP Conclusion

slide-27
SLIDE 27

Polynomial Programs

Input: exact f (x), floating-point ˆ f (x, e), x ∈ S, | ei | 2−m Output: Bound for f − ˆ f

1: Error r(x, e) := f (x) − ˆ

f (x, e) = ∑

α

rα(e)xα

2: Decompose r(x, e) = l(x, e) + h(x, e), l linear in e 3: l(x, e) = ∑n′

i=0 si(x)ei

4: Maximal cliques correspond to {x, e1}, . . . , {x, en′} 5: Bound l(x, e) with sparse SDP relaxations (and h with IA)

Dense relaxation: (n+n′+2k

n+n′ )

SDP variables Sparse relaxation: n′(n+1+2k

n+1 )

SDP variables

Victor Magron Automated Precision Tuning using Semidefinite Programming 17 / 27

slide-28
SLIDE 28

Preliminary Comparisons

f (x) := x2x5 + x3x6 − x2x3 − x5x6 + x1(−x1 + x2 + x3 − x4 + x5 + x6) x ∈ [4.00, 6.36]6 , e ∈ [−ǫ, ǫ]15 , ǫ = 2−24 Dense SDP: (6+15+4

6+15 ) = 12650 variables ❀ Out of memory

Sparse SDP Real2Float tool: 15(6+1+4

6+1 ) = 4950 ❀ 789ǫ

Interval arithmetic: 2023ǫ (17 × less CPU) Symbolic Taylor FPTaylor tool: 936ǫ (16.3 × more CPU) SMT-based rosa tool: 789ǫ (4.6 × more CPU)

Victor Magron Automated Precision Tuning using Semidefinite Programming 18 / 27

slide-29
SLIDE 29

Preliminary Comparisons

R e a l 2 F l

  • a

t r

  • s

a F P T a y l

  • r

200 400 600 800 1,000 789ǫ 789ǫ 936ǫ CPU Time Error Bound (ǫ)

Victor Magron Automated Precision Tuning using Semidefinite Programming 18 / 27

slide-30
SLIDE 30

Extensions: Transcendental Programs

Given K a compact set and f a transcendental function, bound f ∗ = inf

x∈K f (x) and prove f ∗ 0

f is under-approximated by a semialgebraic function fsa Reduce the problem f ∗

sa := infx∈K fsa(x) to a polynomial

  • ptimization problem (POP)

Victor Magron Automated Precision Tuning using Semidefinite Programming 19 / 27

slide-31
SLIDE 31

Extensions: Transcendental Programs

Approximation theory: Chebyshev/Taylor models mandatory for non-polynomial problems hard to combine with Sum-of-Squares techniques (degree

  • f approximation)

Victor Magron Automated Precision Tuning using Semidefinite Programming 19 / 27

slide-32
SLIDE 32

Extensions: Transcendental Programs

Initially introduced to solve Optimal Control Problems [Fleming-McEneaney 00] Curse of dimensionality reduction [McEaneney Kluberg, Gaubert-McEneaney-Qu 11, Qu 13]. Allowed to solve instances of dim up to 15 (inaccessible by grid methods) In our context: approximate transcendental functions

Victor Magron Automated Precision Tuning using Semidefinite Programming 20 / 27

slide-33
SLIDE 33

Extensions: Transcendental Programs

Definition Let γ 0. A function φ : Rn → R is said to be γ-semiconvex if the function x → φ(x) + γ

2 x2 2 is convex.

a y par+

a1

par+

a2

par−

a2

par−

a1

a2 a1 arctan m M

Victor Magron Automated Precision Tuning using Semidefinite Programming 20 / 27

slide-34
SLIDE 34

Extensions: Transcendental Programs

Exact parsimonious maxplus representations

a y

Victor Magron Automated Precision Tuning using Semidefinite Programming 21 / 27

slide-35
SLIDE 35

Extensions: Transcendental Programs

Exact parsimonious maxplus representations

a y

Victor Magron Automated Precision Tuning using Semidefinite Programming 21 / 27

slide-36
SLIDE 36

Extensions: Programs with Conditionals

if (p(x) 0) f (x); else g(x); DIVERGENCE PATH ERROR: r⋆ := max{ max

p(x)0,p(x,e)0 | ˆ

f (x, e) − g(x) | max

p(x)0,p(x,e)0 | ˆ

g(x, e) − f (x) | max

p(x)0,p(x,e)0 | ˆ

f (x, e) − f (x) | max

p(x)0,p(x,e)0 | ˆ

g(x, e) − g(x) | }

Victor Magron Automated Precision Tuning using Semidefinite Programming 22 / 27

slide-37
SLIDE 37

Benchmarks

Doppler

u ∈ [−100, 100] v ∈ [20, 20000] T ∈ [−30, 50] let t1 = 331.4 + 0.6T in −t1v (t1 + u)2

F P T a y l

  • r

R e a l 2 F l

  • a

t r

  • s

a 1,000 2,000 3,000 4,000 5,000 1,415ǫ 2,567ǫ 4,477ǫ CPU Time Error Bound (ǫ)

Victor Magron Automated Precision Tuning using Semidefinite Programming 23 / 27

slide-38
SLIDE 38

Benchmarks

Kepler2

x ∈ [4, 6.36]6 x1x4(−x1 + x2 + x3 − x4 +x5 + x6) + x2x5(x1 − x2 +x3 + x4 − x5 + x6) +x3x6(x1 + x2 − x3 +x4 + x5 − x6) −x2x3x4 − x1x3x5 −x1x2x6 − x4x5x6

R e a l 2 F l

  • a

t F P T a y l

  • r

r

  • s

a 0.5 1 1.5 2 ·104 17,114ǫ 23,509ǫ 19,456ǫ CPU Time Error Bound (ǫ)

Victor Magron Automated Precision Tuning using Semidefinite Programming 24 / 27

slide-39
SLIDE 39

Benchmarks

verhulst

x ∈ [0.1, 0.3] 4x 1 + x 1.11

R e a l 2 F l

  • a

t F P T a y l

  • r

r

  • s

a 2 4 6 3.07ǫ 3.16ǫ 6.15ǫ CPU Time Error Bound (ǫ)

Victor Magron Automated Precision Tuning using Semidefinite Programming 25 / 27

slide-40
SLIDE 40

Benchmarks

logexp

x ∈ [−8, 8] log(1 + exp(x))

R e a l 2 F l

  • a

t F P T a y l

  • r

5 10 15 20 13.5ǫ 15.4ǫ CPU Time Error Bound (ǫ)

Victor Magron Automated Precision Tuning using Semidefinite Programming 26 / 27

slide-41
SLIDE 41

Introduction Semidefinite Programming for Polynomial Optimization Rounding Error Bounds with Sparse SDP Conclusion

slide-42
SLIDE 42

Conclusion

Sparse SDP relaxations analyze NONLINEAR PROGRAMS: Polynomial and transcendental programs Handles conditionals, input uncertainties, . . . Certified ❀ Formal rounding error bounds Real2Float open source tool: https://forge.ocamlcore.org/projects/nl-certify

Victor Magron Automated Precision Tuning using Semidefinite Programming 27 / 27

slide-43
SLIDE 43

Conclusion

Further research: Improve formal polynomial checker Alternative polynomial bounds using geometric programming (T. de Wolff, S. Iliman) Mixed linear/SDP certificates (trade-off CPU/precision) More program verification: while loops Automatic FPGA code generation

Victor Magron Automated Precision Tuning using Semidefinite Programming 27 / 27

slide-44
SLIDE 44

End

Thank you for your attention! cas.ee.ic.ac.uk/people/vmagron