High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele...

30
Assoziierter Partner: Intel Deutschland GmbH High Performance Computing Rekonfigurierbare Architekturen für HPC Viktor Achter (RRZK), Florian Mayer (FAU)

Transcript of High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele...

Page 1: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Assoziierter Partner:Intel DeutschlandGmbH

High Performance Computing

RekonfigurierbareArchitekturen für HPC

Viktor Achter (RRZK), Florian Mayer (FAU)

Page 2: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Motivation / Ziele

▪ Erweiterung der technologischen Alternativen für HPC• Acceleratoren sind eine effektive Alternative zu CPUs

• Pro: höhere Effizienz bei passender Problemstellung

• Cons: hoher Spezialisierungsgrad

à möglichst große Auswahl unterschiedlichster Hardware Architekturen -

Auswahl passend zur Problemstellung

▪ Reduktion der Einstiegshürden• Einstiegshürde zu diversen Beschleunigern gering,

wenn diese mit OpenMP genutzt werden können.

• OpenMP Pragmas Standard in HPC.

17.10.18 ORKA-HPC 2

Page 3: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Optimierungsprobleme

▪ Normaler Compiler:

▪ ORKA-HPC Framework:

17.10.18 ORKA-HPC 3

Variable: Beschreibung Programm und Parallelismus

Bekannt: Architektur

Variable: Beschreibung Programm und Parallelismus

Bekannt: Architektur

Compiler: Optimiere für Architektur

Compiler: Optimiere für Architektur

Compiler: Optimiere Architektur für Algorithmus

Page 4: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Überblick Arbeitspakete

AP6Projektm

anagem

ent

AP1Optimierte Source-to-SourceTransformationvonOpenMP-PragmasAP5Dem

onstratorenfürFunktionalität,Leistung,

undQualitätskontrolle

AP4Schnittstellen undOptimierung

AP2Low-Level-Plattform AP3PartielleRekonfigurierbarkeit

2.2

1.2

3.3

4.31.2

4.1

1.1

4.3

1.5

4.2 4.2

Opt

3.4

3.3

3.4

1.6

3.3

1.3

4.1

4.2

5.2

5.1 1.4

5.35.4

6.1-6.4

4.1 4.1

17.10.18 ORKA-HPC 4

Page 5: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Assoziierter Partner:Intel DeutschlandGmbH

High Performance Computing

AP2+3 Low Level Platform

Page 6: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Bereitstellung: Low Level Plattformen

Anforderungen:▪ Unterstützung einer repräsentativen FPGA-Karte

• Xilinx, Altera

▪ Erstelle LL-Plattformen mit Optimierungen für unterschiedliche Code Charakteristiken• Maximale Speicherbandbreite• Cache• Streaming

▪ Jeweils optional mit Softcore und Debugging Funktionen

▪ Partielle Rekonfiguration• Nutzung größerer Chipflächen vs. Reprogrammierungszeiten

17.10.18 ORKA-HPC 6

Page 7: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Umfangreiches Design mit softcoreProzessor, Debugging, etc..

17.10.18 ORKA-HPC 7

Page 8: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Minimalistisches Design mit Speicherinterface und Pcie

17.10.18 ORKA-HPC 9

PCIE-Anbindung

Memory InterfaceAccelerator-Block

-> Viel Platz für Accelerator-Block/Blöcke

Page 9: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Assoziierter Partner:Intel DeutschlandGmbH

High Performance Computing

AP4 Schnittstellen und Optimierung

Page 10: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Optimierung

17.10.18 12

AP4Äußere Optimierung

AP4

AOpenMP-HLS

ORKA- Compiler

AP1 A

FPGA – InfrastukturLow Level Platform

(LLP)AP2/AP3

Parameter Resultat des Kompilierschritt

Wähle LLP

Ändere LLP Freie Bereiche (part. Reconfig)

ITERATIONEN gegen beste Performance

Page 11: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Unterstützung Laufzeitumgebung

▪ Informationsschnittstelle • 1te Dokumentation und Schnittstellendefinition

▪ Runtime Library in Arbeit

17.10.18 ORKA-HPC 13

Page 12: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Assoziierter Partner:Intel DeutschlandGmbH

High Performance Computing

AP 5 Demonstrator Suite

Page 13: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Demonstrator Application Suite

Anforderungen und Anwendungsfälle:

▪ Representation von Rechenmustern und OpenMP Annotationen• HPC und Data Analytic Workloads• Compute und Kontrollflüsse

▪ Demonstration von FPGA-bezogenen Optimierungen• Variable Repräsentation von Fixed und Floating-Point Daten über IEEE Standards hinaus (Double, Single, Half-Precision)• Ressourcen Optimierung

▪ Benchmarking und Qualitätssicherung• Mini-App und Kerneltypen von Demonstratoren• Performance und Ressourcennutzungs-Benchmarks• Referenzimplementierung auf CPUs und GPUs unter Nutzung von State-of-the-Art Features

(e.g. SIMD, Multi-threading)

17.10.18 ORKA-HPC 15

Page 14: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Beispielanwendungen und KernelsCode / Domain OpenMP Feature Anzahl Anmerkungen

SWCluster / IsingModel

omp parallelomp for [collapse]omp parallel for [collapse]omp parallel for reduction(+)omp [parallel] simd [for] [reduction(+)]

(2x)(2x)(2x)(1x)(3x)

CPU: C++GPU: CUDA

AMGmk (CORAL) / Solver

OpenMP code but no OpenMP 4.0 / 4.5 features Platzhalter für SCAI AMG solver

DM-HEOM Kernel / open quantum systems

omp parallel foromp simd

(17x)(7x)

CPU: C++ / OpenCLGPU: OpenCL

Genomics: Deduplication

Variable Datenrepräsentation

Deep Learning Kernel Suite

kompakte DL Kernel

HLS Kernels Performance-Vergleich

17.10.18 ORKA-HPC 16

Page 15: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Assoziierter Partner:Intel DeutschlandGmbH

High Performance Computing

AP1 - Optimierte Source-to-Source Transformation von OpenMP-Pragmas

Page 16: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Stand der Kunst

for (int i=0; i<n; ++i){if (cond(i)){

a[i] = 1;}b[i] = 0;

}

C-Code

Infrastruktur

"Code"

FPGA

MehrschrittigeWerkzeugkette

Stellschrauben

Page 17: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Stand der Kunst

for (int i=0; i<n; ++i){if (cond(i)){

a[i] = 1;}b[i] = 0;

}

C-Code

Infrastruktur

"Code"

FPGA

▪ Schaltung zu groß für FPGA

▪ Schaltung zu langsam für Timing

▪ ...

Trial & Error – "Tuning"Umprogrammierung

MehrschrittigeWerkzeugkette

Stellschrauben

Page 18: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

for (int i=0; i<n; ++i){if (cond(i)){

a[i] = 1;}b[i] = 0;

}

C-CodeZustandsautomat

1: i < n

2: if(cond(i))

3: a[i] = 0

4: b[i] = 1

5: i++;

6: exit

HLS, High-Level-Synthese (Teil 1)

Stellschrauben

Page 19: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance ComputingVHDL – Abstrakte Hardware-Beschreibung

1:

2:3:4:5:6:

Zustandsspeicher

<i

n

6

2

currentState

Folgezustand

Zustandsautomat

1: i < n

2: if(cond(i))

3: a[i] = 0

4: b[i] = 1

5: i++;

6: exit

HLS, High-Level-Synthese (Teil 2)

Stellschrauben

Page 20: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

VHDL – Abstrakte Hardware-Beschreibung

1:

2:3:4:5:6:

Zustandsspeicher

<i

n

62

currentState

Folgezustand

Netzliste – Konkrete Hardware für FPGA

"Code"

VHDL-Synthese

Logik-Synthese

Logik-Optimierung

etc.

Page 21: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Übertragung von C auf OpenMP

#pragma omp target fpga1#pragma omp parallel for#pragma omp simdfor (int i=0; i<n; ++i){

if (cond(i)){a[i] = 1;

}b[i] = 0;

}

OpenMP-Code

Interface

Infrastruktur

"Code"

FPGAOpenMP-Compiler

Rausschneiden

HLS, High-Level-Synthese (Teil 1)

HLS, High-Level-Synthese (Teil 2)

VHDL-Synthese, ...

AP4 - Autom. Optimierung

Page 22: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

{__omp_initialize_fpga(1);__omp_outlined(&n);

}

void __omp_outlined(...) {__make_threads();

__run_threads(__loopBody);__destroy_threads();

}

void __loopBody(...) {

for (...) {...}}

AP1: Zusammensuchen der verstreuten Code-Stücke, die der OpenMP-Compiler für das pragma-Beispiel produziert.

#pragma omp target fpga1#pragma omp parallel for#pragma omp simdfor (int i=0; i<n; ++i){

if (cond(i)){a[i] = 1;

}b[i] = 0;

}

OpenMP-Compiler

OpenMP-Code

Page 23: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

{__omp_initialize_fpga(1);__omp_outlined(&n);

}

void __omp_outlined(...) {__make_threads();

__run_threads(__loopBody);__destroy_threads();

}

void __loopBody(...) {

for (...) {...}}

AP1: Zusammensuchen der verstreuten Code-Stücke, die der OpenMP-Compiler für das pragma-Beispiel produziert.

#pragma omp target fpga1#pragma omp parallel for#pragma omp simdfor (int i=0; i<n; ++i){

if (cond(i)){a[i] = 1;

}b[i] = 0;

}

OpenMP-Compiler

Rausschneiden

OpenMP-Code

Page 24: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Kommerzielle HLS-Werkzeuge:▪ können nicht mit den vielen Code-Schnipseln

umgehen, die OpenMP-Compiler produzieren,▪ kennen das Datenabhängigkeitswissen nicht,

Zustandsautomat

1: i < n

2: if(cond(i))

3: a[i] = 0

4: b[i] = 1

5: i++;

6: exit

#pragma omp target fpga1#pragma omp parallel for#pragma omp simdfor (int i=0; i<n; ++i){

if (cond(i)){a[i] = 1;

}b[i] = 0;

}

HLS, High-Level-Synthese (Teil 1)

Page 25: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Kommerzielle HLS-Werkzeuge:▪ können nicht mit den vielen Code-Schnipseln

umgehen, die OpenMP-Compiler produzieren,▪ kennen das Datenabhängigkeitswissen nicht,

Zustandsautomat

1: i < n

2: if(cond(i))

3: a[i] = 0

4: b[i] = 1

5: i++;

6: exit

#pragma omp target fpga1#pragma omp parallel for#pragma omp simdfor (int i=0; i<n; ++i){

if (cond(i)){a[i] = 1;

}b[i] = 0;

}

Orka-HLS (Teil 1)

Bessere Ablaufplanung!

Page 26: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

HLS, High-Level-Synthese (Teil 2)

VHDL – Abstrakte Hardware-Beschreibung

1:

2:3:4:5:6:

Zustandsspeicher

<i

n

6

2

currentState

Folgezustand

Kommerzielle HLS-Werkzeuge:▪ können nicht mit den vielen Code-Schnipseln

umgehen, die OpenMP-Compiler produzieren,▪ kennen das Datenabhängigkeitswissen nicht,▪ verstehen #pragmas nicht.

#pragma omp target fpga1#pragma omp parallel for#pragma omp simdfor (int i=0; i<n; ++i){

if (cond(i)){a[i] = 1;

}b[i] = 0;

}

Page 27: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Kommerzielle HLS-Werkzeuge:▪ können nicht mit den vielen Code-Schnipseln

umgehen, die OpenMP-Compiler produzieren,▪ kennen das Datenabhängigkeitswissen nicht,▪ verstehen #pragmas nicht.

#pragma omp target fpga1#pragma omp parallel for#pragma omp simdfor (int i=0; i<n; ++i){

if (cond(i)){a[i] = 1;

}b[i] = 0;

}

Folgezustand

1:

2:

3:

4:

5:

6:

Zustandsspeicher

<i

n

62

currentState

VHDL – AbstrakteHardware-Beschreibung

<i

n

62

Orka-HLS(Teil 2)

Parallele Hardware!

Page 28: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

#pragma omp target fpga1#pragma omp parallel for#pragma omp simdfor (int i=0; i<n; ++i){

if (cond(i)){a[i] = 1;

}b[i] = 0;

}

Kommerzielle HLS-Werkzeuge:▪ können nicht mit den vielen Code-Schnipseln

umgehen, die OpenMP-Compiler produzieren,▪ kennen das Datenabhängigkeitswissen nicht,▪ verstehen #pragmas nicht.

AP1:▪ Technischer Durchstich des▪ Orka-HLS Frameworks

• Einfache Bit-Optimierung• SDC-Ablaufplanung

▪ Interface Generators▪ uvm.

Page 29: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Status

▪ Technischer Durchstich vom Kompilat zum laufenden FPGA Bitstream▪ Diverse Schnittstellendiskussionen mit Partnern und den anagestrebten HLS

Herstellern▪ Erste Low-Level-Plattformen erstellt sowie verskriptet▪ Erste Beschreibung von Runtime Library Schnittstellen erstellt▪ Einige Beispielcodes bestimmt und in Teilen vorbereitet▪ Erste Version des Treibers für die Host-FPGA Kommunikation vorbereitet▪ Für den Durchstich wurde eine teilfunktionale ORKA-HLS (ZIB, FAU) erstellt

Page 30: High Performance Computing Rekonfigurierbare ... · High Performance Computing Motivation / Ziele Erweiterung der technologischen Alternativen für HPC • Acceleratorensind eine

High Performance Computing

Vielen Dank!

▪ RRZK• Prof. Dr. Ulrich Lang

• Viktor Achter

• Lech Nieroda

▪ FhG SCAI• Horst Schwichtenberg

• Olga Rodikow

▪ Fridrich-Alexander Universität Erlangen (FAU)• Prof. Dr. Michael Philippsen

• Florian Mayer

▪ Konrad Zuse Institut• Dr. Thomas Steinke

• Marius Knaust

▪ Unterauftragnehmer / Assoziierte Partner• Jesko Schwarzer

• Dr. Michael Klemm (Intel Deutschland GmbH)