slides
slides
slides
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Hardware/Software Codesign9. Allocationdoc. dr. Gregor PapaJožef Stefan International PostgraduateSchool9-1Integer programming modelsIngredients:• Cost function• ConstraintsInvolving linear expressions ofinteger variables from a set XCost function C = ∑aixiwithai∈R,xi∈ N N (1)∑x ∈XiConstraints: ∀j∈ J b x ≥ c with b , c ∈ (2):i, j i j i,j jRx ∈XiDef.: The problem of minimizing (1) subject to the constraints(2) is called an integer (linear) programming (ILP) problem.If all x i are constrained to be either 0 or 1, the IP problem saidto be a 0/1 integer (linear) programming problem.9-2R1
ExampleC = 5x+ xx1x , x1+ x21+ 6x242, x+ x333≥ 2∈ {0,1}COptimal9-3Remarks on integer programming• Maximizing the cost function: just set C‘=-C• Integer programming is NP-complete.• Running times depend exponentially on problem size,but problems of >1000 vars solvable with good solver(depending on the size and structure of the problem)• The case of x i ∈ R is called linear programming (LP).LP has polynomial complexity, but most algorithms areexponential, still in practice faster than for ILP problems.• The case of some x i ∈ R and some x i ∈ N is called mixedinteger-linear programming.• ILP/LP models can be a good starting point for modeling, evenif in the end heuristics have to be used to solve them.9-42
Simulated Annealing• General method for solving combinatorialoptimization problems.• Based the model of slowly cooling crystal liquids.• Some configuration is subject to changes.• Special property of Simulated annealing: Changesleading to a poorer configuration (with respect tosome cost function) are accepted with a certainprobability.• This probability is controlled by a temperatureparameter: the probability is smaller for smallertemperatures.9-5Explanation•Initially, some random initial configuration is created.•Current temperature is set to a large value.•Outer loop:• Temperature is reduced for each iteration• Terminated if (temperature ≤ lower limit) or(number of iterations ≥ upper limit).•Inner loop: For each iteration:• New configuration generated from current configuration• Accepted if (new cost ≤ cost of current configuration)• Accepted with temperature-dependent probability if(cost of new config. > cost of current configuration).9-63
Multiobjective OptimizationMaximize (y1, y2, …, yk) = ƒ(x1, x2, …, xn)y2y2Pareto optimal = not dominatedbetterincomparabledominatedworseincomparabley1y1Pareto set = set of all Pareto-optimal solutions9-7SummarySingle objective optimization methods• decision is performed during optimization• Examples: integer programming, simulated annealingMultiple objective optimization methods• decision is done after optimization• Example: Evolutionary algorithms• Refer to publications of Thiele or Schwefel et al. for moreinformationConcept of Pareto points• eliminates large set of non-relevant design points• allows separating optimization and decision9-84
Improving predictability for caches•Loop caches•Mapping code to less used part(s) of the index space•Cache locking/freezing•Changing the memory allocation for code or data•Mapping pieces of software to specific waysMethods:- Generating appropriate way in software- Allocation of certain parts of the address space to a specific way- Including way-identifiers in virtual to real-address translation“Caches behave almost like a scratch pad”9-9Summary• Allocation strategies for SPM• Dynamic sets of processes• Multiprocessors• MMUs• Sharing between SPMs in a multi-processor• Optimizations for Caches• Code Layout transformations• Way prediction9-105