April 4-7, 2016 | Silicon Valley
Steve Rennich, Darko Stosic, Tim Davis, April 6, 2016
GPU ACCELERATION OF CHOLMOD: BATCHING, HYBRID AND MULTI-GPU Steve - - PowerPoint PPT Presentation
April 4-7, 2016 | Silicon Valley GPU ACCELERATION OF CHOLMOD: BATCHING, HYBRID AND MULTI-GPU Steve Rennich, Darko Stosic, Tim Davis, April 6, 2016 OBJECTIVE Direct sparse methods are among the most widely used in science and engineering GPU
April 4-7, 2016 | Silicon Valley
Steve Rennich, Darko Stosic, Tim Davis, April 6, 2016
2
3
4
L11 Lt
11 = A11
L11 Lt
21 = At 21
A*
22 = A22 – L21 Lt 21 POTRF TRSM GEMM
22
11 Lt 21
dense Cholesky triangular solve matrix multiplication
Schur complement compressed column
5
1 2 3 4 5 6
fill fill
7
1 2 4 5 7 6 3
POTRF TRSM SYRK GEMM
6
Send appropriate BLAS to GPU Assemble supernodes on GPU & CPU ‘Hide’ PCIe communication Handles large matrices
supernode score
GPU CPU
descendant supernodes row/column threshold ndrow >= 256 ndcol >= 32
0 ¡ 100 ¡ 200 ¡ 300 ¡ 400 ¡ 500 ¡ 600 ¡ 700 ¡ 800 ¡
GFlops/s ¡ Florida ¡Sparse ¡Matrix ¡Collec4on ¡
CPU ¡ CPU ¡+ ¡GPU ¡ 2 ¡x ¡Xeon ¡E5-‑2698 ¡v3 ¡+ ¡K40 ¡(max ¡boost, ¡ECC=off) ¡ ¡
SuiteSparse (CHOLMOD) 4.4.3
1.5x
7
Send appropriate BLAS to GPU Assemble supernodes on GPU & CPU ‘Hide’ PCIe communication Handles large matrices
supernode score
GPU CPU
descendant supernodes row/column threshold ndrow >= 256 ndcol >= 32
0 ¡ 100 ¡ 200 ¡ 300 ¡ 400 ¡ 500 ¡ 600 ¡ 700 ¡ 800 ¡
GFlops/s ¡ Florida ¡Sparse ¡Matrix ¡Collec4on ¡
CPU ¡ CPU ¡+ ¡GPU ¡ 2 ¡x ¡Xeon ¡E5-‑2698 ¡v3 ¡+ ¡K40 ¡(max ¡boost, ¡ECC=off) ¡ ¡
SuiteSparse (CHOLMOD) 4.4.3 why not higher? why so low?
8
subtree 1
level 0 level 1 level 2
subtree 2 subtree 3 subtree 4
9
subtree 1
level 0 level 1 level 2
subtree 2 subtree 3 subtree 4
ROOT alg. SUBTREE alg.
10
100 200 300 400 500 600 700 800 900
GFlop/s Florida Sparse Matrix Collection CPU CPU + GPU GPU Branches
CHOLMOD 4.43
22x ¡Xeon ¡E5-‑2698 ¡v3 ¡+ ¡K40 ¡(max ¡boost, ¡ECC=off) ¡ ¡
CHOLMOD 4.4.3
Subtrees
11
http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.6.0-beta.tar.gz
12
For each level
For GEMM, SYRK, TRSM, POTRF, batch if:
GEMM, SYRK: m<=128 & n<=128 & k<=128 POTRF, TRSM: m<=64 & n<=64
Stream remaining BLAS/LAPACK operations
Require batches with variable sized elements: m, n, k Irregular operations don’t give large uniform batches
Cannot afford to copy/pad
Previous work used modified cuBLAS/cuSolver code
13
If result matrix > 16x16 tiled
Written in CUDA – accepts lists of m, n, k Every BLAS/Lapack operation gets assigned to a threadblock
grid size = #batches automatic scheduling All threadblocks are 16x16 = 256 threads
If result matrix < 16x16 idle threads
14
Subtree
1 subtree per GPU Automatically scaled:
subtree size <= GPU memory (as large as possible)
Static load-balancing based on flops
Root
At least one supernode in ‘Root’ OMP parallel loop over supernodes: nthreads(#GPUs) ordered Spinwait on unfinished descendant supernodes
synchronize
subtree root
supernodes subtrees spin wait
elimination tree 4x GPU : GPU 1, GPU 2, GPU 3, GPU 4
15
GPU 0 GPU 1 Serena.mtx
16
synchronize subtree root GPU 0 GPU 1 Serena.mtx
17
0.0 ¡ 200.0 ¡ 400.0 ¡ 600.0 ¡ 800.0 ¡ 1000.0 ¡ 1200.0 ¡ 1400.0 ¡ 1600.0 ¡ 1800.0 ¡ 2000.0 ¡
GF/s ¡for ¡numerical ¡factoriza4on ¡ Frlorida ¡Sparse ¡Matrix ¡Collec4on ¡
CPU ¡ 1x ¡K40 ¡ 2x ¡K40 ¡ 4x ¡K40 ¡ SuiteSparse 4.6.0 2x E5-2698 v3 @2.3 GHz 1x - 4x K40 (full boost, ECC=ON)
18
0.0 ¡ 200.0 ¡ 400.0 ¡ 600.0 ¡ 800.0 ¡ 1000.0 ¡ 1200.0 ¡ 1400.0 ¡ 1600.0 ¡ 1800.0 ¡ 2000.0 ¡
numerical ¡factoriza4on ¡GF/s ¡ Florida ¡Sparse ¡Matrix ¡Collec4on ¡
CPU ¡ 1x ¡K40 ¡ 2x ¡K40 ¡ 4x ¡K40 ¡ 1x ¡K80 ¡ 2x ¡K80 ¡ 4x ¡K80 ¡ 2x E5-2698 v3 @2.3 GHz 1x - 4x K40 (full boost, ECC=ON) 1x – 4x K80 (full boost, pl=175, ECC=ON)
19
0 ¡ 1 ¡ 2 ¡ 3 ¡ 4 ¡ 5 ¡ 6 ¡ 0 ¡ 2000 ¡ 4000 ¡ 6000 ¡ 8000 ¡ 10000 ¡ 12000 ¡
Speedup ¡(GPU/CPU) ¡ factor ¡flops ¡/ ¡nnz(L) ¡ K40 ¡ K80 ¡
2x E5-2698 v3 @2.3 GHz + 1x K40 (full boost, ECC=ON)
103 SPD from Florida Sparse Matrix Collection
1x
20
21
http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.6.0-beta.tar.gz
April 4-7, 2016 | Silicon Valley
JOIN THE NVIDIA DEVELOPER PROGRAM AT developer.nvidia.com/join