optimum s c heduling, allocation, and resource binding (oscar)

23
fakultät für informatik informatik 12 technische universität dortmund Optimum Sc heduling, Allocation, and Resource binding (OSCAR) Peter Marwedel TU Dortmund Informatik 12 2008/06/08

Upload: peyton

Post on 24-Jan-2016

33 views

Category:

Documents


0 download

DESCRIPTION

Optimum S c heduling, Allocation, and Resource binding (OSCAR). Peter Marwedel TU Dortmund Informatik 12. 2008/06/08. Überwindung der Trennung in 3 Phasen. Trennung in 3 Phasen lässt potenziell die optimale Lösung verpassen  Wir koppeln scheduling, allocation und assignment. +. -. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

fakultät für informatikinformatik 12

technische universität dortmund

Optimum Scheduling, Allocation, and Resource binding (OSCAR)

Peter MarwedelTU DortmundInformatik 12

2008/06/08

Page 2: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 2 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Überwindung der Trennung in 3 Phasen

Trennung in 3 Phasen lässt potenziell die optimale Lösung verpassen

Wir koppeln scheduling, allocation und assignment.

Page 3: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 3 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Integration von Scheduling, Allokation und Assignment in OSCAR

OSCAR = optimum scheduling, allocation, and resource binding

Gegeben: Datenfluss-Graph mit Operationen

Bausteinbibliothek

Quellen: B. Landwehr, P. Marwedel, R. Dömer: OSCAR: Optimum Simultaneous

Scheduling, Allocation and Resource Binding Based on Integer Programming, Proc. Euro-DAC, 1994, S. 90-95

B. Landwehr, P. Marwedel: A New Optimization Technique for Improving Resource Exploitation and Critical Path Minimization, 10th International Symposium on System Synthesis (ISSS), Antwerpen, 1997

Quellen: B. Landwehr, P. Marwedel, R. Dömer: OSCAR: Optimum Simultaneous

Scheduling, Allocation and Resource Binding Based on Integer Programming, Proc. Euro-DAC, 1994, S. 90-95

B. Landwehr, P. Marwedel: A New Optimization Technique for Improving Resource Exploitation and Critical Path Minimization, 10th International Symposium on System Synthesis (ISSS), Antwerpen, 1997

+

-

Page 4: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 4 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Entscheidungsvariablen im IP-Modell

Zentrale Entscheidungsvariable:

sonst,0

startet Exemplar auf hrittKontrollsc im Operation wenn,1,,

kijx kji

sonst ,0

wirdbenötigt stanzBausteinin die falls,1 kbk

Hilfsvariable:Hilfsvariable:

Page 5: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 5 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Beschränkungen (constraints) (1)

Operation assignment constraints:Jede Operation an exakt einen Kontrollschritt und an einen Hardware-Baustein zu binden: j J: i R(j) k K, j executable_on k xi,j,k = 1

Resource assignment constraints:Jede Komponente k kann höchstens alle ℓ(k) Kontrollschritte eine neue Operation starten. kK: iI: jJ i‘[i-ℓ (k)+1..i ] xi',j,k ≤ bk

i ≤ bk

i-ℓ (k)+1

i

Page 6: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 6 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

k i' ≤ i, i' R(j2) xi‘‚j2,k + k i' i, i' R(j1) xi‘‚j1,k ≤ 1

Beschränkungen (constraints) (2)

Precedence constraints: Zuerst müssen die Argumente berechnet werden.Sei j2 datenabhängig von Operation j1.

R(j1), R(j2): mögliche Kontrollschritt-Bereiche.j2

j1

Für alle Paare (j1, j2) daten-abhängiger Operationen:R(j2)

R(j1)

ii‘ i R(j1) R(j2) : j2 darf nicht vor oder in i

und j1 nicht nach oder in i ausgeführt werden.

i‘

iR(j1)R(j2):

Page 7: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 7 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Reservierung von Indices

Reservierung von Indices für potenzielle Bausteine k.

Strukturierte Methode:

Treppenfunktion für die Funktion type.

Beispiel:

Reservierung von max. 2 Indices pro Bausteintyp:

Page 8: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 8 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Vermeidung isomorpher Lösungen

Beispiel:bk+1 ≤ bk für type(k)=type(k+1)

Beispiel:bk+1 ≤ bk für type(k)=type(k+1)

IP-Verfahren benötigen ggf. viel Zeit, um Optimalität einer Lösung nachzuweisen

Isomorphe* Lösungen möglichst vermeiden!

Zusätzliche Constraints: Bausteine mit kleinerem k immer zuerst benutzen.

*Lösungen, die sich nur durch Umbenennung der Bausteine unterscheiden

B. Landwehr, P. Marwedel, I. Markhof, R. Dömer: Exploiting Isomorphism for Speeding-Up Instance-Binding in an Integrated Scheduling, Allocation and Assignment Approach to Architectural Synthesis, CHDL-97

Page 9: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 9 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Kostenfunktion

Def. cm: Kosten des Bausteintyps m ck1,k2: Kosten für Verbindung von k1 nach k2

sonst 0,

ist verbunden 2 mit 1 Baustein falls,12,1

kkw kk

Dann ergeben sich die Gesamtkosten als:Dann ergeben sich die Gesamtkosten als:

Mm

mktype

Mk kkkkkkkm wcbcC

)(2,1

2,12,1

Page 10: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 10 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Ein einfaches Beispiel

Gegeben: s := (u+v) * (w+x); t:=y*z;

ASAP/ALAP-Kontrollschritt-Bereiche:R(a) = [1,2]; R(b) = [1,2];R(c) = [1,4]; R(d) = [2,3];

ASAP/ALAP-Kontrollschritt-Bereiche:R(a) = [1,2]; R(b) = [1,2];R(c) = [1,4]; R(d) = [2,3];

Für die erste Zuweisung seien drei, für die zweite vier Kontrollschritte zulässig.

Für die erste Zuweisung seien drei, für die zweite vier Kontrollschritte zulässig.

Page 11: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 11 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Bausteinbibliothek:

Ergebnisse in einem Kontrollschritt verfügbar: k: ℓ(k)=1.

Gleiche Kosten aller Bausteine: m: cm=1.

Typ Operationen

1 +

2 *

3 +,*

Page 12: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 12 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Zielfunktion für Maximierung

wi,j nur für chaining* () benötigt;Annahme: kein chaining (immer Register zwischen arithmetischen Einheiten).

Zielfunktion für Maximierung:

C = -b1 -b2 -b3 -b4 -b5 -b6

-w1,3 -w1,4 -w1,5 -w1,6 -w2,3 -w2,4 -w2,5 -w2,6 -w5,3 -w5,4 -w5,6 -

w6,4 -w6,5

Zielfunktion für Maximierung:

C = -b1 -b2 -b3 -b4 -b5 -b6

-w1,3 -w1,4 -w1,5 -w1,6 -w2,3 -w2,4 -w2,5 -w2,6 -w5,3 -w5,4 -w5,6 -

w6,4 -w6,5

* Hintereinander geschaltete arithmetische Einheiten, die in demselben Kontrollschritt arbeiten

Page 13: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 13 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Operation assignment constraints (1)

j J: i R(j) k K, j executable_on k xi,j,k = 1

1. x1a1+x1a2+x1a5+x1a6+x2a1+x2a2+x2a5+x2a6=1

(die Operation a muss in Schritt 1 oder in Schritt 2 ausgeführt werden und an einen zur Addition fähigen Baustein gebunden werden);

2. Wie 1, jedoch für Operation b;

Page 14: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 14 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Operation assignment constraints (2)

j J: i R(j) k K, j executable_on k xi,j,k = 1

Page 15: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 15 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Resource assignment constraints

Für k=1,2 (Addierer)

Für k=3,4 (Mult.)

Für k=5 (Kombin.)

Für k=6 (Kombin.)

kK: iI: jJ i‘[i-ℓ (k)+1..i ] xi',j,k ≤ bk

Page 16: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 16 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Precedence constraints

iR(j1)R(j2): k i' ≤ i, i' R(j2) xi‚j2,k + k i' i, i' R(j1) xi‚j1,k ≤ 1

Page 17: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 17 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Lösung

Lösung:Operation c: Schritt 4Operation d: Schritt 3Operation a und b: Schritte 1 und 2.

Page 18: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 18 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Beschleunigungdurch Vermeidung von Isomorphie (2)

Beispiel: 3x3 DeterminantenSpeed

up

Page 19: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 19 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Beschleunigungdurch Vermeidung von Isomorphie

Beispiel: Elliptical Wave Filter

Speed up

Page 20: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 20 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Ergebnis der Nutzung algebraischer Regeln(Elliptical Wave Filter)

(Ohne algebraische Regeln) „optimale“ Lösung : 14 Kontrollschritte.Ausnutzung der algebraischen Regeln erlaubt die Reduktion des Hardware-Aufwandes bei gleicher Kontrollschritt-Zahl und die Reduktion der Kontrollschritt-Zahl.

Kontroll-schritte

Ohne Opti-mierung

Ersetzung von * durch Schiebe-operationen

Ausnutzung der Assoziativität

Ausnutzung der Assoziativität & von Schiebeoperationen

9 - - - 4a

10 - - - 4a

11 - 4a(ddierer) - 3a

12 - 3a 3m, 3a 3a

13 - 3a 2m, 3a 3a

14 2m(ult.), 3a 3a 1m, 3a 2a

15 1m, 3a 2a 1m, 2a 2a

Page 21: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 21 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Charakteristische Eigenschaftenvon IP-basierten Verfahren

Es kann Optimalität bezüglich des gewählten Kostenmodells garantiert werden,

es liegt ein präzises mathematisches Modell der zu lösenden Aufgabe vor,

es kann formal nachgewiesen werden, welche Eigenschaften eine synthetisierte Implementierung besitzt,

zusätzliche Bedingungen können verhältnismäßig leicht integriert werden.

IP ist NP-vollständig, für große Beispiele Heuristiken erforderlich.

IP-Modell gut als Ausgangsmodell für andere Methoden geeignet.

Page 22: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 22 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Charakteristische Eigenschaftenvon OSCAR

Kopplung an kommerzielle Software.

nutzt komplexe Baustein-Bibliotheken aus,

unterstützt Bausteine mit unterschiedlichen Geschwindigkeiten.

entscheidet, ob chaining sinnvoll ist,

erlaubt die Angabe von Zeitbedingungen,

nutzt algebraische Regeln aus.

benutzt genetischen Algorithmus zur Wahl einer Kombination von Regeln.

Page 23: Optimum S c heduling, Allocation, and Resource binding (OSCAR)

- 23 -technische universitätdortmund

fakultät für informatik

p.marwedel, informatik 12, 2008

TU Dortmund

Zusammenfassung

OSCAR

Integration von scheduling, allocation und assignment

Modellierung als Modell der Ganzzahligen Programmierung

Nutzung algebraischer Regeln