Presentation is loading. Please wait.

Presentation is loading. Please wait.

Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 1 Hardware/Software Codesign of Embedded Systems OPTIMIZATION Voicu Groza.

Similar presentations


Presentation on theme: "Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 1 Hardware/Software Codesign of Embedded Systems OPTIMIZATION Voicu Groza."— Presentation transcript:

1 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 1 Hardware/Software Codesign of Embedded Systems OPTIMIZATION Voicu Groza SITE Hall, Room 5017 562 5800 ext. 2159 Groza@SITE.uOttawa.ca

2 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 2 Dominance, Pareto Points A (design) point J k is dominated by J i, if J i is –better or equal than J k in all criteria and –better in at least one criterion. A point is Pareto-optimal or a Pareto-point, if it is not dominated. The domination relation imposes a partial order on all design points –We are faced with a set of optimal solutions. –Divergence of solutions vs. convergence.

3 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 3 Multiobjective Optimization Maximize (y 1, y 2, …, y k ) = ƒ(x 1, x 2, …, x n ) Pareto set = set of all Pareto-optimal solutions

4 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 4 Multi-objective Optimization

5 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 5 Design Space, Pareto Points The task graph shows a system specification with four tasks, T1...T4. The tasks can be executed on different components. The following table displays the execution times for the tasks on the different components as well as the component cost. For example, the MIPS processor costs 200 units and can run tasks T1 in 5 ms and task T4 in 2 ms. The table shows also the number of components available for each component type (MIPS, DSP, FPGA and ASIC). All components execute tasks sequentially – at any given time a component executes at most one task. Task execution is non- preemptive – once a task is started, it runs to completion.

6 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 6 A design point consists of an allocation (selection of components), a binding (assignment of tasks to selected components) and a schedule (execution order for the tasks). Determine the total cost and execution time for each design point. Pareto Points (a) Construct the design space by listing all possible design points. (b) Draw the design points in a cost-time diagram. Which design points are Pareto points? T 1 T 2 T 3 T 4 Cost t exec cost t exec (ms)

7 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 7 Pareto Points (c) Consider an allocation without resource constraints. That means we are given an arbitrarily high number of components of each type (MIPS, DSP, FPGA and ASIC). Are there new design points? Does the set of Pareto points change? T 1 T 2 T 3 T 4 Cost t exec cost t exec

8 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 8 Genetic Algorithms Directed search algorithms based on the mechanics of biological evolution Developed by John Holland, University of Michigan (1970’s) –To understand the adaptive processes of natural systems –To design artificial systems software that retains the robustness of natural systems Provide efficient, effective techniques for optimization and machine learning applications Widely-used today in business, scientific and engineering circles

9 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 9 Classes of Search Techniques

10 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 10 Components of a GA A problem to solve, and... Encoding technique (gene, chromosome) Initialization procedure (creation) Evaluation function (environment) Selection of parents (reproduction) Genetic operators (mutation, recombination) Parameter settings (practice and art)

11 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 11 GA Algorithmic Phases Initialize the population Initialize the population Select individuals for the mating pool Perform crossover Insert offspring into the population The End Perform mutation yes no no Stop? Chromosome Gene Locus Population Phenotype

12 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 12

13 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 13 Simple Genetic Algorithm { initialize population; evaluate population; while TerminationCriteriaNotSatisfied { select parents for reproduction; perform recombination and mutation; evaluate population; }

14 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 14 The GA Cycle of Reproduction reproduction population evaluation modification discard deleted members parents children modified children evaluated children

15 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 15 Population Chromosomes could be: –Bit strings (0101... 1100) –Real numbers (43.2 -33.1... 0.0 89.2) –Permutations of element (E11 E3 E7... E1 E15) –Lists of rules (R1 R2 R3... R22 R23) –Program elements (genetic programming) –... any data structure... population

16 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 16 Reproduction reproduction population parents children Parents are selected at random with selection chances biased in relation to chromosome evaluations.

17 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 17 Chromosome Modification modification children Modifications are stochastically triggered Operator types are: –Mutation –Crossover (recombination) modified children

18 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 18 Mutation: Local Modification Before: (1 0 1 1 0 1 1 0) After: (0 1 1 0 0 1 1 0) Before: (1.38 -69.4 326.44 0.1) After: (1.38 -67.5 326.44 0.1) Causes movement in the search space (local or global) Restores lost information to the population The Mutation Rate is the chance that a bit within a chromosome will be flipped. This is usually a very low value for binary encoded genes, say 0.001

19 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 19 O ne point crossover is performed by selecting a random gene along the length of the chromosomes and swapping all the genes after that point 10001001110010010 01010001001000011 Crossover is a critical feature of genetic algorithms: –It greatly accelerates search early in evolution of a population –It leads to effective combination of schemata (subsolutions on different chromosomes) The Crossover Rate is the chance that two chromosomes will swap their bits. A good value for this is around 0.7. Crossover: Recombination * 10001001101000011 01010001010010010

20 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 20 Two point crossover Two point crossover calls for two points to be selected on the parent chromosome strings. Everything between the two points is swapped between the parent organisms, rendering two child organisms: "Cut and splice" Another crossover variant, the "cut and splice" approach, results in a change in length of the children strings. The reason for this difference is that each parent string has a separate choice of crossover point.

21 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 21 Evaluation The evaluator decodes a chromosome and assigns it a fitness measure The evaluator is the only link between a classical GA and the problem it is solving evaluation evaluated children modified children

22 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 22 Fitness Function Quantifies the optimality of a solution (a chromosome) such that particular chromosome may be ranked against all the other chromosomes. Optimal chromosomes, are allowed to breed and mix their datasets producing a new generation that will (hopefully) be even better. An ideal fitness function correlates closely with the algorithm's goal, and may be computed quickly. Speed of execution is very important, as a typical genetic algorithm must be iterated many, many times in order to produce a usable result for a non-trivial problem. Definition of the fitness function is not straightforward in many cases and often is performed iteratively if the fittest solutions produced by GA are not what is desired.

23 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 23 Deletion Generational GA: entire populations replaced with each iteration Steady-state GA: a few members replaced each generation population discard discarded members

24 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 24 Stopping Criteria Final problem is to decide when to stop execution of algorithm. There are two possible solutions to this problem: –First approach: Stop after production of definite number of generations –Second approach: Stop when the improvement in average fitness over two generations is below a threshold

25 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 25 An Abstract Example Distribution of Individuals in Generation 0 Distribution of Individuals in Generation N Rennard Genetic Algorithm Viewer 1.0 http://www.rennard.org/alife/english/gavgb.html

26 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 26 A Simple Example The Traveling Salesman Problem: Find a tour of a given set of cities so that –each city is visited only once –the total distance traveled is minimized

27 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 27 Representation Representation is an ordered list of city numbers known as an order-based GA. 1) London 3) Dunedin 5) Beijing 7) Tokyo 2) Venice 4) Singapore 6) Phoenix 8) Victoria CityList1 (3 5 7 2 1 6 4 8) CityList2 (2 5 7 6 8 1 3 4)

28 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 28 Crossover Crossover might combine inversion & recombination; e.g. given two chromosomes * * Parent1 (3 5 7 2 1 6 4 8) Parent2 (2 5 7 6 8 1 3 4) Child (8 5 7 2 1 6 3 4)

29 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 29 Mutation involves reordering of the list: * Before: (5 8 7 2 1 6 3 4) After: (5 8 6 2 1 7 3 4) the Crossover Rate is the chance that two chromosomes will swap their bits. A good value for this is around 0.7 Mutation

30 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 30 TSP Example: 30 Cities

31 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 31 Solution i (Distance = 941)

32 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 32 Solution j (Distance = 800)

33 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 33 Solution k (Distance = 652)

34 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 34 Best Solution (Distance = 420)

35 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 35 Overview of Performance

36 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 36 GA For Optimal Implementation of Logic Functions in FPGAs 1.Attempting to evolve the minimized logic solution of a logic function 2.The evolution is done through a hardware implementation of a genetic algorithm (GA), while the minimization is one of FPGA look-up tables (LUTs) and logic levels

37 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 37 System Architecture Optimizer = ECP Controller (ECPC) Host = ECP Both optimizer and host are PLDs Optimizer is where function is evolved Host is where circuit is tested Optimizer/Host = Server/Client Multiple hosts can connect to one optimizer Multiple functions can be evolved on one optimizer

38 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 38 Optimizer Module 1. HIGA (HW implemented GA) Much faster because done mostly in H/W Adds caveats on the std. GA 2. ECLBs Evolvable Configuration Logic Blocks Where the chromosomes are evaluated for fitness assignment 1. hcache Common DB for future use

39 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 39 Optimizer Architecture

40 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 40 System Operation

41 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 41 Figure 5 System Operation (2)

42 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 42 FPGA

43 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 43 Figure 7

44 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 44 Figure 8

45 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 45 Issues for GA Practitioners Choosing basic implementation issues: –representation –population size, mutation rate,... –selection, deletion policies –crossover, mutation operators Termination Criteria Performance, scalability Solution is only as good as the evaluation function (often hardest part)

46 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 46 Benefits of Genetic Algorithms Concept is easy to understand Modular, separate from application Supports multi-objective optimization Good for “noisy” environments Always an answer; answer gets better with time Inherently parallel; easily distributed

47 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 47 Benefits of Genetic Algorithms (cont.) Many ways to speed up and improve a GA-based application as knowledge about problem domain is gained Easy to exploit previous or alternate solutions Flexible building blocks for hybrid applications Substantial history and range of use

48 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 48 When to Use a GA Alternate solutions are too slow or overly complicated Need an exploratory tool to examine new approaches Problem is similar to one that has already been successfully solved by using a GA Want to hybridize with an existing solution Benefits of the GA technology meet key problem requirements

49 Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 49 Some GA Application Types


Download ppt "Voicu Groza, 2008 SITE, 2008 - HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS 1 Hardware/Software Codesign of Embedded Systems OPTIMIZATION Voicu Groza."

Similar presentations


Ads by Google