0006.scheduling not-ilp-not-force

1,680 views

Published on

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,680
On SlideShare
0
From Embeds
0
Number of Embeds
299
Actions
Shares
0
Downloads
31
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

0006.scheduling not-ilp-not-force

  1. 1. SCHEDULING SOURCES- Mark Manwaring Kia Bazargan Giovanni De Micheli Gupta Youn-Long Lin M. Balakrishnan Camposano, J. Hofstede, Knapp, MacMillen Lin
  2. 2. Overview of Hardware Synthesis <ul><li>reduce the amount of hardware, optimize the design in general. </li></ul><ul><li>May be done with the consideration of additional constraints. </li></ul>assign times to operations under given constraints assign operations to physical resources under given constraints
  3. 3. Outline of scheduling <ul><li>The scheduling problem. </li></ul><ul><li>Scheduling without constraints. </li></ul><ul><li>2. Scheduling under timing constraints . </li></ul><ul><ul><li>Relative scheduling. </li></ul></ul><ul><li>3. Scheduling under resource constraints . </li></ul><ul><ul><li>The ILP model (Integer Linear Programming). </li></ul></ul><ul><ul><li>Heuristic methods ( graph coloring , etc). </li></ul></ul>Timing constraints versus resource constraints
  4. 4. What is Scheduling
  5. 5. Example of scheduling: ASAP This is As Soon as Possible Scheduling (ASAP). It can be used as a bound in other methods like ILP or when latency only is important, not area.
  6. 7. Example of Scheduling Adder number 1 Adder number 3 Multiplier number 2
  7. 8. More complex example of Scheduling
  8. 9. What is necessary to solve the scheduling problem? <ul><li>Circuit model: </li></ul><ul><ul><li>Sequencing graph. </li></ul></ul><ul><ul><li>Cycle-time is given. </li></ul></ul><ul><ul><li>Operation delays expressed in cycles. </li></ul></ul><ul><li>Scheduling: </li></ul><ul><ul><li>Determine the start times for the operations. </li></ul></ul><ul><ul><li>Satisfying all the sequencing (timing and resource) constraints. </li></ul></ul><ul><li>Goal: </li></ul><ul><ul><li>Determine area/latency trade-off. </li></ul></ul>Do you remember what is latency?
  9. 10. <ul><li>Scheduling affects </li></ul><ul><ul><li>Area : maximum number of concurrent operations of same type is a lower bound on required hardware resources. </li></ul></ul><ul><ul><li>Performance : concurrency of resulting implementation. </li></ul></ul>
  10. 11. Taxonomy of scheduling problems to solve <ul><li>Unconstrained scheduling. </li></ul><ul><li>2. Scheduling with timing constraints: </li></ul><ul><ul><li>Latency . </li></ul></ul><ul><ul><li>Detailed timing constraints. </li></ul></ul><ul><li>3. Scheduling with resource constraints . </li></ul><ul><li>Related problems: </li></ul><ul><ul><li>Chaining . What is chaining? </li></ul></ul><ul><ul><li>Synchronization . What is synchronization ? </li></ul></ul><ul><ul><li>Pipeline scheduling. </li></ul></ul>
  11. 12. <ul><li>Simplest scheduling model </li></ul><ul><ul><li>All operations have bounded delays. </li></ul></ul><ul><ul><li>All delays are in cycles. </li></ul></ul><ul><ul><ul><li>Cycle-time is given. </li></ul></ul></ul><ul><ul><li>No constraints - no bounds on area. </li></ul></ul><ul><ul><li>Goal </li></ul></ul><ul><ul><ul><li>Minimize latency. </li></ul></ul></ul>
  12. 13. Scheduling 2 <ul><li>Scheduling problems are NP-hard, so all kind of heuristics are used </li></ul><ul><li>ASAP – As soon as possible </li></ul><ul><li>ALAP </li></ul><ul><li>List scheduling – Resource Constrained algorithms </li></ul><ul><li>Force directed algorithms – time constrained </li></ul><ul><li>Path based </li></ul><ul><li>Percolation algorithms </li></ul><ul><li>Simulated annealing </li></ul><ul><li>Tabu search and other heuristics </li></ul><ul><li>Simulated evolution </li></ul><ul><li>Linear Programming </li></ul><ul><li>Integer Linear Programming - time constrained </li></ul>What are types of Scheduling Algorithms? <ul><li>Time & Resource Tradeoff </li></ul><ul><li>Scheduling is temporal binding </li></ul>
  13. 14. Types of Scheduling Processes <ul><li>Assignment of operations to time (control steps) within given constraints and minimizing a cost function </li></ul><ul><li>Time-constrained </li></ul><ul><li>Resource-constrained </li></ul><ul><li>With or without control (conditions) </li></ul><ul><li>With or without iterations (infinite loops) </li></ul><ul><li>Constructive </li></ul><ul><li>Iterative </li></ul>
  14. 15. Classification of Scheduling Algorithms
  15. 16. <ul><li>Scheduling Algorithms </li></ul>
  16. 17. Simplest model of scheduling <ul><li>All operations have bounded delays. </li></ul><ul><li>All delays are expressed in numbers of cycles of a single one-phase clock. </li></ul><ul><ul><li>Cycle-time is given. </li></ul></ul><ul><li>No constraints - no bounds on area. </li></ul><ul><li>Goal: </li></ul><ul><ul><li>Minimize latency . </li></ul></ul>
  17. 18. Minimum Latency Unconstrained Scheduling
  18. 19. <ul><li>Unconstrained scheduling used when </li></ul><ul><ul><li>Dedicated resources are used. </li></ul></ul><ul><ul><li>Operations differ in type. </li></ul></ul><ul><ul><li>Operations cost is marginal when compared to that of steering logic, registers, wiring, and control logic. </li></ul></ul><ul><ul><li>Binding is done before scheduling: resource conflicts solved by serializing operations sharing same resource. </li></ul></ul><ul><ul><li>Deriving bounds on latency for constrained problems. </li></ul></ul>Minimum Latency Unconstrained Scheduling Problem
  19. 20. Minimum-latency unconstrained scheduling problem <ul><li>Given a set of operations V with set of corresponding integer delays D and a partial order on the operations E : </li></ul><ul><li>Find an integer labeling of the operatio ns </li></ul><ul><li> : V --> Z + , such that: </li></ul><ul><ul><li>t i =  (v i ), </li></ul></ul><ul><ul><li>t i  t j + d j  i, j such that (v j , v i )  E </li></ul></ul><ul><ul><li>and t n is minimum . </li></ul></ul>d i d j (v j , v i ) t i  t j + d j t j t i Input to d i must be stable
  20. 21. Example of using mobility <ul><li>Operations with zero mobility: </li></ul><ul><ul><li>{v 1 , v 2 , v 3 , v 4 , v 5 }. </li></ul></ul><ul><ul><li>They are on the critical path. </li></ul></ul><ul><li>Operations with mobility one : </li></ul><ul><ul><li>{v 6 , v 7 }. </li></ul></ul><ul><li>Operations with mobility two : </li></ul><ul><ul><li>{v 8 , v 9 , v 10 , v 11 }. </li></ul></ul>mobility two: 1. Start from ALAP 2.Use mobility to improve
  21. 22. Classes of scheduling algorithms Operation Scheduling Formalisation
  22. 24. <ul><li>Time Constrained Scheduling </li></ul>
  23. 25. <ul><li>ALAP solves a latency-constrained problem. </li></ul><ul><li>Latency bound can be set to latency computed by ASAP algorithm. </li></ul><ul><li>Mobility </li></ul><ul><ul><li>Defined for each operation. </li></ul></ul><ul><ul><li>Difference between ALAP and ASAP schedule. </li></ul></ul><ul><ul><li>Zero mobility implies that an operation can be started only at one given time step. </li></ul></ul><ul><ul><li>Mobility greater than 0 measures span of time interval in which an operation may start. </li></ul></ul><ul><li>Slack on the start time. </li></ul>Latency Constrained Scheduling
  24. 26. Time Constrained Scheduling
  25. 27. <ul><li>Motivation </li></ul><ul><ul><li>Interface design. </li></ul></ul><ul><ul><li>Control over operation start time. </li></ul></ul><ul><li>Constraints </li></ul><ul><ul><li>Upper/lower bounds on start-time difference of any operation pair. </li></ul></ul><ul><li>Minimum timing constraints between two operations </li></ul><ul><ul><li>An operation follows another by at least a number of prescribed time steps </li></ul></ul><ul><ul><li>l ij  0 requires t j  t i + l ij </li></ul></ul><ul><li>Maximum timing constraints between two operations </li></ul><ul><ul><li>An operation follows another by at most a number of prescribed time steps </li></ul></ul><ul><ul><li>u ij  0 requires t j  t i + u ij </li></ul></ul>Scheduling under Detailed Timing Constraints
  26. 28. <ul><li>Example </li></ul><ul><ul><li>Circuit reads data from a bus, performs computation, writes result back on the bus. </li></ul></ul><ul><ul><li>Bus interface constraint: data written three cycles after read. </li></ul></ul><ul><ul><li>Minimum and maximum constraint of 3 cycles between read and write operations. </li></ul></ul><ul><li>Example </li></ul><ul><ul><li>Two circuits required to communicate simultaneously to external circuits. </li></ul></ul><ul><ul><li>Cycle in which data available is irrelevant. </li></ul></ul><ul><ul><li>Minimum and maximum timing constraint of zero cycles between two write operations. </li></ul></ul>Scheduling under Detailed Timing Constraints
  27. 29. Mul delay = 2 ADD delay =1
  28. 30. Scheduling under detailed timing constraints <ul><li>Motivation : </li></ul><ul><ul><li>Interface design. </li></ul></ul><ul><ul><li>Control over </li></ul></ul><ul><ul><li>operation start time . </li></ul></ul><ul><li>Constraints: </li></ul><ul><ul><li>Upper/lower bounds on start-time difference of any operation pair. </li></ul></ul><ul><li>Feasibility of a solution. </li></ul>
  29. 31. Constraint graph model <ul><li>Start from a sequencing graph. </li></ul><ul><li>Model delays as weights on edges . </li></ul><ul><li>Add forward edges for minimum constraints . </li></ul><ul><ul><li>Edge (v i , v j ) with weight l ij => t j  t i +l ij . </li></ul></ul><ul><li>Add backward edges for maximum constraints . </li></ul><ul><ul><li>Edge (v i , v j ) with weight: </li></ul></ul><ul><ul><ul><li>- u ij => t j  t i + u ij </li></ul></ul></ul><ul><ul><li>because t j  t i + u ij => t i  t j - u ij </li></ul></ul>Add this edge for max constraint Add this edge for min constraint
  30. 32. <ul><li>Unbounded delays </li></ul><ul><ul><li>Synchronization. </li></ul></ul><ul><ul><li>Unbounded-delay operations (e.g. loops). </li></ul></ul><ul><li>Anchors. </li></ul><ul><ul><li>Unbounded-delay operations. </li></ul></ul><ul><li>Relative scheduling </li></ul><ul><ul><li>Schedule ops w.r. to the anchors. </li></ul></ul><ul><ul><li>Combine schedules. </li></ul></ul>Method for Scheduling with Unbounded-Delay Operations
  31. 33. <ul><li>Presence of maximum timing constraints may prevent existence of a consistent schedule. </li></ul><ul><li>Required upper bound on time distance between operations may be inconsistent with first operation execution time. </li></ul><ul><li>Minimum timing constraints may conflict with maximum timing constraints. </li></ul><ul><li>A criterion to determine existence of a schedule: </li></ul><ul><ul><li>For each maximum timing constraint u ij </li></ul></ul><ul><ul><li>Longest weighted path between v i and v j must be  u ij </li></ul></ul>Method for Scheduling Under Detailed Timing Constraints
  32. 34. Example of using constraint graph with minimum and maximum constraints Sequencing graph Constraint graph explain So now we can calculate this table from sequencing graph
  33. 35. <ul><li>Weight of longest path from source to a vertex is the minimum start time of a vertex. </li></ul><ul><li>Bellman-Ford or Lia-Wong algorithm provides the schedule. </li></ul><ul><li>A necessary condition for existence of a schedule is constraint graph has no positive cycles. </li></ul>Method for Scheduling Under Detailed Timing Constraints
  34. 36. Methods for Scheduling Under Detailed Timing Constraints Shown in last slide Will follow
  35. 37. Methods for scheduling under detailed timing constraints <ul><li>Start from the Sequencing Graph. Assumption: </li></ul><ul><ul><li>All delays are fixed and known. </li></ul></ul><ul><li>Set of linear inequalities . </li></ul><ul><li>Longest path problem. </li></ul><ul><li>Algorithms for the longest path problem were discussed in Chapter 2 of De Micheli : </li></ul><ul><ul><li>Bellman-Ford, </li></ul></ul><ul><ul><li>Liao-Wong. </li></ul></ul>
  36. 38. Bellman-Ford’s algorithm <ul><li>BELLMAN_FORD(G(V, E, W)) </li></ul><ul><li>{ </li></ul><ul><li>s 1 0 = 0; </li></ul><ul><li>for (i = 1 to N) </li></ul><ul><li>s 1 i =w 0, i ; </li></ul><ul><li>for (j =1 to N) { </li></ul><ul><li>for (i =1 to N) { </li></ul><ul><li>s j+1 i = min { s j i , (s j k +w q, i ) } , </li></ul><ul><li>} </li></ul><ul><li>if (s j+1 i == s j i  i ) return (TRUE) ; </li></ul><ul><li>} </li></ul><ul><li>return (FALSE) </li></ul><ul><li>} </li></ul>k  i
  37. 39. Longest path problem <ul><li>Use shortest path algorithms: </li></ul><ul><ul><li>by reversing signs on weights. </li></ul></ul><ul><li>Modify algorithms : </li></ul><ul><ul><li>by changing min with max . </li></ul></ul><ul><li>Remarks: </li></ul><ul><ul><li>Dijkstra’s algorithm is not relevant. </li></ul></ul><ul><ul><li>Inconsistent problem: </li></ul></ul><ul><ul><ul><li>Positive-weighted cycles. </li></ul></ul></ul>
  38. 40. Example – Bellman-Ford <ul><li>Iteration 1: l 0 =0, l 1 =3, l 2 = 1, l 3 =  . </li></ul><ul><li>Iteration 2: l 0 =0, l 1 =3, l 2 =2, l 3 =5. </li></ul><ul><li>Iteration 3: l 0 =0, l 1 =3, l 2 =2, l 3 =6. </li></ul><ul><li>Use shortest path algorithms: </li></ul><ul><ul><li>by reversing signs on weights. </li></ul></ul>source 3 -1=2 1+4=5 2+4=6
  39. 41. Liao-Wong’s algorithm <ul><li>LIAO WONG(G( V, E  F, W)) </li></ul><ul><li>{ </li></ul><ul><li>for ( i = 1 to N) </li></ul><ul><li>l 1 i = 0; </li></ul><ul><li>for ( j = 1 to |F|+ 1) { </li></ul><ul><li>foreach vertex v i </li></ul><ul><li>l j+ 1 i = longest path in G( V, E,W E ) ; </li></ul><ul><li>flag = TRUE; </li></ul><ul><li>foreach edge ( v p , v q )  F { </li></ul><ul><li>if ( l j+ 1 q < l j+ 1 p + w p,q ) { </li></ul><ul><li>flag = FALSE; </li></ul><ul><li>E = E  ( v 0 , v q ) with weight ( l j+ 1 p + w p,q ) </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>if ( flag ) return (TRUE) ; </li></ul><ul><li>} </li></ul><ul><li>return (FALSE) </li></ul><ul><li>} </li></ul>adjust
  40. 42. Example – Liao-Wong <ul><li>Iteration 1: l 0 = 0, l 1 = 3, l 2 = 1, l 3 = 5. </li></ul><ul><li>Adjust: add edge (v 0 , v 2 ) with weight 2. </li></ul><ul><li>Iteration 2: l 0 = 0, l 1 = 3, l 2 = 2, l 3 = 6. </li></ul>Only positive edges from (a) (b) adjusted by adding longest path from node 0 to node 2 Looking for longest path from node 0 to node 3
  41. 43. Method for scheduling with unbounded-delay operations <ul><li>Unbounded delays: </li></ul><ul><ul><li>Synchronization. </li></ul></ul><ul><ul><li>Unbounded-delay operations (e.g. loops ). </li></ul></ul><ul><li>Anchor s. </li></ul><ul><ul><li>Unbounded-delay operations. </li></ul></ul><ul><li>Relative scheduling: </li></ul><ul><ul><li>Schedule operations with respect to the anchors . </li></ul></ul><ul><ul><li>Combine schedules. </li></ul></ul>
  42. 44. Relative scheduling method
  43. 45. Relative scheduling method <ul><li>For each vertex : </li></ul><ul><ul><li>Determine relevant anchor set R(.). </li></ul></ul><ul><ul><li>Anchors affecting start time. </li></ul></ul><ul><ul><li>Determine time offset from anchors . </li></ul></ul><ul><li>Start-time: </li></ul><ul><ul><li>Expressed by: </li></ul></ul><ul><ul><li>Computed only at run-time because delays of anchors are unknown . </li></ul></ul>
  44. 46. Relative scheduling under timing constraints <ul><li>Problem definition: </li></ul><ul><ul><li>Detailed timing constraints. </li></ul></ul><ul><ul><li>Unbounded delay operations. </li></ul></ul><ul><li>Solution: </li></ul><ul><ul><li>May or may not exist. </li></ul></ul><ul><ul><li>Problem may be ill-specified . </li></ul></ul>
  45. 47. Relative scheduling under timing constraints <ul><li>Feasible problem: </li></ul><ul><ul><li>A solution exists when unknown delays are zero . </li></ul></ul><ul><li>Well-posed problem: </li></ul><ul><ul><li>A solution exists for any value of the unknown delays. </li></ul></ul><ul><li>Theorem: </li></ul><ul><ul><li>A constraint graph can be made well-posed iff there are no cycles with unbounded weights . </li></ul></ul>
  46. 48. (a) & (b) Ill-posed constraint (c) well-posed constraint Example of Relative scheduling under timing constraints
  47. 49. Relative scheduling approach <ul><li>Analyze graph: </li></ul><ul><ul><li>Detect anchors. </li></ul></ul><ul><ul><li>Well-posedness test. </li></ul></ul><ul><ul><li>Determine dependencies from anchors. </li></ul></ul><ul><li>Schedule operations with respect to relevant anchors: </li></ul><ul><ul><li>Bellman-Ford , Liao-Wong, Ku algorithms. </li></ul></ul><ul><li>Combine schedules to determine start times : </li></ul>
  48. 50. Example of Relative scheduling
  49. 51. Example of control-unit synthesized for Relative scheduling
  50. 53. Operations must be serialized
  51. 54. Scheduling and Binding
  52. 56. schedule binding
  53. 57. Scheduling Problem formalization Scheduling Problem
  54. 58. Various Operator types in Scheduling
  55. 59. ASAP Scheduling
  56. 60. ASAP Scheduling
  57. 61. ASAP scheduling algorithm <ul><li>ASAP ( G s (V, E)){ </li></ul><ul><li>Schedule v 0 by setting t S 0 = 1; </li></ul><ul><li>repeat { </li></ul><ul><li>Select a vertex v i whose predecessors are all scheduled; </li></ul><ul><li>Schedule v i by setting t S i = max t S j + d j ; </li></ul><ul><li>} </li></ul><ul><li>until (v n is scheduled) ; </li></ul><ul><li>return (t S ); </li></ul><ul><li>} </li></ul>j:(v j ,v i )  E Similar to breadth-first search
  58. 62. Example - ASAP <ul><li>Solution </li></ul><ul><li>Multipliers = 4 </li></ul><ul><li>ALUs = 2 </li></ul>Latency Time=4
  59. 63. ALAP Scheduling
  60. 64. ALAP Scheduling successor
  61. 65. ALAP scheduling algorithm <ul><li>As Late as Possible - ALAP </li></ul><ul><li>Similar to depth-first search </li></ul>
  62. 66. Example ALAP <ul><li>Solution </li></ul><ul><li>multipliers = 2 </li></ul><ul><li>ALUs = 3 </li></ul>Latency Time=4
  63. 67. Remarks on ALAP and mobility <ul><li>ALAP solves a latency-constrained problem. </li></ul><ul><li>Latency bound can be set to latency computed by ASAP algorithm. <-- using bounds, also in other approaches </li></ul><ul><li>Mobilit y: </li></ul><ul><ul><li>Mobility is defined for each operation . </li></ul></ul><ul><ul><li>Difference between ALAP and ASAP schedule. </li></ul></ul><ul><li>What is mobility? number of cycles that I can move upwards or downwards the operation </li></ul><ul><li>Slack on the start time . </li></ul>
  64. 68. Resource Constrained
  65. 69. Scheduling under resource constraints <ul><li>Classical scheduling problem. </li></ul><ul><ul><li>Fix area bound - minimize latency . </li></ul></ul><ul><li>The amount of available resources affects the achievable latency. </li></ul><ul><li>Dual problem: </li></ul><ul><ul><li>Fix latency bound - minimize resources. </li></ul></ul><ul><li>Assumption: </li></ul><ul><ul><li>All delays bounded and known. </li></ul></ul>
  66. 70. Minimum latency resource-constrained scheduling problem <ul><li>Given a set of operations V with integer delays D a partial order on the operations E , and upper bounds {a k ; k = 1, 2,…,n res }: </li></ul><ul><li>Find an integer labeling of the operations  : V --> Z + such that : </li></ul><ul><ul><li>t i = '(v i ), </li></ul></ul><ul><ul><li>t i t j +d j 8 i; j s:t: (v j ; v i ) 2 E, </li></ul></ul><ul><ul><li>jfv i jT (v i ) = k and t i l < t i +d i gj a k </li></ul></ul><ul><ul><li>and tn is minimum. </li></ul></ul>
  67. 71. <ul><li>Number of operations of any given type in any schedule step does not exceed bound. </li></ul>:V  {1,2, …n res }
  68. 72. Scheduling under resource constraints <ul><li>Intractable problem. </li></ul><ul><li>Algorithms: </li></ul><ul><ul><li>Exact: </li></ul></ul><ul><ul><ul><li>Integer linear program. </li></ul></ul></ul><ul><ul><ul><li>Hu (restrictive assumptions). </li></ul></ul></ul><ul><ul><li>Approximate: </li></ul></ul><ul><ul><ul><li>List scheduling. </li></ul></ul></ul><ul><ul><ul><li>Force-directed scheduling. </li></ul></ul></ul>
  69. 73. Resource Constraint Scheduling ML-RCS : minimize latency, bound on resources MR-LCS : minimize resources, bound on latency
  70. 74. Algorithm of Hu for Resource Constraint Scheduling ML-RCS : minimize latency, bound on resources
  71. 75. Example of using Hu’s algorithm <ul><li>Assumptions: </li></ul><ul><ul><li>One resource type only. </li></ul></ul><ul><ul><li>All operations have unit delay . </li></ul></ul>Distance from sink <ul><li>Additional assumptions: </li></ul><ul><ul><li>Graph is a forest . </li></ul></ul><ul><li>Algorithm: </li></ul><ul><ul><li>Label vertices with distance from sink . </li></ul></ul><ul><ul><li>Greedy strategy. </li></ul></ul><ul><ul><li>Exact solution. </li></ul></ul>Hu's algorithm
  72. 76. Algorithm Hu's schedule with a resources <ul><li>Set step, l = 1. </li></ul><ul><li>Repeat until all operations are scheduled: </li></ul><ul><ul><li>Select s  a resources with: </li></ul></ul><ul><ul><ul><li>All predecessors scheduled. </li></ul></ul></ul><ul><ul><ul><li>Maximal labels . </li></ul></ul></ul><ul><ul><li>Schedule the s operations at step l . </li></ul></ul><ul><ul><li>Increment step l = l +1 . </li></ul></ul><ul><ul><li>All operations have unit delay . </li></ul></ul><ul><ul><li>All operations have the same type . </li></ul></ul>
  73. 77. <ul><li>Minimum latency with a = 3 resources. </li></ul><ul><ul><li>Step 1: </li></ul></ul><ul><ul><ul><li>Select {v 1 , v 2 , v 6 }. </li></ul></ul></ul><ul><ul><li>Step 2: </li></ul></ul><ul><ul><ul><li>Select {v 3 , v 7 , v 8 }. </li></ul></ul></ul><ul><ul><li>Step 3: </li></ul></ul><ul><ul><ul><li>Select {v 4 , v 9 , v 10 }. </li></ul></ul></ul><ul><ul><li>Step 4: </li></ul></ul><ul><ul><ul><li>Select {v 5 , v 11 }. </li></ul></ul></ul>Algorithm Hu's schedule with a resources We always select 3 resources
  74. 78. <ul><li>Minimum latency with a = 3 resources. </li></ul><ul><ul><li>Step 1: </li></ul></ul><ul><ul><ul><li>Select {v 1 , v 2 , v 6 }. </li></ul></ul></ul><ul><ul><li>Step 2: </li></ul></ul><ul><ul><ul><li>Select {v 3 , v 7 , v 8 }. </li></ul></ul></ul><ul><ul><li>Step 3: </li></ul></ul><ul><ul><ul><li>Select {v 4 , v 9 , v 10 }. </li></ul></ul></ul><ul><ul><li>Step 4: </li></ul></ul><ul><ul><ul><li>Select {v 5 , v 11 }. </li></ul></ul></ul>Algorithm Hu's schedule with a resources We always select 3 resources
  75. 79. Example of Hu’s Algorithm Distance from sink
  76. 80. Example of Hu’s Algorithm
  77. 82. Exactness of Hu's algorithm <ul><li>Theorem1: </li></ul><ul><ul><li>Given a DAG with operations of the same type. </li></ul></ul><ul><li>a is a lower bound on the number of resources to complete a schedule with latency  . </li></ul><ul><li> is a positive integer. </li></ul><ul><li>Theorem2: </li></ul><ul><ul><li>Hu's algorithm applied to a tree with unit-cycle resources achieves latency  with a resources. </li></ul></ul><ul><li>Corollary: </li></ul><ul><ul><li>Since a is a lower bound on the number of resources for achieving  , then  is minimum. </li></ul></ul>
  78. 83. LIST scheduling
  79. 84. List scheduling idea
  80. 85. Example DFG List Schedule
  81. 86. <ul><li>Assumptions </li></ul><ul><ul><li>a 1 = 2 multipliers with delay 1. </li></ul></ul><ul><ul><li>a 2 = 2 ALUs with delay 1. </li></ul></ul><ul><li>First Step </li></ul><ul><ul><li>U 1,1 = {v 1 , v 2 , v 6 , v 8 } </li></ul></ul><ul><ul><li>Select {v 1 , v 2 } </li></ul></ul><ul><ul><li>U 1,2 = {v 10 }; selected </li></ul></ul><ul><li>Second step </li></ul><ul><ul><li>U 2,1 = {v 3 , v 6 , v 8 } </li></ul></ul><ul><ul><li>select {v 3 , v 6 } </li></ul></ul><ul><ul><li>U 2,2 = {v 11 }; selected </li></ul></ul><ul><li>Third step </li></ul><ul><ul><li>U 3,1 = {v 7 , v 8 } </li></ul></ul><ul><ul><li>Select {v 7 , v 8 } </li></ul></ul><ul><ul><li>U 3,2 = {v 4 }; selected </li></ul></ul><ul><li>Fourth step </li></ul><ul><ul><li>U 4,2 = {v 5 , v 9 }; selected </li></ul></ul>
  82. 87. <ul><li>Priority list heuristics. </li></ul><ul><ul><li>Assign a weight to each vertex indicating its scheduling priority </li></ul></ul><ul><ul><ul><li>Longest path to sink . </li></ul></ul></ul><ul><ul><ul><li>Longest path to timing constraint. </li></ul></ul></ul>List Scheduling Algorithms
  83. 88. List scheduling algorithms <ul><li>Heuristic method for: </li></ul><ul><ul><li>1. Minimum latency subject to resource bound . </li></ul></ul><ul><ul><li>2. Minimum resource subject to latency bound . </li></ul></ul><ul><li>Greedy strategy ( like Hu's). </li></ul><ul><li>General graphs ( unlike Hu's). </li></ul>
  84. 89. LIST scheduling
  85. 90. List scheduling algorithm for minimum resource Usage
  86. 91. <ul><li>Candidate Operations U l,k </li></ul><ul><ul><li>Operations of type k whose predecessors are scheduled and completed at time step before l </li></ul></ul><ul><li>Unfinished operations T l,k are operations of type k that started at earlier cycles and whose execution is not finished at time l </li></ul><ul><ul><li>Note that when execution delays are 1, T l,k is empty. </li></ul></ul>List scheduling algorithm for minimum latency for resource bound
  87. 92. List scheduling algorithm for minimum latency for resource bound <ul><li>LIST_L ( G(V, E), a ) { </li></ul><ul><li>l = 1 ; </li></ul><ul><li>repeat { </li></ul><ul><li>for each resource type k = 1, 2,…,n res { </li></ul><ul><li>Determine candidate operations U l,k ; </li></ul><ul><li>Determine unfinished operations T l,k ; </li></ul><ul><li>Select S k  U l,k vertices, such that |S k | + |T l, k |  a k ; </li></ul><ul><li>Schedule the S k operations at step l ; </li></ul><ul><li>} </li></ul><ul><li>l = l +1 ; </li></ul><ul><li>} </li></ul><ul><li>until (v n is scheduled) ; </li></ul><ul><li>return (t ); </li></ul><ul><li>} </li></ul>
  88. 93. <ul><li>Assumptions: </li></ul><ul><ul><li>a 1 = 3 multipliers with delay 2. </li></ul></ul><ul><ul><li>a 2 = 1 ALUs with delay 1. </li></ul></ul>1. List scheduling algorithm for minimum latency for resource bound List scheduling algorithm for minimum latency Now we need two time units for multiplier
  89. 94. <ul><li>Assumptions </li></ul><ul><ul><li>a 1 = 3 multipliers with delay 2. </li></ul></ul><ul><ul><li>a 2 = 1 ALU with delay 1. </li></ul></ul>Example
  90. 95. <ul><li>Assume  =4 </li></ul><ul><li>Let a = [1, 1] T </li></ul><ul><li>First Step </li></ul><ul><ul><li>U 1,1 = {v 1 , v 2 , v 6 , v 8 } </li></ul></ul><ul><ul><li>Operations with zero slack {v 1 , v 2 } </li></ul></ul><ul><ul><li>a = [2, 1] T </li></ul></ul><ul><ul><li>U 1,2 = {v 10 } </li></ul></ul><ul><li>Second step </li></ul><ul><ul><li>U 2,1 = {v 3 , v 6 , v 8 } </li></ul></ul><ul><ul><li>Operations with zero slack {v 3 , v 6 } </li></ul></ul><ul><ul><li>U 2,2 = {v 11 } </li></ul></ul><ul><li>Third step </li></ul><ul><ul><li>U 3,1 = {v 7 , v 8 } </li></ul></ul><ul><ul><li>Operations with zero slack {v 7 , v 8 } </li></ul></ul><ul><ul><li>U 3,2 = {v 4 } </li></ul></ul><ul><li>Fourth step </li></ul><ul><ul><li>U 4,2 = {v 5 , v 9 } </li></ul></ul><ul><ul><li>Both have zero slack; a = [2, 2] T </li></ul></ul>
  91. 96. 1. List scheduling algorithm for minimum latency for resource bound <ul><li>Solution </li></ul><ul><li>3 multipliers as assumed </li></ul><ul><li>1 ALU as assumed </li></ul><ul><li>LATENCY 7 </li></ul><ul><li>Assumptions: </li></ul><ul><ul><li>a 1 = 3 multipliers with delay 2 . </li></ul></ul><ul><ul><li>a 2 = 1 ALUs with delay 1. </li></ul></ul>
  92. 97. Compute the latest possible start times tL by ALAP ( G(V,E),  ); 2. List scheduling algorithm for minimum resource usage
  93. 98. <ul><li>overlap </li></ul>2. Example: List scheduling algorithm for minimum resource usage From ALAP We can move them <ul><li>Solution </li></ul><ul><li>2 multipliers </li></ul><ul><li>1 ALU </li></ul><ul><li>LATENCY 4 </li></ul>Now we assume the same time of each operation
  94. 99. List Scheduling Algorithm example ML-RCS * * * * * * - - + + < Assume 3 multipliers Assume 1 ALU t=0mul 3m 1 ALU t=1 1 ALU t=2 3mul t=3 1 ALU t=4 1 ALU t=5 1 ALU Now we assume the same time of each operation Other way of explanation of the same as in last slide
  95. 100. List Scheduling Algorithm example ML-RCS
  96. 101. Generic List Scheduling
  97. 102. List Scheduling Example <ul><li>The scheduled DFG </li></ul><ul><li>DFG with mobility labeling (inside <>) </li></ul><ul><li>ready operation list/resource constraint </li></ul>
  98. 103. Static-List Scheduling <ul><li>DFG </li></ul><ul><li>Partial schedule of five nodes </li></ul><ul><li>Priority list </li></ul>The final schedule
  99. 104. Classification of Scheduling Approaches
  100. 105. Classification of Scheduling Approaches
  101. 106. Classification of Scheduling Approaches
  102. 109. Scheduling with chaining <ul><li>Consider propagation delays of resources not in terms of cycles. </li></ul><ul><li>Use scheduling to chain multiple operations in the same control step. </li></ul><ul><li>Useful technique to explore effect of cycle-time on area/latency trade-off . </li></ul><ul><li>Algorithms: </li></ul><ul><ul><li>ILP, </li></ul></ul><ul><ul><li>ALAP/ASAP, </li></ul></ul><ul><ul><li>List scheduling. </li></ul></ul>
  103. 110. Example of Scheduling with chaining <ul><li>Cycle-time: 60. </li></ul>
  104. 111. Summary <ul><li>Scheduling determines area/latency trade-off . </li></ul><ul><li>Intractable problem in general: </li></ul><ul><ul><li>Heuristic algorithms. </li></ul></ul><ul><ul><li>ILP formulation (small-case problems). </li></ul></ul><ul><li>Chaining: </li></ul><ul><ul><li>Incorporate cycle-time considerations. </li></ul></ul>
  105. 113. Other scheduling approaches
  106. 114. Three variants of Scheduling
  107. 115. Finite Impulse Response Filter This can be directly used for synthesis with 11 multipliers, 10 adders and 10 registers. But the latency would be 1 multiplier + 10 adders Example 1
  108. 116. FIR Scheduling 1 adder, 1 multiplier 2 multipliers This is also bad as we use both multipliers only in stage 1 There are many ways to solve this problem, transform the tree, schedule, allocate, pipeline, retime
  109. 117. Example: Cascade Filter optimization Look to ci coefficients and compare with two previous slides. Example 2 This is not FIR, six coefficients
  110. 118. Cascade Filter Scheduling, cont example 2 2 mul, 2 add
  111. 119. Infinite Impulse Response Filter Example 3 IIR Filter, 10 coefficients
  112. 120. IIR Filter Scheduling continued IIR Filter, 10 coefficients Two adders two multipliers
  113. 122. Minimize Resources Subject to bound on Latency = MR-LCS

×