Minimisation de la m´ emoire VS minimisation du volume d’E/S dans les m´ ethodes de factorisation de matrices creuses
Abdou Guermouche, LaBRI Bordeaux
May 2010
Minimisation de la m emoire VS minimisation du volume dE/S dans - - PowerPoint PPT Presentation
Minimisation de la m emoire VS minimisation du volume dE/S dans les m ethodes de factorisation de matrices creuses Abdou Guermouche, LaBRI Bordeaux May 2010 Context Solving sparse linear Typical matrix: BRGM systems matrix 3 .
May 2010
2/43 Abdou Guermouche, May 2010
2/43 Abdou Guermouche, May 2010
Memory required Core memory
2/43 Abdou Guermouche, May 2010
Memory required Core memory Disks
2/43 Abdou Guermouche, May 2010
Limitation of the approach
Flexible allocation scheme A new memory minimization algorithm
3/43 Abdou Guermouche, May 2010
Limitation of the approach
Flexible allocation scheme A new memory minimization algorithm
4/43 Abdou Guermouche, May 2010
3 5 4 2 1 1 2 3 4 5 3 5 4 2 1 1 2 3 4 5
Non−zero Fill−in
A= L+U−I=
Factors Stack of contribution blocks Active frontal matrix Active Storage
3 2 4 5 1
1 5 4 2 3 3 4 4 5 5
Factors Contribution block
5/43 Abdou Guermouche, May 2010
Factors Stack of contribution blocks Active frontal matrix Active Storage
3 2 4 5 1
1 5 4 2 3 3 4 4 5 5
Factors Contribution block
5/43 Abdou Guermouche, May 2010
Factors Stack of contribution blocks Active frontal matrix Active Storage
3 2 4 5 1
1 5 4 2 3 3 4 4 5 5
Factors Contribution block
5/43 Abdou Guermouche, May 2010
Factors Stack of contribution blocks Active frontal matrix Active Storage
3 2 4 5 1
1 5 4 2 3 3 4 4 5 5
Factors Contribution block
5/43 Abdou Guermouche, May 2010
Factors Stack of contribution blocks Active frontal matrix Active Storage
3 2 4 5 1
1 5 4 2 3 3 4 4 5 5
Factors Contribution block
5/43 Abdou Guermouche, May 2010
Factors Stack of contribution blocks Active frontal matrix Active Storage
3 2 4 5 1
1 5 4 2 3 3 4 4 5 5
Factors Contribution block
5/43 Abdou Guermouche, May 2010
Factors Stack of contribution blocks Active frontal matrix Active Storage
3 2 4 5 1
1 5 4 2 3 3 4 4 5 5
Factors Contribution block
5/43 Abdou Guermouche, May 2010
6/43 Abdou Guermouche, May 2010
6/43 Abdou Guermouche, May 2010
6/43 Abdou Guermouche, May 2010
6/43 Abdou Guermouche, May 2010
6/43 Abdou Guermouche, May 2010
6/43 Abdou Guermouche, May 2010
6/43 Abdou Guermouche, May 2010
6/43 Abdou Guermouche, May 2010
Memory peak
Worst case.
Memory peak
Best case.
7/43 Abdou Guermouche, May 2010
Memory peak
Worst case.
Memory peak
Best case.
7/43 Abdou Guermouche, May 2010
n 2 1
cbn cb2 cb1
n
8/43 Abdou Guermouche, May 2010
n 2 1
cbn cb2 cb1
j−1
8/43 Abdou Guermouche, May 2010
n 2 1
cbn cb2 cb1
j=1,n(Aj + j−1
n
8/43 Abdou Guermouche, May 2010
Limitation of the approach
Flexible allocation scheme A new memory minimization algorithm
9/43 Abdou Guermouche, May 2010
i=1 yj) is obtained when the sequence
10/43 Abdou Guermouche, May 2010
Limitation of the approach
Flexible allocation scheme A new memory minimization algorithm
11/43 Abdou Guermouche, May 2010
Memory peak Allocation of the father
Classical approach.
Memory peak Allocation of the father
Flexible scheme.
12/43 Abdou Guermouche, May 2010
Memory peak Allocation of the father
Classical approach.
Memory peak Allocation of the father
Flexible scheme.
12/43 Abdou Guermouche, May 2010
Limitation of the approach
Flexible allocation scheme A new memory minimization algorithm
13/43 Abdou Guermouche, May 2010
. . . . . .
S1 S2 1 p+1 n p 2
j=1,p(Aflex j
j−1
p
j=p+1,n Aflex j
Abdou Guermouche, May 2010
. . . . . .
S1 S2 1 p+1 n p 2
j=1,p(Aflex j
j−1
p
j=p+1,n Aflex j
Abdou Guermouche, May 2010
. . . . . .
S1 S2 1 p+1 n p 2
j=1,p(Aflex j
j−1
p
j=p+1,n Aflex j
Abdou Guermouche, May 2010
j
15/43 Abdou Guermouche, May 2010
j=1,p(Aflex j
j−1
p
j=p+1,n Aflex j
j
i
p p p S1 S1 S1 S2 S2 S2 Optimal configuration
16/43 Abdou Guermouche, May 2010
j
k
′flex value for partition
′flex ≤ Aflex then
′flex;
′flex;
′flex > Aflex
17/43 Abdou Guermouche, May 2010
Limitation of the approach
Flexible allocation scheme A new memory minimization algorithm
18/43 Abdou Guermouche, May 2010
19/43 Abdou Guermouche, May 2010
19/43 Abdou Guermouche, May 2010
1 1.2 1.4 1.6 1.8 2 2.2 5 10 15 20 25 30 35 40 45 Memory Ratio Matrix Flexible allocation scheme Classical allocation scheme Early allocation scheme
AMD.
1 1.2 1.4 1.6 1.8 2 2.2 5 10 15 20 25 30 35 40 45 Memory Ratio Matrix Flexible allocation scheme Classical allocation scheme Early allocation scheme
METIS.
20/43 Abdou Guermouche, May 2010
1 1.2 1.4 1.6 1.8 2 2.2 5 10 15 20 25 30 35 40 45 Memory Ratio Matrix Flexible allocation scheme Classical allocation scheme Early allocation scheme
AMD.
1 1.2 1.4 1.6 1.8 2 2.2 5 10 15 20 25 30 35 40 45 Memory Ratio Matrix Flexible allocation scheme Classical allocation scheme Early allocation scheme
METIS.
20/43 Abdou Guermouche, May 2010
Limitation of the approach
Flexible allocation scheme A new memory minimization algorithm
21/43 Abdou Guermouche, May 2010
j=1,p(Tflex j
j−1
p
p
j=p+1,n(Tflex j
j−1
22/43 Abdou Guermouche, May 2010
j=1,p(Tflex j
j−1
p
p
j=p+1,n(Tflex j
j−1
22/43 Abdou Guermouche, May 2010
j=1,p(Tflex j
j−1
p
p
j=p+1,n(Tflex j
j−1
22/43 Abdou Guermouche, May 2010
j=1,p(Tflex j
j−1
p
p
j=p+1,n(Tflex j
j−1
22/43 Abdou Guermouche, May 2010
j=1,p(Tflex j
j−1
p
p
j=p+1,n(Tflex j
j−1
22/43 Abdou Guermouche, May 2010
i
i
23/43 Abdou Guermouche, May 2010
i
i
23/43 Abdou Guermouche, May 2010
i
i
23/43 Abdou Guermouche, May 2010
i
i
23/43 Abdou Guermouche, May 2010
j
j
′flex = max(P1, P2);
′flex ≤ Tflex then
′flex;
24/43 Abdou Guermouche, May 2010
0.9 0.95 1 1.05 1.1 1.15 1.2 1.25 1.3 5 10 15 20 25 30 35 40 45 Memory Ratio Matrix Flexible allocation scheme Classical allocation scheme Early allocation scheme Active memory flexible scheme
AMD.
0.9 0.95 1 1.05 1.1 1.15 1.2 1.25 1.3 5 10 15 20 25 30 35 40 45 Memory Ratio Matrix Flexible allocation scheme Classical allocation scheme Early allocation scheme Active memory flexible scheme
METIS.
25/43 Abdou Guermouche, May 2010
Limitation of the approach
Flexible allocation scheme A new memory minimization algorithm
26/43 Abdou Guermouche, May 2010
Limitation of the approach
Flexible allocation scheme A new memory minimization algorithm
27/43 Abdou Guermouche, May 2010
n 2 1
cbn cb2 cb1
28/43 Abdou Guermouche, May 2010
n 2 1
cbn cb2 cb1
28/43 Abdou Guermouche, May 2010
stack memory area written to disk allocation of a frontal matrix active frontal matrix Active memory Physical memory Active memory Physical memory Active memory Physical memory Allocation of a new frontal matrix After I/O Active memory Physical memory Active memory Physical memory After I/O Allocation of a new frontal matrix
29/43 Abdou Guermouche, May 2010
I/O produced at assembly step:
max(0, m +
n
cbj − M0)
I/O produced when processing the subtree rooted at child j:
max(0, Mj +
j−1
cbk − M0)
VI/O is thus:
VI/O = max
j=1,n(Mj + j−1
cbk), m +
n
cbj
Abdou Guermouche, May 2010
I/O produced at assembly step:
max(0, m +
n
cbj − M0)
I/O produced when processing the subtree rooted at child j:
max(0, Mj +
j−1
cbk − M0)
VI/O is thus:
VI/O = max
j=1,n(Mj + j−1
cbk), m +
n
cbj
Abdou Guermouche, May 2010
I/O produced at assembly step:
max(0, m +
n
cbj − M0)
I/O produced when processing the subtree rooted at child j:
max(0, Mj +
j−1
cbk − M0)
VI/O is thus:
VI/O = max
j=1,n(Mj + j−1
cbk), m +
n
cbj
Abdou Guermouche, May 2010
i
independent of position of child i
written to disk VI/O = max
j=1,n(min(Mj, M0) + j−1
cbk), m +
n
cbj
n
VI/O
i
max
j=1,n(min(Mj, M0) + j−1
cbk), m +
n
cbj
n
VI/O
i
whole tree
31/43 Abdou Guermouche, May 2010
i
independent of position of child i
written to disk VI/O = max
j=1,n(min(Mj, M0) + j−1
cbk), m +
n
cbj
n
VI/O
i
= max
j=1,n(min(Mj, M0) + j−1
cbk), m +
n
cbj
n
VI/O
i
whole tree
31/43 Abdou Guermouche, May 2010
Limitation of the approach
Flexible allocation scheme A new memory minimization algorithm
32/43 Abdou Guermouche, May 2010
Memory peak
Worst case
Memory peak
Best case
33/43 Abdou Guermouche, May 2010
Memory peak
Worst case
Memory peak
Best case
33/43 Abdou Guermouche, May 2010
max
j=1,n
j−1
cbk
i=1 yj) is obtained when the
34/43 Abdou Guermouche, May 2010
max
j=1,n
j−1
cbk
i=1 yj) is obtained when the
34/43 Abdou Guermouche, May 2010
max
j=1,n
j−1
cbk
i=1 yj) is obtained when the
34/43 Abdou Guermouche, May 2010
a b c M=12 cb=4 M=8 cb=2 F=5 M0=8
Liu’s Algorithm I/O minimization Algorithm sequence → a-b-c sequence → b-a-c Afath = 12, VI/0 = 8 Afath = 14, VI/0 = 7
Memory Time 4 8 12 Core limit Memory Time 4 8 12 Core limit 14
35/43 Abdou Guermouche, May 2010
0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 20 40 60 80 100 VIO (ratio MinMEM / MinIO) M0 (% of in−core requirements) BCSSTK − AMD MSDOOR − AMF BMWCRA − METIS GEO3D−20−20−20 − PORD 1 1.5 2 2.5 3 20 40 60 80 100 120 VIO (ratio MinMEM / MinIO) Matrix index AMD AMF METIS PORD Classical Last−in−place
36/43 Abdou Guermouche, May 2010
Limitation of the approach
Flexible allocation scheme A new memory minimization algorithm
37/43 Abdou Guermouche, May 2010
. . . . . .
S1 S2 1 p+1 n p 2
38/43 Abdou Guermouche, May 2010
. . . . . .
S1 S2 1 p+1 n p 2
38/43 Abdou Guermouche, May 2010
. . . . . .
S1 S2 1 p+1 n p 2
VI/O = max(0, max
j=1,p(min(Mj, M0) + j−1
cbk), m +
p
cbj
38/43 Abdou Guermouche, May 2010
. . . . . .
S1 S2 1 p+1 n p 2
VI/O = max(0, max
j=1,p(min(Mj, M0) + j−1
cbk), m +
p
cbj
+
n
max(0, m + min(Mj, M0) − M0)
38/43 Abdou Guermouche, May 2010
. . . . . .
S1 S2 1 p+1 n p 2
VI/O = max(0, max
j=1,p(min(Mj, M0) + j−1
cbk), m +
p
cbj
+
n
max(0, m + min(Mj, M0) − M0)+
n
max(0, cbi + m − M0)
38/43 Abdou Guermouche, May 2010
. . . . . .
S1 S2 1 p+1 n p 2
VI/O = max(0, max
j=1,p(min(Mj, M0) + j−1
cbk), m +
p
cbj
+
n
max(0, m + min(Mj, M0) − M0)+
n
max(0, cbi + m − M0) +
n
VI/O
i
38/43 Abdou Guermouche, May 2010
to minimize Vfamily on a given family ?
39/43 Abdou Guermouche, May 2010
1e+07 2e+07 3e+07 4e+07 5e+07 7.57e+06 6e+06 4e+06 2e+06 Volume of I/O (number of reals) Memory available (number of reals) Term−MinIO Flex−MinMEM Flex−MinIO
40/43 Abdou Guermouche, May 2010
Limitation of the approach
Flexible allocation scheme A new memory minimization algorithm
41/43 Abdou Guermouche, May 2010
42/43 Abdou Guermouche, May 2010
43/43 Abdou Guermouche, May 2010