GPU ACCELERATION OF CHOLMOD: BATCHING, HYBRID AND MULTI-GPU Steve - - PowerPoint PPT Presentation

gpu acceleration of cholmod batching hybrid and multi gpu
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

April 4-7, 2016 | Silicon Valley

Steve Rennich, Darko Stosic, Tim Davis, April 6, 2016

GPU ACCELERATION OF CHOLMOD: BATCHING, HYBRID AND MULTI-GPU

slide-2
SLIDE 2

2

OBJECTIVE

Direct sparse methods are among the most widely used in science and engineering GPU acceleration is challenging due to irregularity in operations and data access Investigate methods for GPU acceleration of sparse Cholesky factorization Implement within CHOLMOD

slide-3
SLIDE 3

3

AGENDA

Sparse Cholesky Root algorithm Subtree algorithm Custom batched BLAS/Lapack Multi-GPU Performance

slide-4
SLIDE 4

4

DENSE CHOLESKY FACTORIZATION

dense block Cholesky supernodes

L11 Lt

11 = A11

L11 Lt

21 = At 21

A*

22 = A22 – L21 Lt 21 POTRF TRSM GEMM

A11 A22 A21 A12 = L11 L21 I I A*

22

Lt

11 Lt 21

I

dense Cholesky triangular solve matrix multiplication

Schur complement compressed column

slide-5
SLIDE 5

5

SPARSE CHOLESKY ISSUES

Lots of small math Irregular operations/ access patterns PCIe communication

1 2 3 4 5 6

fill fill

7

1 2 4 5 7 6 3

POTRF TRSM SYRK GEMM

slide-6
SLIDE 6

6

ROOT ALGORITHM

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

slide-7
SLIDE 7

7

ROOT ALGORITHM

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?

slide-8
SLIDE 8

8

SUBTREE ALGORITHM

Send entire subtrees to GPU Factorization performed entirely on GPU Minimizes PCIe communication Requires batched BLAS/Lapack (with variable m, n, k) Previous method is used for root

subtree 1

level 0 level 1 level 2

subtree 2 subtree 3 subtree 4

slide-9
SLIDE 9

9

SUBTREE ALGORITHM

Send entire subtrees to GPU Factorization performed entirely on GPU Minimizes PCIe communication Requires batched BLAS/Lapack (with variable m, n, k) Previous method is used for root

subtree 1

level 0 level 1 level 2

subtree 2 subtree 3 subtree 4

ROOT alg. SUBTREE alg.

slide-10
SLIDE 10

10

RESULTS - SUBTREE

1.38x average speedup vs. previous CPU+GPU 2x average speedup vs. CPU Poorly performing matrices see the greatest speedup PCIe well avoided

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

slide-11
SLIDE 11

11

CURRENT WORK

  • 1. Releasable CUDA versions of batched BLAS/Lapack
  • 2. Support multi-GPU for both SUBTREE and ROOT algs.
  • 3. General implementation improvements
  • 4. Release as merged with latest SuiteSparse library

SuiteSparse 4.6.0 BETA

http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.6.0-beta.tar.gz

slide-12
SLIDE 12

12

BATCHED BLAS/LAPACK

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

slide-13
SLIDE 13

13

If result matrix > 16x16 tiled

CUSTOM BATCHED BLAS/LAPACK

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

slide-14
SLIDE 14

14

MULTI-GPU

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

slide-15
SLIDE 15

15

MULTI-GPU

GPU 0 GPU 1 Serena.mtx

slide-16
SLIDE 16

16

MULTI-GPU

synchronize subtree root GPU 0 GPU 1 Serena.mtx

slide-17
SLIDE 17

17

CURRENT PERFORMANCE K40

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)

1xK40 = 1.8x 2xK40 = 2.3x 4xK40 = 2.6x

slide-18
SLIDE 18

18

CURRENT PERFORMANCE – K40 VS K80

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)

slide-19
SLIDE 19

19

CURRENT PERFORMANCE

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)

  • r 1x K80 (board, full boost, pl=175, ECC=ON)

103 SPD from Florida Sparse Matrix Collection

1x

slide-20
SLIDE 20

20

FURTHER WORK

  • further optimization of batched routines
  • improved overlap/load-balancing for multi-gpu case
  • LU
  • pivoting
  • accelerating all other aspects of matrix solution
slide-21
SLIDE 21

21

CONCLUSIONS

  • Sparse factorization can be well accelerated on GPUs
  • Subtree algorithm / batched BLAS / careful implementation
  • Plenty yet to be done

SuiteSparse 4.6.0 BETA

http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.6.0-beta.tar.gz

slide-22
SLIDE 22

April 4-7, 2016 | Silicon Valley

THANK YOU

JOIN THE NVIDIA DEVELOPER PROGRAM AT developer.nvidia.com/join