1 / 21

Fine-Grain Sparse Matrix Partitioning with Constraints

Fine-Grain Sparse Matrix Partitioning with Constraints. Erik Boman Sandia National Labs, Albuquerque, NM Umit Catalyurek Ohio State University. Outline. Load-balancing & partitioning Sparse matrix-vector multiplication Models: bipartite graph, hypergraph 1d and 2d distributions

seda
Download Presentation

Fine-Grain Sparse Matrix Partitioning with Constraints

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Fine-Grain Sparse Matrix Partitioning with Constraints Erik Boman Sandia National Labs, Albuquerque, NM Umit Catalyurek Ohio State University

  2. Outline • Load-balancing & partitioning • Sparse matrix-vector multiplication • Models: bipartite graph, hypergraph • 1d and 2d distributions • Constrained matrix partitioning • Hypergraph with fixed vertices • Vertex cover model • Numerical results

  3. Proc 3 Proc 1 Proc 2 Load Balancing, Graph Partitioning • Load Balancing • Assign work to processors to distribute work evenly and minimize communication • Graph or hypergraph partitioning • Vertices (weighted) = computation • Edge (weighted) = data dependence

  4. Parallel Sparse Matrix-Vector Multiply • Compute y=Ax, where A is large and sparse • A is distributed among processors • Kernel in scientific computing • Iterative methods (Krylov) • Eigenvalue computations • PageRank • Nice model problem • Other applications have similar computation and communication pattern

  5. Parallel Sparse Matrix-vector Algorithm • Step 1: Expand (fan-out) • Send xj to processors with nonzero in column j • Step 2: Local multiply-add • yi = yi + Aij xj • Step 3: Fold (fan-in) • Send partial results of y to relevant processors • Step 4: Sum partial results Two communication phases (expand and fold).

  6. Row distribution Column distribution 2 1 1 4 3 x 2 1 1 4 3 x 3 1 6 4 1 3 1 9 6 5 9 2 4 1 22 9 6 5 3 5 9 2 41 22 5 8 9 6 5 3 64 41 5 8 9 64 y A y A Communication (p=2)

  7. 1d Models • 1d distribution is most common • Assign either rows or columns • Models to represent a sparse matrix • Graph (only symmetric) • Bipartite graph • Hypergraph

  8. C2 C4 C1 C3 C5 Bipartite Graph Model • G=(R,C,E), where • R are row vertices • C are column vertices • Partition both R and C • But only use R for row distribution • Works in nonsym. case • Edge cut approximates comm. volume • Is NOT exact

  9. 1d Hypergraph Model • Hypergraph • Hyperedge is a set of vertices (1 or more) • Rows = vertices • Columns = hyperedges • Partition • Minimize hyperedges cut • Edge cut is exactly comm volume • Aykanat & Catalyurek (’96)

  10. 2D partitioning methods Reduces communication volume further Many variations 2D Cartesian (checkerboard) First partition rows Then partition columns Via multiconstraint hgraph partitioning Catalyurek & Aykanat 2D Mondriaan Recursive hypergraph bisection Bisseling & Vastenhouw Sparse Matrix Partitioning Courtesy: Rob Bisseling

  11. Fine-Grain Matrix Partitioning • Fine-grain partitioning • Assign each nonzero in matrix separately • Ultimate flexibility • Fine-grain hypergraph model • Catalyurek & Aykanat (2001) • Each nonzero is a vertex • Each row and column is a hyperedge • Exact model for comm. volume

  12. Bipartite Fine-Grain Model • Bipartite graph model • Partition both • vertices (rows, columns) • edges (nonzeros) • Minimize #vertices with incident edge in other partition

  13. Constrained Matrix Partitioning • Given A, x, y • where x and y already have a prescribed parallel distribution • Find optimal parallel distribution of A • Application: Iterative solver for Ax=b • Preconditioner code requires specific layout of the vectors • We are free to choose distribution for A, which is only used for matrix-vector multiply

  14. Bisection • First consider bisection (p=2). • Suppose wlog the 2*2 block structure to the right • Can always permute to get this form • We only need solve for the two off-diagonal blocks • Independent subproblems

  15. Hypergraph with fixed vertices Add constraints to fine-grain hypergraph: • Each row-net should contain a special blue vertex • Each column-net should contain a special red vertex • These special vertices are fixed, cannot change partition • Partitioning with fixed vertices available in Patoh and Zoltan packages

  16. Cover nonzeros by rows/columns Columns (4) Rows (4) Both (3)

  17. Graph Model: Vertex Cover x x x x x x x x

  18. Bipartite Matching König’s Theorem: Let G be a bipartite graph, let C be a minimum vertex cover for G, and let M be a maximum-cardinality matching. Then |C| = |M|. Polynomial time algorithm for bipartite graphs.

  19. K-way Generalization • Partition into k sets • Decouples into k(k-1) independent subproblems

  20. Numerical Results • Bisection (k=2), split using natural order Matching code provided by Dobrian, Halappanavar, and Pothen.

  21. Conclusions • Two new algorithms for fine-grain matrix partitioning with constraints • Empirical results show similar quality • VC/matching usually faster than partitioning • More experiments needed • Hypergraph partitioning: • Exact model, heuristic solver • Vertex cover via matching • Exact algorithm, but no balance constraint • K-way partitioning decouples, fully parallel

More Related