Vitaly Osipov, Peter Sanders, Christian Schulz

Transcription

Vitaly Osipov, Peter Sanders, Christian Schulz
Engineering State-of-the-Art Graph
Partitioning Libraries @KIT
Vitaly Osipov, Peter Sanders,
Christian Schulz
Institute for Theoretical Computer Science, Algorithmics II
1
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
KIT – die Kooperation vonEngineering
Forschungszentrum
Karlsruhe
GmbH und
Universit
ät Karlsruhe (TH)
State-of-the-Art
Graph Partitioning
Libraries
@KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Overview
Introduction
Parallel Graph Partitioning (KaPPa)
n-Level Graph Partitioning (KaSPar)
Experimental Evaluation
Future Work
2
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Simulation - FEM
Simulation space is
discretized into a mesh
Solution of partitial differential
equations are approximated
by linear equations
Number of vertices can
become quite large → time
and memory
Parallel processing required
3
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
The Common Parallel Approach
Mesh partitioned via dual graph
1. Each volume (data, calculation) is
represented by a vertex
2. Interdependencies are represented by
edges
All PE’s get same amount of work
Communication is expensive
Graph Partitioning Problem:
Partition a graph into (almost) equally sized blocks, such that the
number of edges connecting vertices from different blocks is
minimal.
4
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
e-Balanced Graph Partitioning
Partition graph G = (V , E , c : V → R>0 , ω : E → R>0 )
into k disjoint blocks s.t.
1+e
total node weight
total node weight of each block ≤
k
total weight of cut edges as small as possible
Applications:
finite element simulations, VLSI design, route planning, . . .
5
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Multi-Level Graph Partitioning
Successful in existing systems:
DiBaP, Chaco, Jostle, Metis, Scotch,. . .
6
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Multi-Level Graph Partitioning
Edge Contraction
u, v
x
ω ({x , z }) = ω ({u , z }) + ω ({v , z }).
c (x ) = c (u ) + c (v )
7
Nov. 30, 2010
z
z
u
v
x
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Why Yet Another MGP Algorithms?
Karlsruhe Parallel Partitioner
Karlsruhe Sequential Partitioner
scalable parallel algorithm for the case k =# of processors
large inputs
high quality (better (even parallel) than other seq. algorithms)
understand / engineer multi level method
bridge gaps theory ↔ practice
8
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Matching Selection
Goals:
1.
2.
3.
4.
input
graph
large edge weights
sparsify
large #edges
few levels
uniform node weights
“represent” input
small node degrees
“represent” input
unclear objective
gap to approx. weighted matching
which only considers 1.,2.
...
match
contract
Our Solution:
Apply approx. weighted matching to general edge rating function
9
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Edge Ratings Tried
ω ({u , v })
ω ({u , v })
c (u ) + c (v )
ω ({u , v })
expansion∗ ({u , v }) :=
c (u )c (v )
expansion({u , v }) :=
ω ({u , v })2
c (u )c (v )
ω ({u , v })
innerOuter({u , v }) :=
Out(v ) + Out(u ) − 2ω (u , v )
expansion∗2 ({u , v }) :=
where c = node weight, ω =edge weight,
Out(u ) := ∑{u ,v }∈E ω ({u , v })
10
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Approx. Weighted Matching
Use parallel prepartitioner (optional)
currently geometric recursive bipartitioning when coords.
available
Global Path Algorithm [MaueSanders 2007] locally
parallel [ManneBisseling 2007] for border nodes
11
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Initial Partitioning
Every PE can perform initial partitioning using different seeds
Compared PARTY, P M ETIS, and S COTCH
S COTCH yielded best results
input
graph
output
partition
...
local improvement
...
match
contract
initial
uncontract
partitioning
12
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Local Improvement – Basic Approach
Use linear time local search [Fiduccia Mattheyses 82]
on multiple pairs of blocks in parallel
input
graph
output
partition
...
local improvement
...
match
contract
initial
uncontract
partitioning
13
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Finding Pairs of Blocks
Color edges of quotient graph Q
several parallel algorithms tried
Each color → matching in Q → independent block pairs
14
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Pairwise Local Search
exchange boundaries
two local searches
adopt best
New queue selection strategy topGain
15
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Karlsruhe Sequential Partitioner
1. Contraction
contract a single edge between two levels
possibly n levels
finegrained contraction
consequtive levels are very similar
no matching algorithm required
use of different edge ratings
uniform distribution of node weights
priority queue defines the order of edges to be contracted
2. Local Search
efficent stopping criterion
avoid quadratic runtime
3. General
Trial Trees
16
Nov. 30, 2010
improve quality by independent trials
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Contraction
edge rating - expansion∗ ({u , v }) =
ω ({u ,v })
c (u )c (v )
addressable priority queue based on pairing heaps
dynamic graph data structure
17
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Local Search
Nodes z unmarked,
z active, marked
active nodes
compute gains of moving
from one block
x
v
u
to another
choose the maximum gain
u
v
when moved
active
marked
can’t become active anymore
unmarked neighbours of marked
active
u
v
18
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Local Search - Stopping Criteria
touching each node on each level
z
z to Ω (n2 )
would lead
runtime
⇒ need flexible stopping criteria
x
v step
u each
gains in
identically
distributed, independent random
variables
u
v
expectation µ
variance σ2
compute µ and σ2 from previous steps
stop after p steps if pµ2 > ασ2 + β
u
v
19
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Results – Example
Street network Europe |V | = 18M , |E | = 44M, k = 16,
KaSPar↔ParMetis
20
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
500
Scalablity
100
50
5
10
20
total time [s]
200
KaPPa−Strong
KaPPa−Fast
KaPPa−Minimal
scotch
kmetis
parmetis
4
8
16
32
64
128
256
512
1024
k
Street network Europe (|V | = 18M , |E | = 44M)
21
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Quality
Comparison with Other Systems
Geometric mean, imbalance e = 0.03:
11 graphs (78K–18M nodes) ×k ∈ {2, 4, 8, 16, 64}
algorithm
KaSPar strong
KaPPa strong
Scotch
kMetis
large graphs
best
avg.
t[s]
12 450 12 584 87.12
13 323
+8% 28.16
14 475
+19%
3.83
15 540
+32%
0.71
Repeating scotch as long as KasPar strong run and choosing
the best result
12.1% larger cuts
Walshaw instances, road networks, Florida Sparse Matrix
Collection, random Delaunay triangulations, random geometric
graphs, social networks.
22
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Sources of Quality Improvement
1. edge ratings
largest effect by far
2. more localized refinement.
Surprise! previous parallelizations caused worse quality
3. better queue selection
4. better matching algorithms
5. more time invested
23
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Future Work
1. try other pairwise improvers (Flows or Diffusion) and try
V-Cycles (or F-Cycles) graph partitioning ⇒ KaFFPa
2. better initial partitioning for large k
3. integration into Meta-heuristic
4. exploit shared memory parallelism
24
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
DIMACS Implementation Challenge
Announcement
someitem
25
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)
Thank you!
26
Nov. 30, 2010
Vitaly Osipov, Peter Sanders, Christian Schulz – Institute for Theoretical Computer Science, Algorithmics II
Engineering State-of-the-Art Graph Partitioning Libraries @KIT
KIT – die Kooperation von Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH)

Similar documents

Engineering Multilevel Graph Partitioning Algorithms

Engineering Multilevel Graph Partitioning Algorithms scalable parallel algorithm for the case k =# of processors large inputs high quality (better (even parallel) than other seq. algorithms) understand / engineer multi level method bridge gaps theory...

More information