Interger Linear Programming Approach to Scheduling

advertisement
courseware
Integer Linear Programming
approach to Scheduling
Sune Fallgaard Nielsen
Informatics and Mathematical Modelling
Technical University of Denmark
Richard Petersens Plads, Building 322
DK2800 Lyngby, Denmark
Outline
 Introduction
- The new approach & objective
- Automated data path synthesis
 ILP Formulation
 Example
 Generalizations
 Experimental Results
 Conclusion
SoC-MOBINET courseware
[M-1] High-Level Synthesis
2
The New Approach
 Solve scheduling problem
1) ASAP -> start time
2) ALAP -> require time
3) ILP (Integer Linear Programming)
SoC-MOBINET courseware
[M-1] High-Level Synthesis
3
Objective
 Fully utilize the hardware resources
i.e. minimize the requirement of function units
under a given timing constraint
SoC-MOBINET courseware
[M-1] High-Level Synthesis
4
Support different kinds of data path





Multicycle operations
Multiple operations per cycle
Pipelined data paths
Mutually exclusive operations
Variables’ lifetime consideration
SoC-MOBINET courseware
[M-1] High-Level Synthesis
5
Automated Data Path Synthesis
 Scheduling
 Allocation
 Tightly interdependent
SoC-MOBINET courseware
[M-1] High-Level Synthesis
6
Scheduling
 ** very important
 FIX
1) number & types of function units
2) lifetime of variables
3) timing constraints
SoC-MOBINET courseware
[M-1] High-Level Synthesis
7
The New Approach
1) ASAP
2) ALAP
3) ILP (Integer Linear Programming)
Function Units:
 Fully utilized
 minimize maximal no.
SoC-MOBINET courseware
[M-1] High-Level Synthesis
8
The ILP Formulation
2 Assumptions:
 Each operation
– 1 cycle propagation delay
 Consider non-pipelined data path
SoC-MOBINET courseware
[M-1] High-Level Synthesis
9
Data Flow Graph




n operations
s steps
oi – each operation 1 ≤ i ≤ n
oi  oj –
precedence relation
oi immediate predecessor of oj
 m types of function units
SoC-MOBINET courseware
[M-1] High-Level Synthesis
10





Si – start time (ASAP)
Li – require time (ALAP)
Cti – cost of function unit of type ti (FUti)
Mti – number of function unit of type ti
xi,j – 1: if oi is scheduled into step j
0: otherwise
SoC-MOBINET courseware
[M-1] High-Level Synthesis
11
Formulas (1,2)
m

ct Mt
i1 i i
n

x i, j M  0
t
k
i1
 Minimize total function
unit cost
 No control step should
contain more than Mtk
function unit of type tk
Oi
Є
FUt
for 1 ≤ j ≤ s, k1 ≤ k ≤
m courseware
SoC-MOBINET
[M-1] High-Level Synthesis
12
Formulas (3,4)
Li

jSi
 oi can only be scheduled
into a step between Si &
Li
x i . j1
for 1 ≤ i ≤ n
 Ensure the precedence
Lk

relations of DFG will be


preserved
j x k , j -1
 Li
 

 

 

j x i, j 

 
 jS
  jS
i
k

 





for all oi  ok
SoC-MOBINET courseware
[M-1] High-Level Synthesis
13
Example
 Available function units:
~ multipliers (FUt1)
~ ALUs (FUt2)
 Cost:
~ Ct1 = 5
~ Ct2 = 1
SoC-MOBINET courseware
[M-1] High-Level Synthesis
14
Example
 Integer programming formulation (formulas 1,2)
m
 ct Mt
i1 i
n

x i, j M  0
t
k
i1
i
minimize
5Mt1 + Mt2
Oi
Є
FUt
k
x 1, 1 x 2, 1 x 6, 1 x 8, 1 Mt  0
1
x 3, 2 x 6, 2 x 7, 2 x 8, 2 Mt  0
1
x 7, 3 x 8, 3 Mt  0
1
SoC-MOBINET courseware
[M-1] High-Level Synthesis
x 10, 1 Mt  0
2
x 9, 2 x 10, 2 x 11, 2 Mt  0
2
x 4, 3 x 9, 3 x 10, 3 x 11, 3 Mt  0
2
x 5, 4 x 9, 4 x 11, 4 Mt  0
2
15
Example
 Integer programming formulation (formulas 3,4)
Li
x 1, 1 1

x 2, 1 1
jSi
x 3, 2 1
x i . j1
x 4, 3 1
 Li
  Lk


 


 




j x i, j 
j x k , j -1

 

 jS
  jS

i
k

 



x 5, 4 1
x 6, 1 x 6, 2 1
x 7, 2 x 7, 3 1
x 8, 1 x 8, 2 x 8, 3 1
x 9, 2 x 9, 3 x 9, 4 1
O6  O7
x 6, 1 2 x 6, 2 2 x 7, 2 3 x 7, 3 -1
O8  O9
x 8, 1 2 x 8, 2 3 x 8, 3 2 x 9, 2 3 x 9, 3 4 x 9, 4 -1
O10  O11
x 10, 1 2 x 10, 2 3 x 10, 3 2 x 11, 2 3 x 11, 3 4 x 11, 4 -1
x 10, 1 x 10, 2 x 10, 3 1
 11, 3
SoC-MOBINET
11, 2courseware
x
x
x 11[M-1]
1
Synthesis
, 4High-Level
16
Example
 Scheduling result
-- optimal this formulation
 variables x1,1, x2,1,
x3,2, x4,3, x5,4, x7,3, x8,3,
x9,4,
x10,1 & x11,2 =>
1
 2 multipliers &
2 ALUs
SoC-MOBINET courseware
[M-1] High-Level Synthesis
17
Generalizations





Multicycle operations
Multiple operations per cycle
Pipelined data paths
Mutually exclusive operations
Variables’ lifetime consideration
SoC-MOBINET courseware
[M-1] High-Level Synthesis
18
Multicycle Operations
 oi
– operation
 di
– delay
for 1 ≤ j ≤ s, 1 ≤ k ≤ m
 Li
  Lk


 


 
 - di

j x i, j 
j x k , j -1

 

 jS
  jS

 i
  k



for all oi  ok
SoC-MOBINET courseware
[M-1] High-Level Synthesis
19
Multiple Operations per Cycle
 New precedence relation
 oi => oj
-- oj is the nearest successor of oi
 Li
  Lk


 


 
 0

j x i, j 
j x k , j -1

 

 jS
  jS

i
k

 



 Li
  Lk


 


 


j x i, j 
j x k , j -1

 

 jS
  jS

i
k

 


SoC-MOBINET courseware

[M-1] High-Level Synthesis
for all oi  ok
for all oi => ok
20
Pipelined Data Paths
 l: fixed latency (integer multiple of a clock cycle)
 | si – sj |: integer multiple of l
SoC-MOBINET courseware
[M-1] High-Level Synthesis
21
Mutually Exclusive Operations





If oi, oj – two mutually exclusive operations,
otherwise X(oi, oj) = 0
Both scheduled in control step k
Count function unit cost as 1, not 2
New 0/1 integer variable yk
-- 0 if xi,k = xj,k = 0
-- 1 if otherwise
xi,k + xj,k = yk in constraint (2)
SoC-MOBINET courseware
[M-1] High-Level Synthesis
X(oi, oj) = 1
22
Variables’ Lifetime Consideration
 Function unit cost for both
schedules are the same,
but fewer number of
registers needed in Fig(a)
SoC-MOBINET courseware
[M-1] High-Level Synthesis
23
Variables’ Lifetime Consideration
 SLKi,j – difference
between the
assigned control
steps of oi, oj
(oi  oj)
minimize
 Minimize total step
differences
SoC-MOBINET courseware
[M-1] High-Level Synthesis
24
Experimental Results
SoC-MOBINET courseware
[M-1] High-Level Synthesis
25
Experimental Results
 Fifth order wave filter
 Containing 26
addition (1 cycle) &
8 multiplication (2
cycles) operations
SoC-MOBINET courseware
[M-1] High-Level Synthesis
26
Conclusion
 Integer Linear Programming formulation (ILP) 
minimize the function unit cost
 Quite acceptable for practical synthesis
 Always find the optimal solution
 Different kinds of data path are taken into
account
SoC-MOBINET courseware
[M-1] High-Level Synthesis
27
courseware
THE END
Thanks 
Download