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
Dec 14, 2015
courseware
Integer Linear Programmingapproach to Scheduling
Sune Fallgaard Nielsen
Informatics and Mathematical ModellingTechnical University of Denmark
Richard Petersens Plads, Building 322DK2800 Lyngby, Denmark
[M-1] High-Level Synthesis 2SoC-MOBINET courseware
Outline
Introduction
- The new approach & objective
- Automated data path synthesis ILP Formulation Example Generalizations Experimental Results Conclusion
[M-1] High-Level Synthesis 3SoC-MOBINET courseware
The New Approach
Solve scheduling problem
1) ASAP -> start time
2) ALAP -> require time
3) ILP (Integer Linear Programming)
[M-1] High-Level Synthesis 4SoC-MOBINET courseware
Objective
Fully utilize the hardware resources
i.e. minimize the requirement of function units under a given timing constraint
[M-1] High-Level Synthesis 5SoC-MOBINET courseware
Support different kinds of data path
Multicycle operations Multiple operations per cycle Pipelined data paths Mutually exclusive operations Variables’ lifetime consideration
[M-1] High-Level Synthesis 6SoC-MOBINET courseware
Automated Data Path Synthesis
Scheduling
Allocation
Tightly interdependent
[M-1] High-Level Synthesis 7SoC-MOBINET courseware
Scheduling
** very important
FIX
1) number & types of function units
2) lifetime of variables
3) timing constraints
[M-1] High-Level Synthesis 8SoC-MOBINET courseware
The New Approach
1) ASAP
2) ALAP
3) ILP (Integer Linear Programming)
Function Units: Fully utilized minimize maximal no.
[M-1] High-Level Synthesis 9SoC-MOBINET courseware
The ILP Formulation
2 Assumptions: Each operation
– 1 cycle propagation delay Consider non-pipelined data path
[M-1] High-Level Synthesis 10SoC-MOBINET courseware
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
[M-1] High-Level Synthesis 11SoC-MOBINET courseware
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
[M-1] High-Level Synthesis 12SoC-MOBINET courseware
Formulas (1,2)
i 1
m
cti
Mti
Minimize total function unit cost
Mtk
0i 1
n
x ,i j
Oi Є FUtkfor 1 ≤ j ≤ s, 1 ≤ k
≤ m
No control step should contain more than Mtk function unit of type tk
[M-1] High-Level Synthesis 13SoC-MOBINET courseware
Formulas (3,4)
oi can only be scheduled into a step between Si & Li
for all oi ok
j Si
Li
x . i j 1
j Si
Li
j x ,i j
j Sk
Lk
j x ,k j -1
for 1 ≤ i ≤ n Ensure the precedence
relations of DFG will be preserved
[M-1] High-Level Synthesis 14SoC-MOBINET courseware
Example
Available function units:
~ multipliers (FUt1)
~ ALUs (FUt2)
Cost:
~ Ct1 = 5
~ Ct2 = 1
[M-1] High-Level Synthesis 15SoC-MOBINET courseware
Example
Integer programming formulation (formulas 1,2)
i 1
m
cti
Mti
minimize 5Mt1 + Mt2
x ,1 1 x ,2 1 x ,6 1 x ,8 1 Mt1
0
x ,3 2 x ,6 2 x ,7 2 x ,8 2 Mt1
0
x ,7 3 x ,8 3 Mt1
0
x ,10 1 Mt2
0
x ,9 2 x ,10 2 x ,11 2 Mt2
0
x ,4 3 x ,9 3 x ,10 3 x ,11 3 Mt2
0
x ,5 4 x ,9 4 x ,11 4 Mt2
0
Mtk
0i 1
n
x ,i j
Oi Є FUtk
[M-1] High-Level Synthesis 16SoC-MOBINET courseware
Example
Integer programming formulation (formulas 3,4)
j Si
Li
x . i j 1
j Si
Li
j x ,i j
j Sk
Lk
j x ,k j -1
x ,1 1 1
x ,2 1 1
x ,3 2 1
x ,4 3 1
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
x ,10 1 x ,10 2 x ,10 3 1
x ,11 2 x ,11 3 x ,11 4 1
x ,6 1 2 x ,6 2 2 x ,7 2 3 x ,7 3 -1
x ,8 1 2 x ,8 2 3 x ,8 3 2 x ,9 2 3 x ,9 3 4 x ,9 4 -1
x ,10 1 2 x ,10 2 3 x ,10 3 2 x ,11 2 3 x ,11 3 4 x ,11 4 -1
O6 O7
O8 O9
O10 O11
[M-1] High-Level Synthesis 17SoC-MOBINET courseware
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
[M-1] High-Level Synthesis 18SoC-MOBINET courseware
Generalizations
Multicycle operations Multiple operations per cycle Pipelined data paths Mutually exclusive operations Variables’ lifetime consideration
[M-1] High-Level Synthesis 19SoC-MOBINET courseware
Multicycle Operations
oi – operation
di – delay
for 1 ≤ j ≤ s, 1 ≤ k ≤ m
for all oi ok
j Si
Li
j x ,i j
j Sk
Lk
j x ,k j -1- di
[M-1] High-Level Synthesis 20SoC-MOBINET courseware
Multiple Operations per Cycle
New precedence relation oi => oj
-- oj is the nearest successor of oi
j Si
Li
j x ,i j
j Sk
Lk
j x ,k j -1 for all oi => ok
for all oi ok
j Si
Li
j x ,i j
j Sk
Lk
j x ,k j -10
[M-1] High-Level Synthesis 21SoC-MOBINET courseware
Pipelined Data Paths
l: fixed latency (integer multiple of a clock cycle) | si – sj |: integer multiple of l
[M-1] High-Level Synthesis 22SoC-MOBINET courseware
Mutually Exclusive Operations
If oi, oj – two mutually exclusive operations, X(oi, oj) = 1otherwise 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)
[M-1] High-Level Synthesis 23SoC-MOBINET courseware
Variables’ Lifetime Consideration
Function unit cost for both schedules are the same, but fewer number of registers needed in Fig(a)
[M-1] High-Level Synthesis 24SoC-MOBINET courseware
Variables’ Lifetime Consideration
SLKi,j – difference between the assigned control steps of oi, oj
(oi oj)
Minimize total step differences
minimize
[M-1] High-Level Synthesis 26SoC-MOBINET courseware
Experimental Results
Fifth order wave filter Containing 26
addition (1 cycle) &8 multiplication (2 cycles) operations
[M-1] High-Level Synthesis 27SoC-MOBINET courseware
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