Project checkpoint slides

Download Report

Transcript Project checkpoint slides

An Integer Programming Approach to
Instruction Scheduling
Matt Streeter
Carsten Schwicking
Objective
• To use integer programming to obtain
optimal instruction schedules
• Assume partioning has already been
done (copies inserted, etc.)
Optimization & Constraints
• Optimize schedule length
• Constraints
– Single execution (of each instruction)
– Resource
– Data dependence
• Not yet dealing with crossbar constraint
Formulation Source
• Daniel Kaestner and Sebastian Winkel.
“ILP-based Instruction Scheduling
for
IA-64,” in LCTES 2001.
• Used a real multiple issue architecture
• IA-64 has VLIW characteristics
Integer Programming Formulation
• Define a variable for each possible
instruction, start time, and function unit
tuple
• Xkm t  {0,1}
– m = instruction id
– t = start time (cycle #)
– k = execution unit #
Constraints:
Instruction Executed Once

k

t
k
xnt
1 n
Constraints:
Resource

k
xnt
 Rk t, R
n: k R(n)
• Rk = # of execution units of type k
• R(n) = all possible execution units for n

Constraints:
Data Dependence
 t
k
t
k
* xmt
 t
 latency(m) 
k
k
* xnt
t
• where n must not execute until m finishes
Preliminary results
• Generated random data dependency trees
• Each node has degree chosen uniformly at
random from {0, 1, 2, 3}; durations chosen
from {1, 2, 3, 4}; function unit assigned at
random
• 4 function units, one of each type
• Maximum height H (=6 here)
Preliminary results
• Optimal scheduling only feasible for
basic blocks of ~10 instructions
• An alternative is to search for locally
optimal schedules
Preliminary results
• Use simple heuristic (list scheduling) to
generate a “center” schedule
• Until 10 seconds have elapsed:
– For r from 1 to rmax do:
• Generate optimal schedule subject to the
constraint that the cycle assigned to each
instruction is within a distance r of the cycle
assigned by the center schedule
Preliminary results
30
List schedules
Schedule length
25
IP schedules
20
15
10
5
0
[0,4]
[5,9]
[10,14]
[15,19]
[20,24]
[25,29]
[30,34]
[35,39]
[40,44]
Number of instructions
[45,49]
[50,54]
[55,59]