technische universität fakultät für informatik dortmund ... · technische universität - 2 -...

45
fakultät für informatik informatik 12 technische universität dortmund

Transcript of technische universität fakultät für informatik dortmund ... · technische universität - 2 -...

Page 1: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

fakultät für informatikinformatik 12

technische universität dortmund

Page 2: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

fakultät für informatikinformatik 12

technische universität dortmund

Non-Standard Rechner

Peter MarwedelInformatik 12TU Dortmund

2012/04/27Diese Folien enthalten Graphiken mit Nutzungseinschränkungen. Das Kopieren der Graphiken ist im Allgemeinen nicht erlaubt.

Page 3: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 2 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

2.7 ASIPs

Application-specific instruction set processor (ASIP):Befehlssatz aufgrund der Anwendung festgelegt.Einsatz:U.a. für effiziente eingebettete Prozessoren

Frühe Beispiele:Yasuura et al. (Fukuoka, Japan): Generische Architektur,

u.a. Datenwortbreiten anwendungsabhängig. I.-J. Huang: Weglassen unbenötigter Befehle beim 6509.

Wissenschaftliche Fragestellung:Wie konstruiert man systematisch „den besten“

Befehlssatz zu einer Anwendung?

Page 4: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 3 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Literatur

M. K. Jain, M. Balakrishnan, Anshul Kumar: ASIP Design Methodologies : Survey and Issues, VLSI Design, 2001

M. Gries, K. Keutzer (Hrg.): Building ASIPs: The Mescal Methodology, Springer, 2005

P. Ienne, R. Leupers (Hrg.): Customizable Embedded Processors, Morgan Kaufmann, 2006

O. Schliebusch, H. Meyr, R. Leupers: Optimized ASIP Synthesis fromArchitecture Description Language Models, Springer, 2007

T. Shiro, M. Abe, K. Sakanushi, Y. Takeuchi, M. Imai: A Processor Generation Method from Instruction Behavior Description Based on Specification of Pipeline Stages and Functional Units, ASP-DAC, 2007

C. Wolinski, K. Kuchcinski: Automatic selection of application-specificreconfigurable processor extensions, DATE, 2008

Laura Pozzi, Kubilay Atasu, Paolo Ienne: Exact and approximate algorithms forthe extension of embedded processor instruction sets. IEEE Transactions on CAD, 2006.

Tensilica Inc.: The xpres compiler: Triple-threat solution to code performance challenges. Tensilica Inc Whitepaper, 2005.

Page 5: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 4 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Existenznachweis der Energieeffizienz

Close to power efficiency of silicon

“inherent power

efficiency of silicon“

© Hugo De Man: From the Heaven of Software to the Hell of NanoscalePhysics: An Industry in Transition, Keynote Slides, ACACES, 2007

Page 6: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 5 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Maschinen, die jeweils einen abstrakten Befehlssatz interpretieren.

Programme werden in Befehle der abstrakten Befehlssätze übersetzt, nicht direkt in Maschinenbefehle realer Maschinen.

Beispiele: abstrakte Befehlssätze zur Realisierung von Java, (UCSD-) Pascal, PROLOG, LISP, FORTH, Smalltalk usw..

2.8 Abstrakte Maschinen

Lediglich der Interpreter der abstrakten Befehlssätze muss für verschiedene Maschinen jeweils neu erzeugt werden.Nachteil: niedrigere Ausführungsgeschwindigkeit.

Java

Page 7: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 6 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Java Virtual Machine

Java: Objektorientierte Programmiersprache Datentypen: byte, short, int, long, float, double, char Unterstützt Netzwerk-Programmierung Im Hinblick auf Sicherheit entworfen:

• keine Pointer-Manipulation wie in C, C++.• beschränkte Möglichkeit, Informationen über die momentane

Umgebung zu erfahren Automatische Freispeicherverwaltung Multithreading Über Netze auf alle relevanten Maschinen zu laden. Java-Programme können dort ausgeführt werden, wo die

JVM realisiert ist.

Page 8: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 7 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Eigenschaften der JVM

Die JVM ist eine Kellermaschine, Operationscodes in einem Byte kodiert, Typische Befehle:

• lade integer auf den Keller,• addiere die obersten Kellerelemente,• starte nebenläufige Ausführung,• synchronisiere nebenläufige Ausführung,• Befehle zur Realisierung der Objektorientierung

Byte-Code ist kompakt (≈ 1/3 der Größe von RISC-Code). Wichtig, wenn Code auf Prozessorchip zu speichern ist. JVM verzichtet weitgehend auf Alignment-Beschränkungen

+

Page 9: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 8 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

3 Methoden der Realisierung von JVMs:

1. Durch Interpretation von JVM-Befehlen in Software,

2. Durch Übersetzung in den Maschinencode der aufrufenden Maschine unmittelbar vor der Ausführung; just-in-time compilation.

3. Durch Realisierung einer JVM als „echte” Maschine.

Warum interessiert man sich füreine „echte“ Java-Maschine?

Exemplarische Betrachtung vonEntwicklungszielen

© M

icro

soft

Java

inside

Page 10: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 9 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

PicoJava

Ziel v.a. Verbesserung der Performance und für den Einsatz in vernetzten eingebetteten Systemen (GPS, Mobiltelephon, Netzwerktechnik, Chipcard-Systeme ..) PicoJava (I) (Sun, 1997): Spezifiziert, aber nie realisiert

• Oberste Kellerelemente im Prozessor in schnellem Speicher

• Häufigste Befehle in Hardware ausgeführt, CPI=1.• Komplexere Befehle: Mikroprogramm.• Ganz komplexe Befehle: Interrupt + Software

PicoJava II (Sun, 1999): Spec frei verfügbar(u.a. http://www1.pldworld.com/@xilinx/html/pds/HDL/picoJava-II/DOCS/pj2-uarch-guide.pdf

Page 11: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 10 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

PicoJava (2)

Ausgangsbasis für Realisierungen in FPGAs etc.

Drippling-Mechanismus für stack

© Graphik: Microsoft

Page 12: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 11 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Komodo (1)

Design: S. Uhrig (jetzt Fak. ET+IT, TU Dortmund!), Ungerer, .. Schwergewicht auf Realzeitfähigkeit Mehrfädig (engl. multi-threaded) Thread-tag wird im Fließband mitgeführt Prioritäten Manager selektiert nächsten Befehl:

• Fixed Priority Preemptive (FPP):#(Prioritätsebenen) = #(Hardware-Threads)

• Earliest Deadline First (EDF): Jedem Hardware-Thread muss eine 32-Bit Deadline zugeordnet werden.

• Least Laxity First (LLF): Jedem Hardware-Thread32-Bit Laxity = (Deadline-Laufzeit) zugeordnet.

• Guaranteed Percentage (GP): Jeder Thread erhält Prozentanteil (genau, minimal oder maximal)

© M

icro

soft

Page 13: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 12 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Komodo (2):Realzeitfähigkeit der Garbage-Collection

Anforderungen: Inkrementell Zeitlich vorhersagbar (feste obere Zeitschranken) Möglich (verfügbare Zeit nicht überschreiten) Robust (wenige Fehlermöglichkeiten für Programmierer) Effizient (wenig Prozessorzeit) Wenig Synchronisation (keine Pausen für Anwendungen) Nicht-kopierend

Lösung Ausnutzen der Multi-threading Möglichkeit Anpassen eines existierenden Algorithmus an Real-Time-

AnforderungenS. Fuhrmann, M. Pfeffer, J. Kreuzinger, Th. Ungerer, U. Brinkschulte: Real-Time Garbage Collection for a MultithreadedJava Microcontroller, 4th International Symposium on Object-Oriented Real-Time Distributed Computing, 2001

© Microsoft

Page 14: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 13 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

JOP - Java Optimized Processor

JOP is a processor designed to implement the JVM in hardware.

It is part of a PhD thesis at the Vienna University of Technology

Goal a simple and small processor optimized to execute Java

Thread support can simplify development of embedded systems

Common implementations of the JVM as interpreter or just-in-time compiler, are not practical.

http://www.jopdesign.com/ describes JOP (a Java Optimized Processor) is a hardware implementation of the JVM with predictable execution time for embedded real-time systems.

Due to the small size, it can be implemented in a low cost FPGA.For low volume systems, the flexibility of an FPGA can be important

Complete VHDL source and tools in Java are available for download from http://www.jopdesign.com/ . http://www.jopdesign.com/

Page 15: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 14 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Jazelle DBX (Direct Bytecode Execution)

Erlaubt es einigen ARM-Prozessoren Java Bytecode als 3. Betriebsmodus neben ARM und Thumb Modi

Gestartet mittels „branch to Java“ Befehl BXJ

Der erste Prozessor war der ARM926EJ-S

Häufig ausgeführte Codes werden in Hardware ausgeführt (gemäß ARM, 95% der Befehle in HW ausgeführt)

Andere Codes werden in SW ausgeführt

Basis: schnelle binary translation: JVM Codes werden während der Ausführung in ARM-Befehle übersetzt

just-in time translation nicht mehr notwendighttp://en.wikipedia.org/wiki/Jazelle

Page 16: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 15 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Nicht-Von-Neumann-Maschinen

Wir geben die sequentielle Ausführung von Programmcode auf ….

Page 17: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 16 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Reconfigurable Logic

Custom HW may be too expensive, SW too slow.Combine the speed of HW with the flexibility of SWHW with programmable functions and interconnect.Use of configurable hardware;

common form: field programmable gate arrays (FPGAs)Applications: algorithms like de/encryption, pattern matching in bioinformatics, high speed event filtering (high energy physics), high speed special purpose hardware.

Very popular devices from XILINX, Actel, Altera and others

Page 18: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 17 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Floor-plan of VIRTEX II FPGAs

Page 19: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 18 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Interconnect for Virtex II

Hierarchical Routing Resources;

More recent: Virtex5, 6, 7

no routing plan found for Virtex 7.

Page 20: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 19 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Virtex 7 Configurable Logic Block (CLB)

http://www.xilinx.com/support/documentation/user_guides/ug474_7Series_CLB.pdf

Page 21: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 20 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Virtex 7 Slice (simplified)

Memories typically used as look-up tables to implement any Boolean function of 6 variables.

Processors typically implemented as “soft cores”(microblaze)

Page 22: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 21 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Virtex 7 SliceM

SliceM supports using memories for storing data and as shift registers

Enables implementation of many non-standard architectures

© Xilinx

http://www.xilinx.com/support/documentation/user_guides/ug474_7Series_CLB.pdf

Page 23: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 22 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Datenflussprinzip:Systolisches Feld

A systolic array is a special-purpose parallel device, made out of a few simple cell types which are regularly and locally connected. [ H.T. Kung ]

Beispiel:

Parallele Eingabe:

Einfache Zellen(„CondSwap“, „Nop“):

Reguläre Struktur:

Page 24: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 23 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Beispiel für ein systolisches Feld:odd-even transposition sort (OETS), n=8

Daten werden synchron durch ein-oder zweidimensionale Felder "gepumpt" und dabei werden auf diesen Daten Berechnungen ausgeführt.

7 5 8 3 6 1 4 2

5 7 3 8 1 6 2 4

5 3 7 1 8 2 6 4

3 5 1 7 2 8 4 6

3 1 5 2 7 4 8 6

1 3 2 5 4 7 6 8

1 2 3 4 5 6 7 8

8 7 6 5 4 3 2 1

7 8 5 6 3 4 1 2

Prozessoren führen feste Befehle aus.Prozessoren führen feste Befehle aus.

Sortieren mit Aufwand von n², Latenz n und Durchsatz O(1).

Page 25: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 24 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Behauptung:systolisches Array für Matrixmultiplikation

Wie kann man systolische Arrays systematisch konstruieren?

Page 26: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 25 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Neuronale Netze

Neuronale Netze emulieren Netze von Neuronen in Lebewesen

Einsatz zur Klassifikation von Mustern und als nicht-lineare adaptive Filter

Neuronale Netze erfordern eine Anlernphase zum Einstellen der Parameter

Sind geeignet, wenn sonst wenig Erfahrung zur Lösung des Problems vorliegt.

jjiji ywfy

Page 27: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 26 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

2.9 Datenflussmaschinen

Die Operation beginnt, falls alle Argumente berechnetworden sind.

x

y

-

+* z

Verfügbarkeit von Daten veranlasst Ausführung von Operationen: Beispiel: z = (x + y) * (x - y);# x, y, z: Benennungen für Werte.

Modellierung mit Marken: Gültige Daten werden als Marken dargestellt. Eine Operation kann ausgeführt werden, falls alle ihre Argumente markiert sind. Potenziell viele Operationen gleichzeitig!

Page 28: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 27 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Darstellung der Befehle in der Maschine (Dennis)

Als Tupel (Opcode, Plätze für Argumente, Ziel-Liste).Die Ziel-Liste ist die Liste der Tupel, die das Ergebnis als Argument benötigen.

Page 29: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 28 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Komplizierterer Fall

y := (IF x > 3 THEN x+2 ELSE x-1) * 4

Suche nach Treffern ähnlich „reservation stations“ bei Tomasulo Algorithmus (nächstes Kapitel)Statischer Datenfluss: Zuordnung Token/Operation sind fest

Page 30: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 29 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Dynamischer Datenfluss

Es wird dynamisch nach zueinander passenden Daten gesucht Erst im Fall eines Treffers werden die dazugehörigen

Befehle geholt. Erlaubt, für mehrere Daten Befehle gemeinsam zu nutzen,

z.B. für alle Komponenten eines Arrays Wegen der dynamische Suche nach passenden Daten

(über Assoziativspeicher) relativ hoher Aufwand

Page 31: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 30 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

At last …: Kommerzielles Angebot

www.maxeler.comBenutzt u.a. zur Erderkundung (Ölsuche) und high speed trading

Page 32: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 31 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Beispiel für die Programmierung

Pell,

O.;

Aver

bukh

, V.,

"Max

imum

Per

form

ance

Com

putin

gw

ithD

ataf

low

Engi

nes,

" Com

putin

gin

Sci

ence

& E

ngin

eerin

g, v

ol.1

4, n

o.4,

pp

.98,

103,

Jul

y-Au

g. 2

012

© IEEE, 2012

Page 33: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 32 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Vorteile der Datenflussrechner

Vorteile eingebaute Parallelität, eingebaute Synchronisation;

vereinfachte Parallelisierung

Adressen sind nach außen nicht sichtbar

vorteilhaft bei gemeinsamen Teilausdrücken

beliebige Reihenfolge der Abarbeitung bereiter Befehle

Page 34: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 33 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Historie der Datenflussrechner

Euphorie Ende der 70er Jahre

Stille Ende der 80er Jahre

Prinzipien später teilweise in andere Systeme integriert• Datenflussrechner können leicht asynchron realisiert werden,

benötigen so wenig Energie (z.B. Entwicklung . Sharp/U.Kochi/U.Osaka für Videokameras)

• Von-Neumann-Rechner mit dynamischen Scheduling(Scoreboarding, Tomasulo-Algorithmus) [Kap.3] haben das Datenflussprinzip intern übernommen.

• Datenflusssprachen: LabView, Simulink, ….

„Datenflussrechner“ sind Realität, aber nicht in der ursprünglichangedachten Form

Page 35: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 34 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

2.10 Funktionale Programmierungund Reduktionsmaschinen

Maschinen unterstützen die Auswertung funktionaler Programme direkt.

Reduktionsmaschinen akzeptieren Ausdrücke einer funktionalen Sprache.

Auswertung mittels Baumtransformationen, bis ein Wert erhalten wird.

Die Bedeutung eines Programms = abgelieferter Wert.

Einfachere Verifikation

Vereinfachte Parallelverarbeitung

Page 36: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 35 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Auswertungsstrategien

1. string reductionJede Operation, die auf eine bestimmte Definition (auf einen bestimmten Teilbaum) zugreift, erhält und bearbeitet eine Kopie des Teilbaums. erleichterte Realisierung, schnelle Bearbeitung skalarer Werte, ineffiziente Behandlung gemeinsamer Teilausdrücke.

2. graph reductionJede Operation, die auf eine bestimmte Definition zugreift, arbeitet über Verweise auf der Original-Definition. schwieriger zu realisieren, falls parallel bearbeitet wird; effizient auch für strukturierte Werte und gemeinsame Teilausdrücke; komplizierte Haldenverwaltung (garbagecollection).

Page 37: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 36 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Steuerung der Berechnungs-Reihenfolge

1. Die „outermost”- oder „demand driven”-Strategie:Operationen werden selektiert, wenn der Wert, den sie produzieren, von einer bereits selektierten Operation benötigt wird.Erlaubt lazy evaluation.Erlaubt konzeptuell unendliche Listen, solange nur endl. Teilmengen referenziert werden (vgl. Streams).

2. Die „innermost”- oder „data-driven” - Strategie:Operationen werden selektiert, wenn alle Argumente verfügbar sind.

Page 38: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 37 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Vorteile

Programmierung auf höherer Ebene kompakte Programme keine Seiteneffekte kein Aliasing, keine unerwartete Speichermodifikation keine Unterscheidung zwischen call-by-name, call-by-

value und call-by-reference notwendig einfachere Verifikation, da nur Funktionen benutzt werden das von-Neumann-Modell von Speicherzellen und

Programmzählern ist überflüssig beliebige Berechnungsreihenfolge für Argumente

(außer bei nicht-terminierenden Berechnungen) Debugging einfach: Trace des aktuellen Ausdrucks. Kommerziell bislang nicht erfolgreich

Page 39: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 38 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Ansätze zur Nutzung von funktionaler Programmierung bei Multi-Core-Prozessoren

Verschiedene funktionale Sprachen MapReduce (Google): Definition zweier Funktionen:

• map: (key,value) (intermediate key,intermed. value)*• reduce: (intermed. key,value*) (intermed. key,value)

Beispiel:• map: (buchtitel, inhalt) (wort, 1)*• reduce erhält nach wort sortierte Tupel, zählt Worte

und liefert Häufigkeit für ein bestimmtes Wortmap und reduce sind Funktionen CLOJURE: Lisp-Dialekt zur parallelen Programmierung

auf der Basis der JVM

Page 40: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 39 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Direkte Realisierung von logischen Programmiersprachen

Beispiel: PROLOG-Maschinen

Realisierung: PROLOG-Maschinen basieren meist auf der Übersetzung von PROLOG in Warren Abstract Machine- (WAM) Code.

WAM-Realisierung:

• WAM von Maschinenprogrammen interpretiert,

• WAM-Befehle in Maschinencode übersetzt

• WAM in Hardware

2.11 Maschinen zur Realisierungvon Logischen Programmiersprachen (1)

Page 41: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 40 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Maschinen zur Realisierungvon Logischen Programmiersprachen (2)

Beispiele von Maschinen: PRIPs = Entwurf der Projektgruppe PRIPs. Entwürfe des 5th Generation Projekts.

© M. Engel, 2012

Klassen von PROLOG-Maschinen:

Sequentielle Maschinen mit strenger Wahrung der PROLOG-SemantikLeiden meist unter Performanz-Problemen

Parallele Maschinen mit unterschiedlicher Semantik(basieren nicht mehr auf formaler Mathematik)

Problem: mit Datenmengen zunehmende Inkonsistenzen

Page 42: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 41 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Weitere Nicht-Von-Neumann-Maschinen: DNA-Rechner

Im DNA-Molekül erfolgt eine Kodierung von Informationen mit 4 verschiedenen Basen. In einem Liter Flüssigkeit mit 6 g DNA ließen sich

theoretisch ca. 3000 Exabyte an Informationen speichern. Die Rechenleistung läge bei ca. 1015 Operationen/s. Durch die Parallelverarbeitung könnten theoretisch

kryptographische Schlüssel ermittelt werden. Angeblich wurde ein traveling salesmen –Problem gelöst

– nur das Auslesen dauert lange. Referenz: K.H. Zimmermann, Z. Ignatova, I. Martinez-

Perez: DNA Computing Models, Springer, 2008

[wikipedia]

Page 43: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 42 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Weitere Nicht-Von-Neumann-Maschinen: Quantenrechner

Nullen und Einsen verschiedener Lösungen können sich in einem Register überlagern. Dadurch parallele Berechungen möglich.

• Durch die Form der Parallelarbeit verändernsich die Komplexitäten von klassischenAlgorithmen:

- Algorithmus von Shor zur nicht-exponentiellen Faktorisierung auf einem Quantenrechner

- Die Faktorisierung von 143 ist praktischgelungen

Quantenrechner werden Spezialaufgaben vorbehalten bleiben, sie bilden keinen Ersatz für klassische Rechner.

Vermutete Form der Komplexitätsklassen, BQP: bounded error, quantum, polynomial

[wikipedia]

Page 44: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 43 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Weitere Nicht-Von-Neumann-Maschinen: Quantenkryptographie

Nutzung quantenmechanischer Effekte, um kryptographische Probleme zu lösen oder um kryptographische Systeme zu überwinden*. Beispiele:

• Nutzung von Quantenrechnern, um kryptographische Codes zu knacken

• Quantenmechanische Kommunikation: Nutzt das quanten-mechanische Phänomen, dass allein die Beobachtung eines Zustandes eine Selektion unter Zuständen bewirkt. Tauschen Partner Schlüssel aus, so bewirkt schon die Beobachtung der Kommunikation durch einen Dritten eine Veränderung.Übertragung per Glasfaserkabel z.B. über 250 km°Gedacht v.a. für den Austausch von Schlüsseln

* Wikipedia, „Quantum computing“, Abfrage 16.4.2011° D Stucki, N Walenta, F Vannel, R T Thew, N Gisin, H Zbinden, S Gray, C R Towery, S Ten: High rate, long-distance quantum key distribution over 250 km of ultra low loss fibres, New Journal of Physics, Vol. 11, 2009

Page 45: technische universität fakultät für informatik dortmund ... · technische universität - 2 - dortmund fakultät für informatik p. marwedel, g. fink informatik 12, 2013 2.7 ASIPs

- 44 -technische universitätdortmund

fakultät fürinformatik

p. marwedel, g. fink informatik 12, 2013

Zusammenfassung

Application Specific Instruction Set Processors Abstrakte Maschinen Field programmable gate arrays (FPGAs) Datenflussprinzip

• Systolic arrays• Neuronale Netze• „Echte“ Datenflussmaschinen

Funktionale Programmierung und Reduktionsmaschinen Realisierung logischer Programmiersprachen DNA-Computing Quantum Computing