Reproducible ¡Tall-‑Skinny ¡QR ¡
- J. ¡Demmel ¡and ¡H.D. ¡Nguyen ¡
ARITH22 ¡
1 ¡
Reproducible Tall-Skinny QR J. Demmel and H.D. Nguyen - - PowerPoint PPT Presentation
Reproducible Tall-Skinny QR J. Demmel and H.D. Nguyen ARITH22 1 Plan 1. MoBvaBon 2. Algorithms 3. Experimental results 4. Conclusions 2 MoBvaBon:
1 ¡
2 ¡
– Data ¡alignment ¡ – Data ¡parBBoning/ordering ¡ – FMA ¡support ¡ – Intermediate ¡precision ¡(64 ¡bits, ¡80 ¡bits, ¡128 ¡bits, ¡etc) ¡ – Data ¡path ¡(SSE, ¡AVX, ¡GPU ¡warp, ¡etc) ¡ – Number ¡of ¡processors ¡ – Network ¡topology ¡ – ??? ¡
3 ¡
4 ¡
5 ¡
1 2 3 4 5
dasum Algo 3 Algo 2 Algo 6 dasum Algo 3 Algo 2 Algo 6 dasum Algo 3 Algo 2 Algo 6 dasum Algo 3 Algo 2 Algo 6 dasum Algo 3 Algo 2 Algo 6 dasum Algo 3 Algo 2 Algo 6 dasum Algo 3 Algo 2 Algo 6 dasum Algo 3 Algo 2 Algo 6 dasum Algo 3 Algo 2 Algo 6 dasum Algo 3 Algo 2 Algo 6 dasum Algo 3 Algo 2 Algo 6
1 2 4 8 16 32 64 128 256 512 1024 Time (normalized by dasum time) # Processors local sum Absolute Max communication All-Reduce 3.1 3.2 3.1 2.9 2.8 3.1 3.0 2.9 2.3 2.4 2.2 4.7 4.7 4.4 4.1 3.9 3.7 3.6 3.1 2.3 2.3 2.2 4.9 5.0 4.6 4.3 3.9 3.4 3.0 2.2 1.4 1.2 1.2 6 ¡
7 ¡
8 ¡
IteraBve ¡refinement ¡ Reconstruct ¡Householder ¡vectors ¡
9 ¡
A ¡ Y ¡ ¡ YT ¡ T ¡ R ¡ I- = ¡ × ¡
10 ¡
A ¡ Y ¡ ¡ YT ¡ T ¡ R ¡
R ¡
11 ¡
A ¡ Y ¡ ¡ R ¡
TR ¡
TR)
12 ¡
A ¡ Y ¡ ¡ R ¡
TR ¡
= ¡ A ¡ R ¡
TR) = LU(A-R)
13 ¡
A ¡ Y ¡ ¡ R ¡
TR ¡
= ¡ A ¡ R ¡
Flipping ¡signs ¡to ¡ avoid ¡cancellaBon ¡
TR,S] = modLU(A,R) = LU(A,S*R)
14 ¡
15 ¡
16 ¡
17 ¡
Y1=r2y(A1,R11) ¡ A2=A2-‑Y1TY1
TA2 ¡
Y1 ¡ ¡ A2 ¡
R11 ¡
Y1 ¡ ¡
A22 ¡ A11 ¡ R11 ¡
repQR2(A22) ¡
A ¡ b ¡ n ¡
[R11,p]=chol(ATA) ¡
p ¡ A1 ¡ ¡ A2 ¡
R11 ¡
18 ¡
19 ¡
20 ¡
21 ¡
– Column-‑wise ¡relaBve ¡error: ¡ – Q ¡is ¡always ¡orthogonal ¡by ¡construcBon ¡
– gallery ¡funcBon ¡from ¡matlab, ¡with ¡type ¡randsvd ¡A=UΣVT ¡and ¡ condiBon ¡number ¡ranging ¡from ¡10 ¡to ¡1015. ¡ – A=QR ¡with ¡R ¡being ¡constructed ¡in ¡some ¡special ¡formats ¡
22 ¡
1 2 3 4 5 6 7 1e+00 1e+02 1e+04 1e+06 1e+08 1e+10 1e+12 1e+14 1e+16 Running time normalized by Matlab qr Condition Number r2y repQR repQR2 rec_repQR
23 ¡
1e-16 1e-14 1e-12 1e-10 1e-08 1e-06 1e-04 1e+00 1e+02 1e+04 1e+06 1e+08 1e+10 1e+12 1e+14 1e+16 Relative Error Condition Number r2y repQR repQR2 rec_repQR
24 ¡
1 2 3 4 5 6 7 8 1e+00 1e+02 1e+04 1e+06 1e+08 1e+10 1e+12 1e+14 1e+16 Running time normalized by Matlab qr Condition Number r2y repQR repQR2 rec_repQR
25 ¡
1e-16 1e-14 1e-12 1e-10 1e-08 1e-06 1e-04 1e-02 1e+00 1e+02 1e+04 1e+06 1e+08 1e+10 1e+12 1e+14 1e+16 Relative Error Condition Number r2y repQR repQR2 rec_repQR
26 ¡
0≈ ¡
27 ¡
2 4 6 8 10 12 14 16 1e+00 1e+02 1e+04 1e+06 1e+08 1e+10 1e+12 1e+14 1e+16 Running time normalized by Matlab qr Condition Number r2y repQR repQR2 rec_repQR
28 ¡
1e-16 1e-14 1e-12 1e-10 1e-08 1e-06 1e-04 1e-02 1e+00 1e+02 1e+04 1e+06 1e+08 1e+10 1e+12 1e+14 1e+16 Relative Error Condition Number r2y repQR repQR2 rec_repQR
29 ¡
30 ¡
31 ¡ 15th ¡Workshop ¡on ¡Latest ¡Advances ¡in ¡Scalable ¡Algorithms ¡for ¡Large-‑Scale ¡Systems, ¡2014 ¡
32 ¡
33 ¡
Householder ¡QR ¡ Reproducible ¡(k ¡iteraIons) ¡ cholQR ¡ FLOPs ¡ 2nb2/p-‑2b3/3 ¡ (2k+2)nb2/p ¡+O(kb3) ¡ 2nb2/p+b3/3+(b2/2)logp ¡ Bandwidth ¡ (b2/2)logp ¡ (2k+2)b2logp ¡ b2logp ¡ Latency ¡ 2b ¡logp ¡ (2k+2)logp ¡ 2logp ¡ γ: ¡arithmeBc ¡cost ¡of ¡a ¡floaBng-‑point ¡operaBon ¡ β: ¡bandwidth ¡cost ¡of ¡sending ¡a ¡word ¡ α: ¡latency ¡cost ¡of ¡sending ¡a ¡message ¡ ¡ Matrix ¡size: ¡n ¡× ¡b. ¡
34 ¡
10 20 30 40 50 0.05 0.1 0.15 variation (ulps)
Absolute ¡Error ¡for ¡Random ¡Vectors ¡
0.5 1 1.5 2 0.005 0.01 0.015 0.02 0.025 relative error
Same ¡magnitude ¡opposite ¡signs ¡
RelaBve ¡Error ¡for ¡Orthogonal ¡vectors ¡ Vector ¡size: ¡1e6. ¡Data ¡ ¡aligned ¡to ¡16-‑byte ¡boundaries. ¡For ¡each ¡input ¡vector: ¡
Sign ¡not ¡ reproducible ¡
and using the same instruction set (SSE2/AVX) ¡
1. Same ¡answer, ¡independent ¡of ¡layout, ¡#processors, ¡order ¡of ¡summands ¡ 2. Good ¡performance ¡(scales ¡well) ¡ 3. Portable ¡(assume ¡IEEE ¡754 ¡only) ¡ 4. User ¡can ¡choose ¡accuracy ¡
– Guarantee ¡fixed ¡reducBon ¡tree ¡(not ¡2. ¡or ¡3.) ¡ – Use ¡(very) ¡high ¡precision ¡to ¡get ¡exact ¡answer ¡(not ¡2.) ¡ – Our ¡approach ¡(Nguyen, ¡D.) ¡
36 ¡