Docsity

Data Flow Scheduling Algorithms: ML-RCS and MR-LCS, Study notes of Electrical and Electronics Engineering

Partial preview of the text

Download Data Flow Scheduling Algorithms: ML-RCS and MR-LCS and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Data Flow Scheduling Algorithms

ECE594 – Reconfigurable System Synthesis

Ryan Kastner

February 4, 2004

Resource Constrained Scheduling

™

Constrained scheduling

™

General case NP-complete

™

Minimize latency given constraints on area orthe resources (ML-RCS)

™

Minimize resources subject to bound on latency (MR-LCS)

™

Exact solution methods

™

ILP: Integer Linear Programming

™

Hu’s heuristic algorithm for identical processors

™

Heuristics

™

List scheduling

™

Force-directed scheduling

Start Time vs. Execution Time

™

For each operation

v

i

, only one start time

™

If

d

i

, then the following questions are the same:

™

Does operation

v

i

start

at step

l

™

Is operation

v

i

running

at step

l

™

But if

d

i

, then the two questions should be formulated

as:

™

Does operation

v

i

start

at step

l

™

Does

x

il

= 1

hold?

™

Is operation

v

i

running

at step

l

™

Does the following hold?

1

1

=

∑

−

=

l

d

l

m

im

i

x

Operation

v

i

Still Running at Step

l?

™

Is

v

9

running at step 6?

™

Is

x

9,

+ x

9,

+ x

9,

™

Note:

™

Only one (if any) of the above three cases can happen

™

To meet resource constraints, we have to ask the samequestion for ALL steps, and ALL operations of that type

v

9

x

9,

v

9

x

9,

v

9

x

9,

™

Constraints:

™

Unique start times:

™

Sequencing (dependency) relations must be satisfied

™

Resource constraints

™

Objective: min

c

T

t

™

t

=start times vector,

c

=cost weight (e.g., [0 0 ... 1])

™

When

c

=[0 0 ... 1],

c

T

t

ILP Formulation of ML-RCS (cont.)

=

=

l

il

n

i

x

,

, 1 , 0

, 1

K

j

l

jl

l

il

i

j

j

j

i

d x l x l E v v d t t

1

=

−

=

K

K

l

n

k

a

x

res

k

k

v

T i

l

d

l

m

im

i^

i

nl

l

x

l

.

ILP Example

Assume

λ

= 4

First, perform ASAP and ALAP

™

(we can write the ILP without ASAP and ALAP, butusing ASAP and ALAP will simplify the inequalities)

NOP

×
×
×
×
×
×

NOP

NOP

×
×
×
×
×
×

NOP

v

v

v3 v

v

vn

v6 v

v8 v

v10 v

v

v

v3 v

v

vn

v6 v

v8 v

v10 v

ILP Example: Dependency Constraints

Using ASAP and ALAP, the non-trivialinequalities are: (assuming unit delay for + and *)

4 ,

11

3 ,

11

2 ,

11

5 ,

4 , 9 3 , 9 2 , 9 5 , 3 , 7 2 , 7 4 , 5 3 ,

10

2 ,

10

(^1) ,

10

4 ,

11

3 ,

11

2 ,

11

3 , 8

2 , 8

(^1) , 8 4 , 9 3 , 9 2 , 9

2 , 6

(^1) , 6 3 , 7 2 , 7

x

x

x

x

x

x

x

x

x

x

x

x x x x x x

x x x x x x

x

x

x

x

n

n

ILP Example: Resource Constraints

™

Resource constraints (assuming 2 adders and 2multipliers)

™

Objective:

™

Since

λ

=4 and sink has no mobility, any feasible solution is

optimum, but we can use the following anyway:

4 ,

11

4 , 9 4 , 5

3 ,

11

3 ,

10

3 , 9

3 , 4

2 ,

11

2 ,

10

2 , 9

(^1) ,

10

3 , 8

3 , 7

2 , 8 2 , 7 2 , 6 2 , 3 (^1) , 8

(^1) , 6

(^1) , 2

(^1) , 1

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

x

4 ,

3 ,

2 ,

(^1) ,

. 4. 3. 2

n

n

n

n

x

x

x

x

Min

Hu’s Algorithm

Simple case of the scheduling problem

™

All operations have unit delay

™

All operations (and resources) of the same type

™

Graph is forest

Hu’s algorithm

™

Greedy

™

Polynomial AND optimal

™

Computes lower bound on number of resources for agiven latencyOR: computes lower bound on latency subject toresource constraints

[©Gupta]

Basic Idea: Hu’s Algorithm

Relies on labeling of operations

™

Based on their distances from the sink

™

Length of the longest path passing through that node

Try to schedule nodes with higher labels first(i.e., most “critical” operations have priority)

Schedule

a

nodes at a time

™

a

is the number of resources

™

Only schedule nodes that have all theirparent/predecessor’s scheduled

™

Each time you schedule one time step (start with step1, 2, 3, …

[©Gupta]

Hu’s Algorithm: Example

[©Gupta]

Step 1: Label Vertices (Assume all

operations have unit delays):

Hu’s Algorithm: Example

[©Gupta]

Find unscheduled vertices withscheduled parents; pick 3 (num.resources) that maximize labels

List Scheduling

Heuristic methods for ML-RCS and MR-LCS

™

Does NOT guarantee optimum solution

Similar to Hu’s algorithm

™

Greedy strategy

™

Operation selection decided by criticality

™

O(n) time complexity

More general input

™

Works on general graphs (unlike Hu’s)

™

Resource constraints on different resource types

List Scheduling Algorithm: ML-RCS LIST_L (G(V,E),

a

l

repeat {

for each resource type k {

U

l,k

= available vertices in V

T

l,k

= operations in progress.

Select

S

k

⊆

U

l,k

such that |

S

k

T

l,k

a

k

Schedule the

S

k

operations at step

l

} l = l +

} until

v

n

is scheduled.