• 沒有找到結果。

Usage of Clustering Heuristics

在文檔中 Tutorial on VLSI Partitioning (頁 35-40)

Eq. (84) the solution

5.7.1. Usage of Clustering Heuristics

The usage of clustering heuristics plays an important role in determining the quality of the final results. Inthe following, we discuss the issue in different topics. We use a two-waypartitioning with size constraints asthe target problem.

1.

Top

DownClustering versus Bottom Up Clus-tering:

Top

down clustering approach provides a global view of the solution. The operations are consistent with the target problem. How-ever, it is more time consuming because the clustering operates on the whole circuit [29].

Bottom up clustering is efficient.

However,

be-cause the process operates locally, the target solution is sensitive to the clustering heuristics

[59].

2. The Level of the Clustering: Suppose we rep-resent the clustering results with a hierarchical

tree structure. Let the root correspond to the whole circuit, the leaves correspond to the smallestclusters, and the internal nodes corre-spond to the intermediate clusters. Hence, the size ofthe clusters grows with the level ofthe nodes.

Top

down clustering creates clusters corresponding to nodes in high levels, while bottom up clustering creates clustering corre-sponding to nodesin lowlevels.

For example, in [60], Kernighan and Lin proposed a top down clustering approach, which dividesthe wholecircuit intofour clusters only. In [59], Karypis et al., used a bottom up clustering which starts with clusters of two modules oranet.Ifwecontinuethe application of bottom up clustering on intermediate clus-ters, the quality of the clusters degenerates as the size ofthe clusters growsbigger.

Iteration of Clustering and Unclustering: We go through the iterations of clustering and un-clusteringto improve the quality ofthe results.

Ateachlevel ofthe hierarchical tree,we derive anintermediatetarget solution, e.g., atwo-way partition.Inunclustering,wego down the level of tree hierarchy to find an expanded circuit with more modules. In clustering, we go up the level of tree hierarchy with a circuit of a smallernumberofmodules. The previous parti-tioning result becomesthe initialofthe new par-titioning problem. Note that the hierarchical tree is constructed dynamically. For each clus-tering, the modules can be grouped based on the current partitioning configuration.

The Clustering Operations and the

Target

Solution: The clustering operation has to be consistent with the target solution. For exam-ple, suppose the target is finding a two-way min-cutwith size constraints.Then,itisnatural to cluster modules based on net connectivity because the probability that anet is in an opti-mal cut set is small

(see

the subsection of min-cut with size constraints in problem for-mulations).

Moreover,

it is important that the clustering follows the current partitioning

results, i.e., only modules in the same parti-tion areclustered.

5.7.2.

Top

Down Clustering Approach

for

Partitioning

We use an application to two-way cut with size constraints to illustrate the top down clustering approach [24, 29]. The partitioning ofhuge designs is complicated and the resultscan be erratic. Our strategy (Fig.

29)

is to reduce thecircuit complex-ity by constructing a contracted hypergraph.

The clusters for the contracted hypergraph are searched via a recursive top down partitioning method.The number of modulesis much reduced afterwecontract theclusters. Hence, agroup mig-ration approach can derive excellent two way cut results on the contracted hypergraph with much efficiency. Furthermore, since the clusters are grouped via a top down partitioning, concep-tually aminimum cut onthe hypergraphcan take advantage of the previous results and generate better solutions.

In this section, we describe a top down clus-tering algorithm.

A

ratio cutisadoptedtoperform

the top down clustering process. Other partition approaches can also be used to replace the ratio cut.

A

group migration method is used to find a minimum cut of the contracted hypergraph with size constraint. Finally, we apply a last run of the group migration algorithm to the original circuit to fine tune the result.

Input

a hypergraph

H(V,E),

an integer k for the number of expected clusters, an integer num_of_reps for repetition, and St,

S,

for the size constraints of two resultantsubsets.

1. Initialize tI,

{ V}

and V*= V.

2. Apply ratio cut

[109]

to obtain a partition (A,

A’)

of V* AU

A’.

3. Set

P=(-{V*})U{A,A’}.

Set V* to be a vertexset inPsuch that

S(V*)

maxv/

S(Vi).

4. While

S(V*)

>

((S(

V))/k), repeat

Steps

2, 3.

5. Constructacontractedhypergraph Hr(Vr,

Er).

6. Apply num_of_repstimes of a groupmigration algorithmto

Hr

withthe size constraintsSt, S,.

7. Use the best result from Step 6 to the circuit Has aninitialpartition. Apply a group migra-tion algorithm once to H with the size con-straints

St,

S,.

H(V,E) Construct

C

HF(VF’EF)

--i C2

(_ /

-"(C)- _/// Partition

Hr(Vv,Er)

FIGURE29 Strategyoftopdownclustering.

The choice of cluster number k It was shown

[24]

that thecut count versuscluster numberkis a concave curve. When kis smll, the quality is not as good because thecluster is too coarse. When k is large, there are too many clusters. We lose the benefit ofthe clustering.

For the case that the circuit is large, we may needtoadoptmultiple levels ofclustering to push for the performance and efficiency [58,66].

5.7.3. Bottom

Up

ClusteringApproaches

In this section, we discuss bottom up clustering

[90]

with two applications: linear placement and performance driven designs. We then show two strategies to perform the clustering: maximum matching and maximum pairing. We will demon-strate via examples the advantage of maximum pairing overmaximummatching.

(i) Linear Placement For linear placement, we reduce the complexity of the problem by a bot-tomup clustering approach[53,96,100]. The clus-tering is based on the result of a tentative placement. We adopt a heuristic approach to generate tentative placements throughout itera-tions. In each iteration, we cluster modules only when they are in consecutive order ofthe place-ment. We then construct acontractedhypergraph.

In the next iteration, the heuristic approach gen-eratesthe placement of the contractedhypergraph.

For each iteration, we either grow the size of the clusters or construct new clusters adaptively.

Inspired by the property of the minimum cut separating two modules

(Theorem 3.1),

we use a densityas a measureto findthe cluster.

A

density d(i) at a slot of a linear placement is the total connectivity of nets connecting modules on the different sides oftheslot. Thefollowing algorithm describes the clustering using a given placement.

Eachcluster size is between Land U.

Input

placement P, two parameters L and U.

1. Initializecluster boundary atslotp 1.

2. Scan placement P from slot p toward the right end. Find slot such that

p

+

L<i

<

p

+

Uand densityd(i)is minimum among

d(

p

+ L)

d(p

+ U).

3. Cluster modules between slots p and i. Set p=i+l.

4.

Repeat

Steps 2, 3 until the scan reaches the right end.

Remark The proposed clustering process and the criteria are consistent with the target linear placement application.Thewhole process depends on an efficient andeffectivelinear placement.

(ii) Performance Driven Clustering For perfor-mance driven clustering

[31,

112], nets which con-tribute to the longest delay are termed critical nets. Pins of the critical net are merged to form clusters.

For a special case that the circuit is a directed tree, we can find optimal solution in polynomial time. Let us assume the tree has its leaves at the input andits rootatthe output. Weuseadynamic programming approach to trace from the leaves toward the root. Each module is not traced until all its input modules are processed. For each module, we treat it as a root of a subtree and find the optimal clustering of the subtree. Since all the modules in the subtree except its root have been processed, we can derive an optimal solution of the rootin polynomialtime.

(iii) Maximum Matching The maximum match-ing pairs all modules into

IV[/2

groups simulta-neously.Given ameasurementof pairingmodules, we can find a matching that maximizes the total pairing measurement inpolynomial time.

We can call maximum matching recursively to create clusters of equal sizes.

However,

this strategy may enforceunrelatedpairstomerge. The enforcement will sacrifice the quality of final clustering results.

Example Figure 30 illustrates the clustering be-havior of maximum matching. The circuit con-tains twelve modules ofequal size. The first level maximum matching pairs modules (a,b), (d,e), (g,h), (j,k),

(c,

1), and (f, i). Modules in the first four pairs are strongly connected with their

FIGURE30 Clustering oftwomodulecircuit.

partners.

However,

the last two are not. Module c and have no common nets but are merged because theirchoices are taken by others.

Furthermore, as we proceed to the next level maximum matching, themerge of pairs

(c, l)

and

(f,

i) will enforce grouping modules into cluster

{a,

b,c,j,k,

l}

and cluster {d,

e,f

g,h, i}. If we measurethe quality of the results withclustercost (expression

(26)),

the cost of the two clusters is

,i((C(Vi))/(C(Vi)))=4/12 + 4/12=2/3.

For this

case, we can find a better solution of clusters

{a,

b,c,d,

e,f}

and {g, h,i,j,k,

l}

of which the clustercost is equaltozero.

Figure 31 shows another example of twelve modules with connectivities attached to the nets.

The connectivityis ifnot specified. Figure 3

l(a)

shows an optimum cut with cut count 6.6. If a maximummatching

[61]

criterion is adoptedinthe bottom up clustering approach, then modules with a net of weight 1.1 between them will be merged.

A

minimum cut on the merged modules yields a cut count of 18 (Fig.

31(b)). In

general, a 2n module circuit having a symmetric configu-ration as in Figure 31 will have a cut count of

n2/2

if the maximum matching criterion is ap-pliedtoperformthe clustering; while the optimum solution will have a cut weight of 1.1 xn.

From

this extreme case, we can claim the following theorem:

THEOREM 5.4 There isnoconstant

factor of

error

bound

of

the cut countgenerated by the maximum matching approach,

from

the cut count

of

a

minimum cut.

Proof As

shown in the aboveexample,the factor oferror bound is

(n2/2)/(1.1

x

n) n/2.2,

which is

not a constant.

Q.E.D.

cutweight 6.6

1.1 1.1

(a)

cutweight 18

(b)

FIGURE31 Atwelve moduleexampletodemonstrate maxi-mummatching.

(iv) Maximum Pairing The maximum pairing is similar to maximummatching, except that it does notenforce the matching of all modules. Onlythe top q percent of the modules are paired. Thus, we can avoid the enforced pairing of unrelated modules.

However,

this strategy may causecertain mod-ules to keep on growing and produce very un-even cluster results. Thus, we need to choose a proper cost function that discourages unlimited growth of the cluster size, e.g., cost function

(26).

5.7.4. Variations

of

ClusteringMetric

In

orderto identifygood clusters,weneedto look beyond the direct adjacency between modules.

It is useful if we can also extract the relation be-tween the neighbors’ neighbors, or even several levels of neighbors’ neighbors. The probabilistic gain model of group migration approach is one good example ofsuchapproach [37,

42].

In this section, we will discuss a few different clustering metrics. For the case of k connectivity, we count the number of k-hop paths between two modules.

Or,

we use ananalogy ofa resistive network to check the conductance between the modules. Furthermore, we check beyond the hypergraph and use other information such as the module functions, pin locations, and control signals.

(i) kth Connectivity The number ofk-hop paths between two modules provides a different aspect ofinformation onthe adjacency.

Suppose

the cir-cuithas only two-pinnets. Wecan derive the kth connectivity with sparse matrix multiplication.

Let C be the connectivity matrix with connectiv-ity c/j as its elements at row columnj, and at row j column i, and its diagonal entry

ii:O.

Note thatwe set

co.=O

if there is no net connect-ing modules viand vj.

Let

c!.

tj2) bethe element of the square ofmatrixC

(C2),

and

el.

) be the element of the kth order of

k

(k)

matrixC

(C).

Then wehavecij representing the number of distinct k-hop paths connecting mod-ules viand vj.

(ii) Conductivity We use a resistive network analogy [21,93] to derive the relation between modules.

Suppose

the circuit has only two pin nets. We replace each net eiy with a resistor of conductance ciy.

Hence,

we can view the whole system as a resistive network and derive the conductance between modules. The system con-ductance between two modules vi and

vy

reveals

the adjacencyrelationbetween the two modules.

The network conductance can be derivedusing circuit analysis.

We

can also approximate the

conductance with a random walk approach. In a random network model, we start walking from a module vi.

At

each module Vk, the probability to walk via net ekl to module

v

is proportional to the connectivity, i.e.

(Ckl/-]m Ckm).

We can derive the relation between the random walk and the conductivity

[89]:

2-e

Ce

ho.

@

hji

[El

(100)

oij

where h

o.

denotes the expected number of hops to walk from modules vi and

v,

and aij denotes the conductance between viand

(iii) Similarity of Signatures We can use certain features beyond connectivity for the clustering metric

[88,91].

For example, the index of data bits, sequence of the pins, function of logic, and relation with common control signals can serve as signatures of function blocks in data path designs. All these features form the first level adjacency. Wecan extendthe relation tomultiple levels. For example, two modules connecting a set of modules with strong similarity makes these twomodules similar.

Example

As

shown in Figure32,modules

A

and B are similar in signature because they are of

2 2

A OR B OR

y

3 3

NOR D NOR

FIGURE32 Signatureidentifiesdatastructure.

the same OR function, connected to consecutive bit number atthe samepin location, and control-led by the same control signal at the same pin location.

Modules C and D become similar because module C obtains signal from

A,

module D ob-tains signal from

B,

and modules

A

and B are similar.

在文檔中 Tutorial on VLSI Partitioning (頁 35-40)

相關文件