0021.system partitioning

37
System System Partitioni Partitioni ng ng Kris Kuchcinski Kris Kuchcinski [email protected] [email protected] h.se h.se

Upload: sean-chen

Post on 25-Jun-2015

640 views

Category:

Education


0 download

TRANSCRIPT

Page 1: 0021.system partitioning

System System PartitioningPartitioning

Kris KuchcinskiKris [email protected]@cs.lth.se

Page 2: 0021.system partitioning

PartitioningPartitioning• “He who can properly define and

divide is to be considered a god.”Plato (ca 429-347 BC)

Page 3: 0021.system partitioning

System PartitioningSystem Partitioning• The functionality of a system is implemented with a set

of interconnected system components, such as ASIC’s, memories, CPU’s, buses.

• The designer must solve two problemstwo problems:• select a set of system components (allocation),• partition the system’s functionality among these components

(partitioning).

• The final implementation has to satisfy a set of design constraints, such as:• cost, cost, • performance andperformance and• power consumptionpower consumption

Page 4: 0021.system partitioning

Structural PartitioningStructural Partitioning• First the system components are implemented using

interconnected hardware componentsinterconnected hardware components.

• Partitioning separates the objects into groups, where each group represents a system component.

• Mostly used at lower levels of abstraction for hardware partitioning.

• Satisfies certain constraints (for instance packaging).

• Problems:– size/performance tradeoffs are difficult,– large number of objects.

Page 5: 0021.system partitioning

Functional PartitioningFunctional Partitioning• The system level functionality is partitioned in order to

divide the behavior of the system between multiple components.

• Usually executable model is partitioned and therefore the estimation of parameters and partitioning results is possible.

• Advantages:– size/performance tradeoffs,size/performance tradeoffs,– small number of objects,small number of objects,– hardware/software solutions.hardware/software solutions.

Page 6: 0021.system partitioning

Partitioning GranularityPartitioning Granularity

• Coarse granularityCoarse granularity• deals with

• processes, • subprograms, • blocks of statements,

• typical for system-level synthesis,• deals with a relatively small number of objects.

• Fine granularityFine granularity• performed at operation level,• used during high-level synthesis,• high complexity.

Page 7: 0021.system partitioning

Abstract RepresentationAbstract Representation

• Structure.• Register transfer.• FSM with datapath.

• Control/data-flow graph (CDFG)• appropriate for operation level partitioning (HLS).

• Task• appropriate for system level partitioning.

Page 8: 0021.system partitioning

Task PartitioningTask Partitioning

Page 9: 0021.system partitioning

CDFG PartitioningCDFG Partitioning

Page 10: 0021.system partitioning

System PartitioningSystem Partitioning

Page 11: 0021.system partitioning

Metrics and EstimationsMetrics and Estimations

• ❚ Partitioning algorithms have to rely on a quantitative measure of a candidate solution’s goodness.

• ❚ MetricsMetrics — attributes which characterize a given solution;– they are expressed quantitatively.

• ❚ MetricsMetrics include:– cost, – execution time, – communication rates, – power consumption, – testability,– reliability, – program size,– data size – and memory size.

Page 12: 0021.system partitioning

Metrics and EstimationsMetrics and Estimations• Estimation determines a metric value from

a rough implementation.

• Inaccuracy can be tolerated as long as the relative goodness of any two partitions is determined correctly.

Page 13: 0021.system partitioning

Objective Function and Objective Function and Closeness functionCloseness function

• Objective functionObjective function: • a combination of metrics which captures the

overall overall qualityquality of a certain partitioning.

• Closeness functionCloseness function: • captures the benefit gained from grouping

two objects into the same partition;• it is based on a local local viewview of the system.

Page 14: 0021.system partitioning

• Example

Partitioning ObjectivePartitioning Objective

We want to minimize this function

Page 15: 0021.system partitioning

Example of an Objective Example of an Objective FunctionFunction

We want to minimize this function

Page 16: 0021.system partitioning

Design ConstraintsDesign Constraints

We want to minimize this function

Page 17: 0021.system partitioning

Example of an Objective Example of an Objective FunctionFunction

We want to minimize this function

Page 18: 0021.system partitioning

Closeness FunctionCloseness Function

We want to maximize this function

Page 19: 0021.system partitioning

Partitioning ApproachesPartitioning Approaches

• Manually guided partitioning

• Needs strong support from design environment:– estimation tools & schedulers,– facilities to interactively perform predefined

transformations and to define new ones,– graphical interfaces.

• Automatic partitioning

Page 20: 0021.system partitioning

Automatic PartitioningAutomatic Partitioning

• The partitioning problem is is NP-NP-complete.complete.

• The design space has to be explored according to a certain strategy

• This strategy converges towards a solution close to one which yields the minimal cost.

Page 21: 0021.system partitioning

Automatic Partitioning Automatic Partitioning ApproachesApproaches

• ConstructiveConstructive (clustering)

– bottom up approach: • each object initially belongs to its own cluster, • and clusters are then gradually merged until the

desired partitioning is found;

– does not require a global view of the system– relies only on local relations between objects

(closeness metrics).

Page 22: 0021.system partitioning

Automatic Partitioning Automatic Partitioning Approaches (cont’d)Approaches (cont’d)

• IterativeIterative (transformation-based)– based on a design space exploration which is

guided by an objective functionobjective function that reflects the global quality of the partitioning;

• a starting solution is modified iteratively,

• by passing from one candidate solution to another

• passing is based on evaluations of an objective function.

Page 23: 0021.system partitioning

Hierarchical clusteringHierarchical clustering

• A constructive approach:A constructive approach: – performed in several iterations – with final goal to group a set of objects into partitions

according to some measure of closeness.

• At each iteration the two closest objectstwo closest objects are grouped together; – the process is iterated until a single cluster is

produced.

Page 24: 0021.system partitioning

Hierarchical cluster treeHierarchical cluster tree• The cluster tree contains

• leafsleafs:: original objects• internal nodesinternal nodes:: clustered objects• heightheight:: associated to each non-terminal node;

• reflects the distance between the two objects that have been merged into the corresponding cluster.

• A certain partitioning is selected by cutting the cluster tree with a “cut line”; • each subtree below the cut line becomes one resulting partition.

• The closeness function is defined between the initial objects; • at successive iterations, closeness between different groups of

objects have to be estimated estimated based on the closeness between individual objects.

Page 25: 0021.system partitioning

Example of Hierarchical Clustering Example of Hierarchical Clustering (in this case (in this case

we assume function MAX for labels, but any other function is possible)we assume function MAX for labels, but any other function is possible)

Modify to max

Assume 3 elements in partition

Last slide

3

Page 26: 0021.system partitioning

Transformation Based Transformation Based PartitioningPartitioning

• Transformation based approaches perform different variants of neighborhood searchneighborhood search..

• Neighborhood N(x) of a solution x is a set of solutions that can be reached from x by a simple operation (move).

• Greedy partitioning algorithms have tendency to be trapped in local minima.

• There exist algorithms which help to escape from local minima:– Kernighan-Lin, – Simulated Annealing, – Tabu Search, – Genetic Algorithms,– etc.

Page 27: 0021.system partitioning

Kernighan-Lin AlgorithmKernighan-Lin Algorithm

Replace nodes v1 and v5

Small cost of cut

We do We do some some example example firstfirst

Page 28: 0021.system partitioning

Kerninghan-Lin algorithmKerninghan-Lin algorithm

Page 29: 0021.system partitioning

Kernighan-Lin Algorithm contKernighan-Lin Algorithm cont

Page 30: 0021.system partitioning

Objective Function in Kernighan-Lin Objective Function in Kernighan-Lin AlgorithmAlgorithm

KL and similar algorithmsKL and similar algorithms

Page 31: 0021.system partitioning

Neighborhood Search in KL and Neighborhood Search in KL and similar algorithmssimilar algorithms

Page 32: 0021.system partitioning

Simulated Annealing for generating Simulated Annealing for generating X X nownow

Page 33: 0021.system partitioning

Simulated Annealing may Simulated Annealing may worsen the solution. worsen the solution. Best one must Best one must

be rememberedbe remembered

Page 34: 0021.system partitioning

Software HardwareSoftware Hardware PartitioningPartitioning

• Hardware/software partitioning is very often treated as a particular two way partitioning in which:– performance has to be maximized and – hardware size to be minimized;

• Assumptions:– microprocessor and ASIC working in parallel;– reducing the amount of communication between the

microprocessor and the hardware coprocessor– improves the overall performance of the system.

• Objective: – Maximal performance at a given cost limit.

Page 35: 0021.system partitioning

Hw/Sw Partitioning (cont’d)Hw/Sw Partitioning (cont’d)

• Partitioning is based on metric values derived from:– profiling, – static analysis of the specification, – and cost estimation.

• Performance improvement based on assumption that better performance is obtained if– computation intensive processes are mapped into

hardware,– parallelism is improved,– inter-domain communication is reduced

Page 36: 0021.system partitioning

Summary on paritioning in Summary on paritioning in System level synthesisSystem level synthesis

• The partitioning problem is NP-complete and has to be solved using optimization heuristics.

• Partitioning heuristics are constructive or transformation based.

• Hierarchical clusteringHierarchical clustering is one of the most used constructive approaches.

• Transformational approaches are based on neighborhood search.

• A hardware software partitioninghardware software partitioning for acceleration is done by placing computation intensive processes into hardware, improving parallelism and reducing inter-domain communication.

Page 37: 0021.system partitioning

LiteratureLiterature

• P. Eles, K. Kuchcinski and Z. Peng, System Synthesis with VHDL, Kluwer Academic Publisher, 1998.