eda (cs286.5b) day 11 scheduling (list, force, approximation) n.b. no class thursday (fpga) …
Post on 21-Dec-2015
212 views
TRANSCRIPT
![Page 1: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/1.jpg)
EDA (CS286.5b)
Day 11
Scheduling
(List, Force, Approximation)
N.B. no class Thursday (FPGA) …
![Page 2: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/2.jpg)
Today
• Scheduling– List-Scheduling– Force-Directed– Approximation Algorithms
• Assignment #2– recursive partitioning for energy minimization
![Page 3: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/3.jpg)
Last Time
• Resources aren’t free
• Share to reduce costs
• Schedule operations on resources
• Greedy not optimal
• Optimal solution with Branch-and-Bound
• Lower Bound Pruning
![Page 4: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/4.jpg)
This Time
• Heuristic/non-optimal approaches
• Use to solve quickly
• Use to generate upper bounds – help pruning in alpha-beta search
• Bounds on “badness” of heuristic
![Page 5: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/5.jpg)
Force-Directed
• Problem: how exploit schedule freedom (slack) to minimize instantaneous resources– (time constrained)
![Page 6: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/6.jpg)
Force-Directed
• Given a node, can schedule schedule anywhere between ASAP and ALAP schedule time– latest schedule predecessor and ALAP– ASAP and already scheduled successors
• Scheduling node will limit freedom of nodes in path
![Page 7: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/7.jpg)
Example
![Page 8: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/8.jpg)
Force-Directed
• If everything where scheduled, except for the target node:– examine resource usage in all timeslots allowed
by precedence– place in timeslot which has least increase
maximum resources
![Page 9: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/9.jpg)
Force-Directed
• Problem is don’t know resource utilization during scheduling
• Strategy: estimate resource utilization
![Page 10: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/10.jpg)
Force-Directed Estimate
• Assume a node is uniformly distributed within slack region– between earliest and latest possible schedule
time
• Use this estimate to identify most used timeslots
![Page 11: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/11.jpg)
Example
![Page 12: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/12.jpg)
Force-Directed
• Scheduling a node will shift distribution– all of scheduled node’s cost goes into one
timeslot– predecessor/successors may have freedom
limited so shift their contributions
• Want to shift distribution to minimize maximum resource utilization
![Page 13: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/13.jpg)
Example
![Page 14: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/14.jpg)
Force-Directed
• ASAP/ALAP schedule to determine range of times for each node
• Compute estimated resource usage
• Pick most constrained node– Evaluate effects of placing in feasible time slots
(compute forces)– Place in minimum cost slot and update estimates– Repeat until done
![Page 15: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/15.jpg)
Time
• Evaluate force of putting in timeslot O(NT)
• Evaluate all timeslots can put in O(NT2)
• N nodes to place
• O(N2T2)
![Page 16: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/16.jpg)
List Scheduling
• Keep a ready list of “available” nodes– (one whose predecessors have already been
scheduled)
• Pick an unscheduled task and schedule on next available resource
• Put any tasks enabled by this one on ready list
![Page 17: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/17.jpg)
List Scheduling
• Greedy heuristic
• How prioritize ready list?– Dominant consraint
• least slack (worst critical path)
• enables work
• utilize most precious resource
• Last time:– saw that no single priority scheme would be
optimal
![Page 18: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/18.jpg)
List Scheduling
• Use for – resource constrained– time-constrained
• give resource target and search for minimum resource set
• Fast: O(N) O(Nlog(N)) depending on prioritization
• Simple, general
• How good?
![Page 19: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/19.jpg)
Approximation
• Can we say how close an algorithm comes to achieving the optimal result?
![Page 20: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/20.jpg)
Without Precedence
time
reso
urce
![Page 21: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/21.jpg)
Observe
• Optimal length L
• No idle time up to start of last job to finish
• start time of last job <= L
• last job length <=L
• Total LS length <=2L
• Algorithm is within factor of 2 of optimum
![Page 22: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/22.jpg)
Terminology
• Scheduling of identical parallel machines has a 2-approximation– I.e. we have a polynomial time algorithm which is
guaranteed to achieve a result within a factor of two of the optimal solution.
• In fact, for precedence unconstrained there is a 4/3-approximation– (schedule Longest Processing Time first)
![Page 23: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/23.jpg)
Recover Precedence
• May have idle times, so need to generalize
• Work back from last completed job– two cases:
• entire machine busy
• some predecessor in critical path is running
• Divide into two sets– whole machine busy times– critical path chain for this operator
![Page 24: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/24.jpg)
Precedence
• schedule picture
![Page 25: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/25.jpg)
Precedence Constrained
• All busy times < Optimal Length– Optimal Length > Resource Bound– Resource Bound > All busy
• This path < Optimal Length– Optimal Length > Critical Path– Critical Path >= This Path
• List Schedule <= 2 *(Optimal Length)
![Page 26: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/26.jpg)
Tighten
• LS schedule Critical Path+Resource Bound
• LS schedule Min(CP,RB)+Max(CP,RB)
• Optimal schedule Max(CP,RB)
• LS/Opt 1+Min(CP,RB)/Max(CP,RB)
• The more one constraint dominates– the closer the approximate solution to optimal
![Page 27: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/27.jpg)
Multiple Resource
• Previous result for homogeneous functional units
• For heterogeneous resources:– also a 2-approximation
• Lenstra+Shmoys+Tardos, Math. Programming v46p259
• (not online)
![Page 28: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/28.jpg)
Bounds
• No precedence case– no polynomial approximation algorithm can
achieve better than 4/3 bound
• Precedence case– no polynomial approximation algorithm can
achieve better than 3/2 bound
![Page 29: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/29.jpg)
Other Approaches
• Graph Coloring
• ILP
• Annealing
![Page 30: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/30.jpg)
Summary
• Heuristic approaches to schedule– Force-directed– List Scheduling
• We can, sometimes, bound the “badness” of a heuristic– get a tighter result based on gross properties of
the problem– approximation algorithms often a viable
alternative to finding optimum– play role in knowing “goodness” of solution
![Page 31: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/31.jpg)
Today’s Big Ideas:
• Exploit freedom in problem to reduce costs– (slack in schedules)
• Technique: estimation/refinement• Use dominating effects
– (constrained resources)– the more an effect dominates, the “easier” the
problem
• Technique: Approximation
![Page 32: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/32.jpg)
Assignment #2
• Observation:– Energy in wires– Switching probability varies among nets
• Hypothesis: an important part of minimizing energy is to localize highly active notes
![Page 33: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/33.jpg)
Dominant Power
65%
21%
9% 5%
InterconnectClockIOCLB
XC4003A data from Eric Kusse (UCB MS 1997)
![Page 34: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/34.jpg)
Assignment #2
• Goal: Recursively partition netlist minimizing energy
• Model:– E=Activity*(fixed+F(distance)))– F(distance)= C(part_size)– (pull out fixed as unchanging)
![Page 35: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/35.jpg)
Cost Example
E=A*(C(L1)+C(L2)+ C(L3)+C(L4)+ C(L3)+C(L2)+ C(L1))
![Page 36: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/36.jpg)
Provided
• Parse/represent netlist
• Read activities
• Represent technology (cost at level)
• Represent partitions
• Calculate spectral partitions (io based)
• Calculate cost of partition
• Sample netlists
![Page 37: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/37.jpg)
Your Task
• Devise/implement an algorithm to develop recursive partition– class: FM, maxflow, spectral, simulated
annealing...
![Page 38: EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …](https://reader030.vdocuments.us/reader030/viewer/2022032521/56649d5c5503460f94a3b1d2/html5/thumbnails/38.jpg)
Example
• Show sample use of existing framework...