Lecture3 Partition
Lecture3 Partition
10/22/08 1
Survey # 1 Results
❁ Most of you prefer (2) and (3)
❁ Most of you plan to spend “much time”
❁ Some suggestions (not much yet )
❁ examples
❁ provide industry perspectives
❁ can choose project topics
2
System Hierarchy
3
Levels of Partitioning
System
System Level Partitioning
PCBs
Board Level Partitioning
Chips
5
Importance of Circuit Partitioning
❁Divide-and-conquer methodology
The most effective way to solve problems of high complexity
E.g.: min-cut based placement, partitioning-based test generation,…
❁System-level partitioning for multi-chip designs
inter-chip interconnection delay dominates system performance.
❁Circuit emulation/parallel simulation
partition large circuit into multiple FPGAs (e.g. Quickturn), or
multiple special-purpose processors (e.g. Zycad).
❁Parallel CAD development
Task decomposition and load balancing
❁In deep-submicron designs, partitioning defines local and global
interconnect, and has significant impact on circuit performance
…… ……
6
Some Terminology
7
Circuit Representation
• Netlist: B
– Gates: A, B, C, D A
– Nets: {A,B,C}, {B,D}, {C,D}
C D
• Hypergraph:
– Vertices: A, B, C, D
– Hyperedges: {A,B,C}, {B,D}, {C,D}
B
– Vertex label: Gate size/area A
– Hyperedge label:
Importance of net (weight)
C D
8
Circuit Partitioning Formulation
Bi-partitioning formulation:
Minimize interconnections between partitions
c(X,X’)
X X’
9
A Bi-Partitioning Example
a c 100 e
100 100
100 100
9
min-cut
4
b 10 d 100 f
mini-ratio-cut min-bisection
Min-cut size=13
Min-Bisection size = 300
Min-ratio-cut size= 19
∑a(v) ≤ A i
v ∈Ni
11
Partitioning Algorithms
12
Iterative Partitioning Algorithms
❁Simulated Annealing
[Kirkpartrick-Gelatt-Vecchi 1983]
[Greene-Supowit 1984]
13
Kernighan-Lin Algorithm
“An Efficient Heuristic Procedure for
Partitioning Graphs”
The Bell System Technical Journal
49(2):291-307, 1970
10/22/08 14
Restricted Partition Problem
• Restrictions:
– For Bisectioning of circuit.
– Assume all gates are of the same size.
– Works only for 2-terminal nets.
Hypergraph Graph
Representation C D Representation C D
15
Problem Formulation
• Input: A graph with
– Set vertices V. (|V| = 2n)
– Set of edges E. (|E| = m)
– Cost cAB for each edge {A, B} in E.
• Output: 2 partitions X & Y such that
– Total cost of edges cut is minimized.
– Each partition has n vertices.
16
A Trivial Approach
• Try all possible bisections. Find the best one.
• If there are 2n vertices,
# of possibilities = (2n)! / n!2 = nO(n)
17
Idea of KL Algorithm
• DA = Decrease in cut value if moving A
– External cost (connection) EA – Internal cost IA
– Moving node a from block A to block B would increase the value of
the cutset by EA and decrease it by IA
X B Y X B Y
C
C
A D A D
DA = 2-1 = 1
DB = 1-1 = 0
18
Idea of KL Algorithm
• Note that we want to balance two partitions
• If switch A & B, gain(A,B) = DA+DB-2cAB
– cAB : edge cost for AB
X B Y X B Y
C C
D
A A D
gain(A,B) = 1+0-2 = -1
19
Idea of KL Algorithm
• Start with any initial legal partitions X and Y.
• A pass (exchanging each vertex exactly once) is
described below:
1. For i := 1 to n do
From the unlocked (unexchanged) vertices,
choose a pair (A,B) s.t. gain(A,B) is largest.
Exchange A and B. Lock A and B.
Let gi = gain(A,B).
2. Find the k s.t. G=g1+...+gk is maximized.
3. Switch the first k pairs.
• Repeat the pass until there is no improvement (G=0).
20
Example
X Y X Y
1 4 4 1
2 5
2 5
3 6 3 6
21
Time Complexity of KL
• For each pass,
– O(n2) time to find the best pair to exchange.
– n pairs exchanged.
– Total time is O(n3) per pass.
• Better implementation can get O(n2log n) time per
pass.
22
Recap of Kernighan-Lin’s Algorithm
❁Pair-wise exchange of nodes to reduce cut size
❁Allow cut size to increase temporarily within a pass
Compute the gain of a swap
Repeat
Perform a feasible swap of max gain u• v•
Mark swapped nodes “locked”;
v• u•
Update swap gains;
Until no feasible swap; locked
Find max prefix partial sum in gain sequence g1, g2,
…, gm
Make corresponding swaps permanent.
24