CALTECH CS137 Fall DeHon 1 CS137: Electronic Design Automation Day 20: November 23, 2005 Scheduling Variants and Approaches.

Slides:



Advertisements
Similar presentations
© 2004 Wayne Wolf Topics Task-level partitioning. Hardware/software partitioning.  Bus-based systems.
Advertisements

CALTECH CS137 Fall DeHon 1 CS137: Electronic Design Automation Day 19: November 21, 2005 Scheduling Introduction.
ECE 667 Synthesis and Verification of Digital Circuits
CALTECH CS137 Fall DeHon 1 CS137: Electronic Design Automation Day 22: December 2, 2005 Routing 2 (Pathfinder)
Traveling Salesperson Problem
EDA (CS286.5b) Day 10 Scheduling (Intro Branch-and-Bound)
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 8: February 11, 2015 Scheduling Introduction.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 14: March 3, 2004 Scheduling Heuristics and Approximation.
5-1 Chapter 5 Tree Searching Strategies. 5-2 Satisfiability problem Tree representation of 8 assignments. If there are n variables x 1, x 2, …,x n, then.
Branch & Bound Algorithms
Winter 2005ICS 252-Intro to Computer Design ICS 252 Introduction to Computer Design Lecture 5-Scheudling Algorithms Winter 2005 Eli Bozorgzadeh Computer.
Caltech CS184a Fall DeHon1 CS184a: Computer Architecture (Structures and Organization) Day17: November 20, 2000 Time Multiplexing.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 17: April 2, 2008 Scheduling Introduction.
Penn ESE Spring DeHon 1 ESE (ESE534): Computer Organization Day 21: April 2, 2007 Time Multiplexing.
Dealing with NP-Complete Problems
Penn ESE Fall DeHon 1 ESE (ESE534): Computer Organization Day 19: March 26, 2007 Retime 1: Transformations.
MAE 552 – Heuristic Optimization Lecture 26 April 1, 2002 Topic:Branch and Bound.
EDA (CS286.5b) Day 11 Scheduling (List, Force, Approximation) N.B. no class Thursday (FPGA) …
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 20: April 7, 2008 Scheduling Variants and Approaches.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 5: February 2, 2009 Architecture Synthesis (Provisioning, Allocation)
EDA (CS286.5b) Day 14 Routing (Pathfind, netflow).
ICS 252 Introduction to Computer Design
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 15: March 18, 2009 Static Timing Analysis and Multi-Level Speedup.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 7: February 9, 2009 Scheduling Variants and Approaches.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 5: February 2, 2009 Architecture Synthesis (Provisioning, Allocation)
Analysis of Algorithms
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 12: February 13, 2002 Scheduling Heuristics and Approximation.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 9: February 16, 2015 Scheduling Variants and Approaches.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 24: April 18, 2011 Covering and Retiming.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 10: February 18, 2015 Architecture Synthesis (Provisioning, Allocation)
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 7: February 3, 2002 Retiming.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 13: February 20, 2002 Routing 1.
CALTECH CS137 Spring DeHon 1 CS137: Electronic Design Automation Day 5: April 12, 2004 Covering and Retiming.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 14: February 27, 2002 Routing 2 (Pathfinder)
Optimal Superblock Scheduling Using Enumeration Ghassan Shobaki, CS Dept. Kent Wilken, ECE Dept. University of California, Davis
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 6: January 26, 2004 Sequential Optimization (FSM Encoding)
2/22/2016© Hal Perkins & UW CSEP-1 CSE P 501 – Compilers Register Allocation Hal Perkins Winter 2008.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 17: March 11, 2002 Sequential Optimization (FSM Encoding)
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 13: March 1, 2003 Scheduling Introduction.
1 Chapter 5 Branch-and-bound Framework and Its Applications.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 11: February 11, 2002 Scheduling Introduction.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 25: April 17, 2013 Covering and Retiming.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 5: January 31, 2011 Scheduling Variants and Approaches.
CS137: Electronic Design Automation
Traveling Salesperson Problem
ESE532: System-on-a-Chip Architecture
BackTracking CS255.
Analysis of Algorithms
CS137: Electronic Design Automation
Basic Project Scheduling
Basic Project Scheduling
CS137: Electronic Design Automation
CS137: Electronic Design Automation
CS137: Electronic Design Automation
ESE535: Electronic Design Automation
CSCI1600: Embedded and Real Time Software
ESE535: Electronic Design Automation
ESE535: Electronic Design Automation
ESE535: Electronic Design Automation
CS184a: Computer Architecture (Structures and Organization)
ESE535: Electronic Design Automation
CS137: Electronic Design Automation
ICS 252 Introduction to Computer Design
CS137: Electronic Design Automation
CSCI1600: Embedded and Real Time Software
Lecture 4: Tree Search Strategies
CS137: Electronic Design Automation
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

CALTECH CS137 Fall DeHon 1 CS137: Electronic Design Automation Day 20: November 23, 2005 Scheduling Variants and Approaches

CALTECH CS137 Fall DeHon 2 Today Scheduling –Force-Directed –SAT/ILP –Branch-and-Bound

CALTECH CS137 Fall DeHon 3 Last Time Resources aren’t free Share to reduce costs Schedule operations on resources Greedy approximation algorithm

CALTECH CS137 Fall DeHon 4 Force-Directed Problem: how exploit schedule freedom (slack) to minimize instantaneous resources –Directly solve time constrained –Trying to minimize resources

CALTECH CS137 Fall DeHon 5 Force-Directed Given a node, can schedule anywhere between ASAP and ALAP schedule time –Between latest schedule predecessor and ALAP –Between ASAP and already scheduled successors N.b.: Scheduling node will limit freedom of nodes in path

CALTECH CS137 Fall DeHon 6 Single Resource Challenge A7A8 B11 A9 B2 B3 B4 A1 A2 A3 A4 A5 A6 A10A11A13A12 B5 B1 B6 B7 B8 B9 B10

CALTECH CS137 Fall DeHon 7 Force-Directed If everything where scheduled, except for the target node, we would: –examine resource usage in all timeslots allowed by precedence –place in timeslot which has least increase maximum resources

CALTECH CS137 Fall DeHon 8 Force-Directed Problem: don’t know resource utilization during scheduling Strategy: estimate resource utilization

CALTECH CS137 Fall DeHon 9 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

CALTECH CS137 Fall DeHon 10 Single Resource Challenge

CALTECH CS137 Fall DeHon 11 Single Resource Challenge

CALTECH CS137 Fall DeHon 12 Single Resource Challenge

CALTECH CS137 Fall DeHon 13 Single Resource Challenge

CALTECH CS137 Fall DeHon 14 Single Resource Challenge /9 2 1/9

CALTECH CS137 Fall DeHon 15 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 (estimate)

CALTECH CS137 Fall DeHon 16 Single Resource Challenge Repeat

CALTECH CS137 Fall DeHon 17 Single Resource Challenge /9 2 1/9 Repeat

CALTECH CS137 Fall DeHon 18 Single Resource Challenge

CALTECH CS137 Fall DeHon 19 Single Resource Challenge /9

CALTECH CS137 Fall DeHon 20 Single Resource Challenge

CALTECH CS137 Fall DeHon 21 Single Resource Challenge /9

CALTECH CS137 Fall DeHon 22 Single Resource Challenge /9 2 1/9

CALTECH CS137 Fall DeHon 23 Single Resource Challenge /9

CALTECH CS137 Fall DeHon 24 Single Resource Challenge /9

CALTECH CS137 Fall DeHon 25 Single Resource Challenge

CALTECH CS137 Fall DeHon 26 Single Resource Challenge

CALTECH CS137 Fall DeHon 27 Single Resource Challenge

CALTECH CS137 Fall DeHon 28 Single Resource Challenge /18

CALTECH CS137 Fall DeHon 29 Single Resource Challenge

CALTECH CS137 Fall DeHon 30 Single Resource Challenge /9

CALTECH CS137 Fall DeHon 31 Single Resource Challenge /18

CALTECH CS137 Fall DeHon 32 Single Resource Challenge /18

CALTECH CS137 Fall DeHon 33 Single Resource Challenge

CALTECH CS137 Fall DeHon 34 Single Resource Challenge /18

CALTECH CS137 Fall DeHon 35 Single Resource Challenge

CALTECH CS137 Fall DeHon 36 Single Resource Challenge /18

CALTECH CS137 Fall DeHon 37 Single Resource Challenge /18

CALTECH CS137 Fall DeHon 38 Single Resource Challenge

CALTECH CS137 Fall DeHon 39 Single Resource Challenge

CALTECH CS137 Fall DeHon 40 Single Resource Challenge Many steps…

CALTECH CS137 Fall DeHon 41 Force-Directed Algorithm 1.ASAP/ALAP schedule to determine range of times for each node 2.Compute estimated resource usage 3.Pick most constrained node (in largest time slot…) –Evaluate effects of placing in feasible time slots (compute forces) –Place in minimum cost slot and update estimates –Repeat until done

CALTECH CS137 Fall DeHon 42 Time Evaluate force of putting in timeslot O(NT) –Potentially perturbing slack on net prefix/postfix for this node  N –Each node potentially in T slots Evaluate all timeslots can put in O(NT 2 ) N nodes to place O(N 2 T 2 ) –Loose bound--don’t get both T slots and N perturbations

CALTECH CS137 Fall DeHon 43 SAT/ILP (Integer-Linear Programming)

CALTECH CS137 Fall DeHon 44 Two Constraint Challenge Processing elements have limited memory –Instruction memory (data memory) Tasks have different requirements for compute and instruction memory –i.e. Run length not correlated to code length

CALTECH CS137 Fall DeHon 45 Task Task: schedule tasks onto PEs obeying both memory and compute capacity limits Example and ILP solution From Plishker et al. NSCD2004

CALTECH CS137 Fall DeHon 46 Task Task: schedule tasks onto PEs obeying both memory and compute capacities  two capacity partitioning problem –…actually, didn’t say anything about communication…  two capacity bin packing problem Task: i

CALTECH CS137 Fall DeHon 47 SAT Packing A i,j – task i assigned to resource j Constraints Coverage constraints Uniqueness constraints Cardinality constraints –PE compute –PE memory

CALTECH CS137 Fall DeHon 48 Allow Code Sharing Two tasks of same type can share code Instead of memory capacity –Vector of memory usage Compute PE Imem vector –As OR of task vectors assigned to it Compute mem space as sum of non- zero vector entries

CALTECH CS137 Fall DeHon 49 Allow Code Sharing Two tasks of same type can share code Task has vector of memory uage –Task i needs set of instructions k: T i,k Compute PE Imem vector –OR (all i): PE.Imem j,k +=A i,j * T i,k PE Mem space –PE.Total_Imem j =  (PE.Imem j,k *Instrs(k))

CALTECH CS137 Fall DeHon 50 Symmetries As with partitioning, many symmetries Speedup with symmetry breaking –Tasks in same class are equivalent –PEs indistinguishable –Total ordering on tasks and PEs –Add constraints to force tasks to be assigned to PEs by ordering –Plishker claims “significant runtime speedup” –Using GALENA [DAC 2003] psuedo-Boolean SAT solver

CALTECH CS137 Fall DeHon 51 Plishker Task Example

CALTECH CS137 Fall DeHon 52 Results SAT/ILP Solve Greedy (first-fit) binpack Solutions in < 1 second

CALTECH CS137 Fall DeHon 53 Why can they do this? Ignore precedence? Ignore Interconnect?

CALTECH CS137 Fall DeHon 54 Why can they do this? Ignore precedence? –feed forward, buffered Ignore Interconnect? –Through shared memory, not dominant?

CALTECH CS137 Fall DeHon 55 Interconnect Buffers Allow “Software Pipelining” Each data item Spatial we would pipeline, running all three at once Think of each schedule instance as one timestep in spatial pipeline.

CALTECH CS137 Fall DeHon 56 Interconnect Buffer ABC A B C PE0 PE1 ABC ABC ABCABC A BC A BC A BC A BC

CALTECH CS137 Fall DeHon 57 Add Precedence to SAT/ILP? Assign start time to each task Precedence: constrain start of each task to be greater than start+run of each predecessor Time Exclusivity: constrain non- overlap of start  start+run-1 on nodes on same PE –Maybe formulate as order on PE –And make PE order predecessor like a task predecessor? Untested conjecture

CALTECH CS137 Fall DeHon 58 Memory Schedule Variants Persistent: holds memory whole time –E.g. task state, instructions Task temporary: only uses memory space while task running Intra-Task: use memory between point of production and consumption –E.g. Def-Use chains

CALTECH CS137 Fall DeHon 59 Memory Schedule Variants Persistent: –Binpacking in memory Task temporary: –Co-schedule memory slot with execution Intra-Task: –Lifetime in memory depends on scheduling def and last use –Phase Ordered: Register coloring

CALTECH CS137 Fall DeHon 60 Branch-and-Bound

CALTECH CS137 Fall DeHon 61 Brute-Force Try all schedules Branching/Backtracking Search Start w/ nothing scheduled (ready queue) At each move (branch) pick: –available resource time slot –ready task (predecessors completed) –schedule task on resource

CALTECH CS137 Fall DeHon 62 Example T1 T2 T3 T4 T5 T6 T1  time 1 T3  time 1 T2  time 1 idle  time 1 T3  time2 T4  time 2 idle  time 2 Target: 2 FUs

CALTECH CS137 Fall DeHon 63 Branching Search Explores entire state space –finds optimum schedule Exponential work –O (N (resources*time-slots) ) Many schedules completely uninteresting

CALTECH CS137 Fall DeHon 64 Reducing Work 1.Canonicalize “equivalent” schedule configurations 2.Identify “dominating” schedule configurations 3.Prune partial configurations which will lead to worse (or unacceptable results)

CALTECH CS137 Fall DeHon 65 “Equivalent” Schedules If multiple resources of same type –assignment of task to particular resource at a particular timeslot is not distinguishing T1 T2 T3 T2 T1 T3 Keep track of resource usage by capacity at time-slot.

CALTECH CS137 Fall DeHon 66 “Equivalent” Schedule Prefixes T1T3 T2T4 T1 T3 T2 T4 T1 T2 T3 T4 T5 T6

CALTECH CS137 Fall DeHon 67 “Non-Equivalent” Schedule Prefixes T1 T2 T3 T2 T3 T1 T2 T3 T4 T5 T6

CALTECH CS137 Fall DeHon 68 Pruning Prefixes? I’m not sure there is an efficient way (general)? Keep track of schedule set –walk through state-graph of scheduled prefixes –unfortunately, set is power-set so 2 N –…but not all feasible, so shape of graph may simplify

CALTECH CS137 Fall DeHon 69 Dominant Schedules A strictly shorter schedule –scheduling the same or more tasks –will always be superior to the longer schedule T1 T2T1T2T5 T4 T5 T3 T2 T1 T5 T4

CALTECH CS137 Fall DeHon 70 Pruning If can establish a particular schedule path will be worse than one we’ve already seen –we can discard it w/out further exploration In particular: –LB=current schedule time + lower_bound_estimate –if LB greater than existing solution, prune

CALTECH CS137 Fall DeHon 71 Pruning Techniques Establish Lower Bound on schedule time Critical Path (ASAP schedule) Resource Bound Critical Chain

CALTECH CS137 Fall DeHon 72 “Critical Chain” Lower Bound Bottleneck resource present coupled resource and latency bound Single red resource

CALTECH CS137 Fall DeHon 73 “Critical Chain” Lower Bound Bottleneck resource present coupled resource and latency bound Single red resource Critical path 5 Resource Bound (1,1) 4 Critical Chain (1,1) 7

CALTECH CS137 Fall DeHon 74 Alpha-Beta Search Generalization –keep both upper and lower bound estimates on partial schedule Lower bounds from CP, RB, CC Upper bounds with List Scheduling –expand most promising paths (least upper bound, least lower bound) –prune based on lower bounds exceeding known upper bound –(technique typically used in games/Chess)

CALTECH CS137 Fall DeHon 75 Alpha-Beta Each scheduling decision will tighten –lower/upper bound estimates Can choose to expand –least current time (breadth first) –least lower bound remaining (depth first) –least lower bound estimate –least upper bound estimate Can control greediness –weighting lower/upper bound –selecting “most promising”

CALTECH CS137 Fall DeHon 76 Note Aggressive pruning and ordering –can sometimes make polynomial time in practice –often cannot prove will be polynomial time –usually represents problem structure we still need to understand

CALTECH CS137 Fall DeHon 77 Multiple Resources Works for multiple resource case Computing lower-bounds per resource –resource constrained Sometimes deal with resource coupling –e.g. must have 1 A and 1 B simultaneously or in fixed time slot relation e.g. bus and memory port

CALTECH CS137 Fall DeHon 78 Summary Resource estimates and Refinement SAT/ILP Schedule Software Pipelining Branch-and-bound search –“equivalent” states –dominators –estimates/pruning

CALTECH CS137 Fall DeHon 79 Admin Class –Friday (no  holiday) –Next week: Monday, Friday No Wed. Next week’s reading all online

CALTECH CS137 Fall DeHon 80 Big Ideas: Estimate Resource Usage Use dominators to reduce work Techniques: –Force-Directed –SAT/ILP –Coloring –Search Branch-and-Bound Alpha-Beta