Download presentation
Presentation is loading. Please wait.
Published byBrittany White Modified over 9 years ago
1
Partitioning
2
1 st homework: Deadline: 13 Esfand 2
3
Partitioning PROBLEM: Large complex systems: Break up into smaller subsystems Called partitioning Requirements for a good partition −Original functionality of the system is not changed −Minimize the interconnection between subsystems −Process should be simple and efficient 3
4
Partitioning Issues Each subsystem can be designed independently − → speeding up the design process 4 60 IPs 2 60 = 32000 years6 x 2 10 = 5 ms 10 IPs
5
Partitioning Issues Decomposition scheme has to minimize the interconnections between subsystems. Decomposition may be carried out hierarchically until each subsystem is of manageable size. 5
6
Circuit: Cut c a : four external connections 1 2 4 5 3 6 7 8 5 6 4 8 7 2 3 1 5 6 4 8 7 2 3 1 Cut c a Cut c b Block ABlock B Block ABlock B Cut c b : two external connections Introduction 6
7
Circuit Example Start with a circuit of 48 logic gates: Partition 1 – 4 lines 15 gates Partition 2 – 4 lines 16 gates Partition 3 – 17 gates 7
8
System Hierarchy 8
9
Levels of Partitioning System Level Partitioning Board Level Partitioning Chip Level Partitioning System PCBs Chips Subcircuits / Blocks 9
10
System Level Partitioning Objectives: Optimize the system performance. Minimize the no. of boards. Constraints: Board size is fixed. Terminal count on each board is fixed. 10 System PCBs
11
Board Level Partitioning Objectives: Minimize the interchip connections. Optimize the performance and reliability by minimizing the no. of chips. Constraints: Chip size Terminal count on a chip Multi-FPGA Design 11 PCBs Chips
12
Chip Level Partitioning Objectives: Minimizing the no. of nets cut by the partitioning. Avoid cutting critical nets by the partitioning. Constraints: Terminal counts 12 Chips Subcircuits / Blocks
13
Graph Partitoining: Terminology 5 6 4 2 1 3 3 2 4 56 1 Graph G 2 : Nodes 1, 2, 6. Graph G 1 : Nodes 3, 4, 5. Collection of cut edges Cut set: (1,3), (2,3), (5,6), Block (Partition) Cells 13
14
Delays in Different Partitions 14
15
Problem Formulation يک hypergraph G = (V, E) شامل گره هاي V = {v1, …, vn} و hyperedge هاي E = {e1, …, em} ( که هر ei V) ، V را طوري تقسيم کنيد که : V i V j = , i j V i V j = V Cut: مرز بخشها. Cut size: تعداد يالهاي قطع کنندة cut. 15
16
Objective Functions pipi 16
17
Constraints 17
18
Constraints TSV (Through Silicon Vias) in 3D chips Ababei, Mogal and Kia Bazargan, “Three-dimensional Place and Route for FPGAs,” TCAD 2005. www.micromagic.com 18
19
Constraints: Area Bounded-Size Partitioning: A i min ≤ Area(V i ) ≤ A i max Balanced Partitioning: 19
20
Scope of the Problem [©Rutenbar] 20
21
Multi-Terminal Nets مدلسازي بر حسب two-terminal nets: 1) complete graph: اشکال : تعداد زياد يالها غير واقعي است. حسن : تقارن net. 21
22
Multi-Terminal Nets (2 Spanning tree: حسن : در نهايت، يک درخت براي net کافي است. اشکال : از قبل نمي دانيم کدام درخت بهترين است. 22
23
مسائل خاص هر سبک طراحي Full-custom: محدوديت cut size: محيط نهايي partition i ام Pitch size مي تواند hierarchical باشد. مساحت کل = مجموع مساحت اجزا + مجموع مساحت routing + مساحتهاي تلف شده. ثابت اگر cutsize ها را کم کنيم، به احتمال زياد کم مي شود. کيفيت placement آن را تعيين مي کند. 23
24
مسائل خاص هر سبک طراحي Standard Cell ، Gate Array و FPGA: هدف : طوري مدار partition شود که cut size حداقل شود 24
25
تقسيم بندي الگوريتمها Constructive Iterative Improvement Partitioning Algorithms 25
26
تقسيم بندي الگوريتمها Deterministic Stochastic Partitioning Algorithms 26
27
تقسيم بندي الگوريتمها Simulation- Based Group Migration Partitioning Algorithms Multi-Level …. 27
28
Example Given this set of components Divide it into 3 parts 4 logic cells per segment −Lots of solutions but only 1 optimal ABCD EFGH IJKL 1 1 4 4 2 2 2 6 6 6 5 510 11 12 3 3 9 99 888 7 7 7 28
29
Solution Minimum number of external connections: AB CL DF HI EG JK 1 2 26 6 4 4 5 5 10 11 9 3 8 12 7 PROBLEM: How to find this solution? 29
30
Constructive Partitioning Constructive Partitioning: Uses a set of rules to find a solution −Most straightforward: seed growth (cluster growth) Steps: 1.Start a new partition: a seed cell 2.Among all cells not yet in a partition, select one at a time. 3.Calculate a gain function, g(m): −the benefit of adding cell m to the current partition −perhaps the number of connections between m and the cells in the current partition) 4.Add the cell with max gain to the current partition 5.If not reach the size limit, −Then repeat from step 2. −Else start a new partition from step 1. 30
31
EXAMPLE Given the 12 logic cell structure (A to L) on the previous slide find a partition into 3 sets with 4 cells per set use the gain function g(m) defined as: −let P(m) be the number of nets (not connections) from cell m to the current partition −let N(m) be the number of nets from m to cells not yet in partitions −then g(m) = P(m) - N(m) select cell C as the seed 31
32
Partition Table 1 Set up a table for bookkeeping to keep track of the gain at each step - label the final partitions X, Y, and Z Pass A B C D E F G H I J K L 1 ABCD EFGH IJKL 1 1 4 4 2 2 2 6 6 6 5 510 11 12 3 3 9 99 888 7 7 7 C X 0-2 = -2 A 1-2 = D 0-2 = -2 -3 -5 -2 -3 -2 L A BDB D 32
33
Partition Table 2 Pass A B C D E F G H I J K L ABCD EFGH IJKL 1 1 4 4 2 2 2 6 6 6 5 510 11 12 3 3 9 99 888 7 7 7 C L 2 0-2 1-2 0-2 2-4 0-5 1-2 0-2 0-3 0-2 -2 -5 -2 -3 -2 3 0-2 1-2 0-2 2-3 0-5 0-2 0-3 1-3 1-2 -2 -2 -5 -2 -3 -2 G E 33
34
Partition Table 3 ABCD EFGH IJKL 1 1 4 4 2 2 2 6 6 6 5 510 11 12 3 3 9 99 888 7 7 7 C L GE Pass A B C D E F G H I J K L 1 1-1 0-2 1-1 X 0-2 2-2 0-3 0-2 0 -2 0 0 -3 -2 F 2 1-1 0-2 1-1 X 1-3 1-2 0 -2 0 0 I 3 X 1-2 1-1 1-3 1-2 0 0 -2 A D 34
35
RESULT The final partition has 8 external connections (1,2,5,7,8,9,11,12) worse than the other solution (5 connections) perhaps starting with a different seed cell improve the result AD IF BH JK CG EL 1 2 6 4 5 10 11 9 3 8 12 7 111 5 9 8 2 12 35
36
Iterative Partition Constructive Partitioning can produce suboptimal results Iterative partitioning algorithm is often used to improve the final partition −E.g., swapping logic cells or (or groups of logic cells) Group migration methods: mostly based on the Kernighan-Lin Algorithm (K-L Algorithm) divide a graph into two segments (min-cut problem). 36
37
Iterative Improvement Constructive Algorithm Iterative Improvement no yes Termination Criterion Met? Return Best-Seen Solution Problem Instance Initial Solution 37
38
Kernighan-Lin Algorithm “An Efficient heuristic Procedure for Partitioning Graphs”, Kernighan and Lin, The Bell System Technical Journal, 49(2):291-307, 1970. 38
39
K-L Algorithm Start with a network already split into two partitions, A and B each with m nodes. Define c ab to be the weight of the connection between nodes a and b c ab = 1 if there is a connection and 0 if there is not The cut cost is W where: 1 2 3 4 5 6 7 8 9 10 39
40
Definitions For any node a in partition A, the external edge cost measures the connections from node a to B In the example I 1 = 0 and I 3 =2 The internal edge cost measures the internal connections to a In the example E 1 = 1 and E 3 = 0 1 2 3 4 5 6 7 8 9 10 40
41
Definitions The cost difference is the difference between external and internal edge costs 1 2 3 4 5 6 7 8 9 10 41
42
Gain Function Select any node in A and any node in B if we swap these nodes, a and b, we need to measure the reduction in the cut weight which is the gain g given below: As a and b may be connected 42
43
K-L Algorithm The K-L Algorithm finds a group of node pairs to swap which increases the gain STEPS 1)Find two nodes a i from A and b i from B so that the gain from swapping them is maximum 2)Next pretend to swap a i and b i (even if the gain is 0 or negative) 3)Lock them. 4)Repeat steps 1 and 2 until all the nodes of A and B pretend swapped. 5)Now we can select which nodes to actually swap. Suppose we only swap the first n pairs of nodes found in the above steps. The total gain would be G n (see below), so select the n which maximizes G n 43
44
Iterative Process If the maximum value of G n > 0 then the n node pairs are swapped K-L is applied to this new partition If the maximum value of G n ≤ 0 then we stop 44
45
Example Given the graph below, its initial partition has 4 external edges Calculate the gain from swapping all pairs of nodes (there are 25 pairs) 1 2 3 4 5 6 7 8 9 10 Node E I D 1 1 0 1 2 2 0 2 3 0 2 -2 4 1 1 0 5 0 1 -1 6 1 0 1 7 1 1 0 8 2 1 1 9 0 2 -2 10 0 2 -2 Pair g 1,6 1 + 1 - 0 = 2 1,7 1 + 0 - 2 = -1 1,8 1 + 1 - 0 = 2 1,9 1 - 2 - 0 = -1 1,10 1 - 2 - 0 = -1 2,6 2 + 1 - 2 = 1... This is the best 45
46
First Swap Swap 1 and 6 (fake) for a gain of 2 Redo the process with the new graph 6 2 3 4 5 1 7 8 9 10 Node E I D 2 1 1 0 3 0 2 -2 4 1 1 0 5 0 1 -1 7 0 1 -1 8 2 1 1 9 0 2 -2 10 0 2 -2 Pair g 2,7 0 - 1 - 0 = -1 2,8 0 + 1 - 2 = -1 2,9 0 - 2 - 0 = -2 2,10 0 - 2 - 0 = -2 3,7 -2 - 1 - 0 = -3... 5,8 -1 + 1 - 0 = 0... This is the best 46
47
Second Swap Swap 5 and 8 for a gain of 0 Continue this process, the third and fourth swaps will also have a gain of 0 and the final swap will have a gain of -2. As the gains from each swap are summed they max out at the first swap so keep the swap of 1 and 6 and repeat this process on the new partition. 6 2 3 4 8 1 7 5 9 10 47
48
End of First Iteration Cut Size gigi Node Pair i 4---0 222(1, 6)1 220(5, 8)2 2203 40-24 Find maximum and exchange (actually) up to that point. 48
49
Another Case Cut Size gigi Node Pair i 4---0 222(1, 6)1 31(5, 8)2 0433 22-24 49
50
Kernighan & Lin Partitioning If sum to m > 0, some gain, so repeat until sum to m=0 i 123 m n [©Newton] 50
51
KL Algorithm -2c ab 51
52
Computational Complexity For 2n nodes Initial computation of the D’s takes O(n 2 ) For each pass: For i = 1 to n: Compute the gain for all free pairs takes O(n 2 ) - After swapping a i and b i in move i, at most (2n-2i) gains of free nodes are updated - For n moves: Pair comparison in move i : (n-i+1) 2 = O(n 2 ) pairs to choose from: For n pairs comparison: i=1,…,n n-2i) = O(n 2 ) i=1,…,n (n-i+1) 2 = O(n 3 ) 52
53
Computational Complexity Tentative Exchange, Lock, Log take O(1), total time = # of passes O(n 3 ) # of passes: usually constant (independent of n) In practice: improvement almost nothing after 4 passes To speedup pair comparison: node pairs can be sorted ahead of time O(n 2 log n) 53
54
KL Algorithm Drawbacks: Unable to handle hyperedges. Partition sizes must be given in advance. But can handle unequal sizes Unable to handle vertex weights. Can assign unit area = gcd (cell_areas) edge weight s= infinity Time complexity: high = O(n 3 ) 54
55
KL Algorithm Advantages: Simple. Performs well for up to ~10 2 nodes can handle constraints as having some blocks together (e.g. components of an adder) 55
56
KL Software Package A software package : available from the class site.software package It will allow you to −enter a connection matrix −set up an initial partition −run KL 56
57
Main Screen Make or Load Adjacency matrix Then select GIP Then Run 57
58
Enter a Matrix Enter the size and then the connection matrix 58
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.