Documente Academic
Documente Profesional
Documente Cultură
Repeated use
Source code
Code generator Problem family
description
Custom solver
Embedded solver
Compiler
Problem
instance
x
Part I: Introduction 9
Embedded convex optimization: Pre-solve phase
Problem
instance
General solver
x
Source code
Code generator Problem family
description
Custom solver
Embedded solver
Compiler
Problem
instance
x
Part I: Introduction 9
CVXGEN
Mattingley, Boyd
Algorithm robustness
Part II of V 20
Part III: Techniques
1. Transformation to canonical form
2. Interior-point algorithm
3. Solving the KKT system
Permutation
Regularization
Factorization
Iterative renement
Eliminating failure
4. Code generation
Part III of V 21
Transformation to canonical form
_
_
Ab
0
0
_
_
Part III: Techniques 23
Solving the standard-form QP
_
Q 0 G
T
A
T
0 Z S 0
G I 0 0
A 0 0 0
_
_
_
_
x
a
s
a
z
a
y
a
_
_
=
_
_
(A
T
y +G
T
z +Px +q)
Sz
(Gx +s h)
(Ax b)
_
_
.
3. Compute centering-plus-corrector direction by solving
_
_
Q 0 G
T
A
T
0 Z S 0
G I 0 0
A 0 0 0
_
_
_
_
x
cc
s
cc
z
cc
y
cc
_
_
=
_
_
0
1 diag(s
a
)z
a
0
0
_
_
,
with
= s
T
z/p =
_
(s + s
a
)
T
(z + z
a
)/(s
T
z)
_
3
= sup{ [0, 1] | s + s
a
0, z + z
a
0}
.
Part III: Techniques 25
Algorithm (continued)
4. Combine the updates with
x = x
a
+ x
cc
s = s
a
+ s
cc
y = y
a
+ y
cc
z = z
a
+ z
cc
.
5. Find
= min{1, 0.99 sup{ 0 | s + s 0, z + z 0}},
and update
x := x + x s := s + s
y := y + y z := z + z
.
Part III: Techniques 26
Solving KKT system
_
Q 0 G
T
A
T
0 S
1
Z I 0
G I 0 0
A 0 0 0
_
Factorize PKP
T
= LDL
T
, with permutation matrix P
Maintains stability
How do we x this?
Part III: Techniques 28
Solving KKT system: Regularization
_
Q 0 G
T
A
T
0 S
1
Z I 0
G I 0 0
A 0 0 0
_
_
+
_
I 0
0 I
_
_
_
_
_
P
T
= P
KP
T
= LDL
T
K now quasidenite: block diagonals PD, ND
Instead, solve
=
K
1
r = P
T
L
T
D
1
L
1
Pr
Factorization computes
D
ii
D
ii
, due to numerical errors
D
ii
)
+
+ )
Parameter stung:
b[4] = params.A[4]*params.x_0[0] + params.A[9]*params.x_0[1]
+ params.A[14]*params.x_0[2] + params.A[19]*params.x_0[3]
+ params.A[24]*params.x_0[4];
Part III: Techniques 35
Part IV: Verication
1. Computation speed
2. Reliability
Part IV of V 36
Computation speeds
Investigated:
Algebra: dense, library-based, sparse, at; all with dierent solution methods
Example:
1
-norm minimization with box constraints
Example:
1
-norm minimization with box constraints
Default regularization, = 10
7
16k
5
20k
6
37k
7
22k
8
5k
9
696
10
106
11
7
12 13
1
14
No regularization, = 0
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
100k
20
Part IV: Verication 41
Reliability testing: Decreased KKT regularization
Default regularization, = 10
7
16k
5
20k
6
37k
7
22k
8
5k
9
696
10
106
11
7
12 13
1
14
Decreased regularization, = 10
11
16k
5
20k
6
37k
7
22k
8
5k
9
699
10
108
11
10
12 13
1
14 15 16 17 18 19
252
20
Part IV: Verication 42
Reliability testing: Increased KKT regularization
Default regularization, = 10
7
16k
5
20k
6
37k
7
22k
8
5k
9
696
10
106
11
7
12 13
1
14
Increased regularization, = 10
2
15k
5
14k
6
15k
7
13k
8
9k
9
6k
10
4k
11
3k
12
2k
13
2k
14
1k
15
927
16
766
17
651
18
506
19
13k
20
Part IV: Verication 43
Reliability testing: Iterative renement
Already in use
Part V: Final notes 47
Extensions
Dierent hardware
Part V: Final notes 48
Publications