Computing in Space PRACE Keynote Oskar Mencer, April 2014 - - PowerPoint PPT Presentation
Computing in Space PRACE Keynote Oskar Mencer, April 2014 - - PowerPoint PPT Presentation
Computing in Space PRACE Keynote Oskar Mencer, April 2014 Thinking Fast and Slow Daniel Kahneman Nobel Prize in Economics, 2002 17 24 = ? Kahneman
Thinking Fast and Slow
Daniel ¡Kahneman ¡ ¡
Nobel ¡Prize ¡in ¡Economics, ¡2002 ¡
¡ 17 ¡× ¡24 ¡= ¡? ¡ ¡ Kahneman ¡splits ¡thinking ¡into: ¡ System ¡1: ¡fast, ¡hard ¡to ¡control ¡... ¡400 ¡ System ¡2: ¡slow, ¡easier ¡to ¡control ¡... ¡408 ¡
Assembly-line computing in action
SYSTEM ¡1 ¡ x86 ¡cores ¡ SYSTEM ¡2 ¡ flexible ¡memory ¡ plus ¡logic ¡ Low ¡Latency ¡ Memory ¡ System ¡ High ¡Throughput ¡ Memory ¡ minimize data movement
OpVmal ¡ Encoding ¡
- A ¡program ¡is ¡a ¡sequence ¡
- f ¡instrucVons ¡ ¡
- Performance ¡is ¡dominated ¡
by: ¡
– Memory ¡latency ¡ – ALU ¡availability ¡
5 ¡
Temporal Computing (1D)
CPU ¡ Time ¡
Get ¡
- Inst. ¡
1 ¡
Memory ¡
C ¡ O ¡ M ¡ P ¡
Read ¡ data ¡ 1 ¡ Write ¡ Result ¡ 1 ¡
C ¡ O ¡ M ¡ P ¡
Read ¡ data ¡ 2 ¡ Write ¡ Result ¡ 2 ¡
C ¡ O ¡ M ¡ P ¡
Read ¡ data ¡ 3 ¡ Write ¡ Result ¡ 3 ¡
Actual ¡computaVon ¡Vme ¡
Get ¡
- Inst. ¡
2 ¡ Get ¡
- Inst. ¡
3 ¡
6 ¡
Spatial Computing (2D)
data ¡ in ¡ ALU ¡ ALU ¡ Buffer ¡ ALU ¡ Control ¡ ALU ¡ Control ¡ ALU ¡ data ¡
- ut ¡
Synchronous ¡data ¡movement ¡ Time ¡
Read ¡data ¡[1..N] ¡ ComputaVon ¡ Write ¡results ¡[1..N] ¡
Throughput ¡dominated ¡
7 ¡
New ¡CME ¡Electronic ¡Trading ¡Gateway ¡will ¡be ¡going ¡live ¡in ¡ March ¡2014! ¡
Webinar ¡Page: ¡hbp://www.cmegroup.com/educaVon/new-‑ilink-‑architecture-‑webinar.html ¡ ¡ ¡ CME ¡ Group ¡ Inc. ¡ (Chicago ¡ MercanVle ¡ Exchange) ¡ is ¡ one ¡ of ¡ the ¡ largest ¡ opVons ¡ and ¡ futures ¡
- exchanges. ¡It ¡owns ¡and ¡operates ¡large ¡derivaVves ¡and ¡futures ¡exchanges ¡in ¡Chicago, ¡and ¡New ¡
York ¡City, ¡as ¡well ¡as ¡online ¡trading ¡plagorms. ¡It ¡also ¡owns ¡the ¡Dow ¡Jones ¡stock ¡and ¡financial ¡ indexes, ¡ and ¡ CME ¡ Clearing ¡ Services, ¡ which ¡ provides ¡ seblement ¡ and ¡ clearing ¡ of ¡ exchange ¡
- trades. ¡…. ¡[from ¡Wikipedia] ¡
OpenSPL ¡in ¡PracVce
8 ¡
Maxeler Seismic Imaging Platform
- Maxeler provides Hardware plus application software for seismic modeling
- MaxSkins allow access to Ultrafast Modelling and RTM for research and
development of RTM and Full Waveform Inversion (FWI) from MatLab, Python, R, C/C++ and Fortran.
- Bonus: MaxGenFD is a MaxCompiler plugin that allows the user to
specify any 3D Finite Difference problem, including the PDE, coefficients, boundary conditions, etc, and automatically generate a fully parallelized implementation for a whole rack of Maxeler MPC nodes.
ApplicaVon ¡areas: ¡ ¡
- ¡O&G ¡
- ¡Weather ¡
- ¡3D ¡PDE ¡Solvers ¡
- ¡High ¡Energy ¡Physics ¡
- ¡Medical ¡Imaging ¡
9 ¡
Example: ¡ data ¡flow ¡graph ¡ ¡ generated ¡by ¡ ¡ MaxCompiler ¡ ¡ 4866 ¡ ¡ staVc ¡dataflow ¡cores ¡ in ¡1 ¡chip ¡
Star versus Cube Stencil
When ¡compuVng ¡in ¡space, ¡compuVng ¡more ¡can ¡be ¡faster ¡than ¡compuVng ¡ less ¡(if ¡it ¡reduces ¡the ¡amount ¡of ¡data ¡that ¡needs ¡to ¡be ¡moved ¡around! ¡
19 ¡MADDs ¡ 27 ¡MADDs ¡ Local ¡Buffer ¡= ¡6 ¡slices ¡ Local ¡Buffer ¡= ¡3 ¡slices ¡
Computing in Space - Why Now?
12 ¡
- Semiconductor ¡technology ¡is ¡ready ¡
– Within ¡ten ¡years ¡(2003 ¡to ¡2013) ¡the ¡number ¡of ¡transistors ¡on ¡a ¡chip ¡went ¡up ¡from ¡ 400M ¡(Itanium ¡2) ¡to ¡5Bln ¡(Xeon ¡Phi) ¡
- Memory ¡performance ¡isn’t ¡keeping ¡up ¡
– Memory ¡density ¡has ¡followed ¡the ¡trend ¡set ¡by ¡Moore’s ¡law ¡ – But ¡Memory ¡latency ¡has ¡increased ¡from ¡10s ¡to ¡100s ¡of ¡CPU ¡clock ¡cycles ¡ – As ¡a ¡result, ¡ ¡On-‑die ¡cache ¡% ¡of ¡die ¡area ¡increased ¡from ¡15% ¡(1um) ¡to ¡ ¡40% ¡(32nm) ¡ ¡ – Memory ¡latency ¡gap ¡could ¡eliminate ¡most ¡of ¡the ¡benefits ¡of ¡CPU ¡improvements ¡
- Petascale ¡challenges ¡(10^15 ¡FLOPS) ¡
– Clock ¡frequencies ¡stagnated ¡in ¡the ¡few ¡GHz ¡range ¡ – Energy ¡usage ¡and ¡Power ¡wastage ¡of ¡modern ¡HPC ¡systems ¡are ¡becoming ¡a ¡huge ¡ economic ¡burden ¡that ¡can ¡not ¡be ¡ignored ¡any ¡longer ¡ – Requirements ¡for ¡annual ¡performance ¡improvements ¡grow ¡steadily ¡ ¡ – Programmers ¡conVnue ¡to ¡rely ¡on ¡sequenVal ¡execuVon ¡(1D ¡approach) ¡
- For ¡affordable ¡petascale ¡systems ¡è ¡Novel ¡approach ¡is ¡needed ¡
OpenSPL Models
13 ¡
- Memory: ¡
– Fast ¡Memory ¡(FMEM): ¡many, ¡small ¡in ¡size, ¡low ¡latency ¡ – Large ¡Memory ¡(LMEM): ¡few, ¡large ¡in ¡size, ¡high ¡latency ¡ – Scalars: ¡many, ¡Vny, ¡lowest ¡latency, ¡fixed ¡during ¡exec. ¡
- ExecuVon: ¡
– datasets ¡+ ¡scalar ¡setngs ¡sent ¡as ¡atomic ¡“acVons” ¡ – all ¡data ¡flows ¡through ¡the ¡system ¡synchronously ¡in ¡“Vcks” ¡
- Programming: ¡
– API ¡allows ¡construcVon ¡of ¡a ¡graph ¡computaVon ¡ – meta-‑programming ¡allows ¡complex ¡construcVon ¡
OpenSPL Machine
14 ¡
- A ¡spaVal ¡compuVng ¡machine ¡system ¡consists ¡of: ¡
– appropriate ¡hardware ¡technology, ¡ ¡ i.e. ¡the ¡SpaVal ¡CompuVng ¡Substrate ¡(SCS) ¡ ¡ ¡ and ¡flexible ¡arithmeVc/computaVon ¡units ¡and ¡interconnect ¡ – an ¡SCS ¡specific ¡compilaVon ¡tool-‑chain ¡ – CPU-‑based ¡runVme ¡for ¡control ¡of ¡SCS ¡ ¡
- ComputaVon ¡divided ¡into ¡discrete ¡kernels ¡interconnected ¡by ¡
data ¡flow ¡streams ¡to ¡form ¡bigger ¡enVVes ¡ ¡
- In ¡a ¡spaVal ¡system ¡one ¡or ¡more ¡SCS ¡engines ¡exist, ¡each ¡
execuVng ¡a ¡single ¡acVon ¡at ¡any ¡moment ¡in ¡Vme ¡
x ¡ x ¡ + ¡
30 ¡
y ¡
SCSVar x = io.input("x", scsInt(32)); SCSVar result = x * x + 30; io.output("y", result, scsInt(32)); 15 ¡
OpenSPL Example: X2 + 30
OpenSPL Example: Moving Average
16 ¡
SCSVar x = io.input(“x”, scsFloat(7,17)); SCSVar prev = stream.offset(x, -1); SCSVar next = stream.offset(x, 1); SCSVar sum = prev + x + next; SCSVar result = sum / 3; io.output(“y”, result, scsFloat(7,17));
Y ¡= ¡(Xn-‑1 ¡+ ¡X ¡+ ¡Xn+1) ¡/ ¡3 ¡
OpenSPL Example: Choices
17 ¡ x ¡
+
1 ¡
y ¡
- ‑ ¡
1 ¡
>
10 ¡
SCSVar x = io.input(“x”, scsUInt(24)); SCSVar result = (x>10) ? x+1 : x-1; io.output(“y”, result, scsUInt(24));
Maxeler Dataflow Engine Platforms
18 ¡
High ¡Density ¡DFEs ¡
Intel ¡Xeon ¡CPU ¡cores ¡and ¡up ¡to ¡6 ¡ DFEs ¡with ¡288GB ¡of ¡RAM ¡
The ¡Dataflow ¡Appliance ¡
Dense ¡compute ¡with ¡8 ¡DFEs, ¡ 384GB ¡of ¡RAM ¡and ¡dynamic ¡ allocaVon ¡of ¡DFEs ¡to ¡CPU ¡servers ¡ with ¡zero-‑copy ¡RDMA ¡access ¡
The ¡Low ¡Latency ¡Appliance ¡
Intel ¡Xeon ¡CPUs ¡and ¡1-‑2 ¡DFEs ¡with ¡ direct ¡links ¡to ¡up ¡to ¡six ¡10Gbit ¡ Ethernet ¡connecVons ¡
19 ¡
Bringing Scalability and Efficiency to the Datacenter
Fixed-point bit-width exploration
‘true’ image: single-precision floating-point 8-bit fixed-point 10-bit fixed-point
1.00E+01 1.00E+02 1.00E+03 1.00E+04 1.00E+05 1.00E+06 4 6 8 10 12 14 16 18 20 22
SQRT Bit-width Difference Indicator Values
- f the Generated Images
Different ¡parts ¡are ¡explored ¡ separately, ¡i.e., ¡when ¡we ¡invesVgate ¡
- ne ¡part, ¡we ¡keep ¡the ¡bit-‑widths ¡in ¡
- ther ¡parts ¡a ¡constant ¡high ¡value ¡
Similarly, ¡we ¡observe ¡a ¡significant ¡ drop ¡of ¡the ¡error ¡when ¡the ¡SQRT ¡ bit-‑width ¡increases ¡from ¡8 ¡to ¡10 ¡ Similar ¡precision ¡thresholds ¡observed ¡in ¡both ¡syntheVc ¡and ¡field ¡results. ¡This ¡behavior ¡enables ¡an ¡ automaVc ¡tool ¡to ¡determine ¡the ¡minimum ¡precision ¡that ¡sVll ¡keeps ¡the ¡result ¡good ¡enough ¡ ¡
Floating-point bit-width exploration
1.00E-01 1.00E+00 1.00E+01 1.00E+02 1.00E+03 1.00E+04 1.00E+05 1.00E+06 2 4 6 8 10 12
Exponent Bit-width Difference Indicator values
- f the Generated Images
floating-point: 5-bit exponent floating-point: 6-bit exponent ‘true’ image: single-precision floating-point
We ¡use ¡the ¡Marmousi ¡syntheVc ¡ data ¡set ¡as ¡the ¡test ¡data, ¡and ¡ explore ¡different ¡combinaVons ¡of ¡ exponent ¡and ¡manVssa ¡bit-‑width ¡ ¡ A ¡precision ¡threshold ¡at ¡exponent ¡ width ¡of ¡6 ¡bits: ¡
- The ¡error ¡drops ¡significantly ¡when ¡
we ¡increase ¡the ¡exponent ¡width ¡ from ¡5 ¡bits ¡to ¡6 ¡bits ¡
- The ¡image ¡also ¡turns ¡from ¡nearly ¡
random ¡noise ¡at ¡5 ¡bits, ¡to ¡almost ¡ idenVcal ¡to ¡the ¡32-‑bit ¡image ¡at ¡6 ¡bits ¡ ¡
§ Equations: Shallow Water Equations (SWEs) § Atmospheric equations
𝜖𝑅/𝜖𝑢 +1/Λ 𝜖(Λ𝐺↑1 )/𝜖𝑦↑1 +1/Λ 𝜖(Λ𝐺↑1 )/𝜖𝑦↑2 +𝑇=0
Global Weather Simulation
[L. Gan, H. Fu, W. Luk, C. Yang, W. Xue, X. Huang, Y. Zhang, and G. Yang, Accelerating solvers for global atmospheric equations through mixed-precision data flow engine, FPL2013]
Always double-precision needed?
§ Range analysis to track the absolute values of all variables fixed-‑point ¡ ¡ fixed-‑point ¡ ¡ fixed-‑point ¡ ¡ reduced-precision reduced-precision
What about error vs area tradeoffs
§ Bit accurate simulations for different bit-width configurations.
Accuracy validation
[Chao Yang, Wei Xue, Haohuan Fu, Lin Gan, et al. ‘A Peta-scalable CPU-GPU Algorithm for Global Atmospheric Simulations’, PPoPP’2013]
And there is also performance gain
Meshsize: 1024×1024×6 MaxNode speedup over Tianhe node: 14 times Platform Performance () Speedup 6-core CPU 4.66K 1 Tianhe-1A node 110.38K 23x MaxWorkstation 468.1K 100x MaxNode 1.54M 330x 14x
And power efficiency too
Platform Efficiency
( )
Speedup 6-core CPU 20.71 1 Tianhe-1A node 306.6 14.8x MaxWorkstation 2.52K 121.6x MaxNode 3K 144.9x Meshsize: 1024×1024×6 MaxNode is 9 times more power efficient 9 x
28 ¡
Weather and climate models on DFEs
Which ¡one ¡is ¡beber? ¡ Finer ¡grid ¡and ¡higher ¡precision ¡are ¡obviously ¡preferred ¡but ¡the ¡computaVonal ¡ requirements ¡will ¡increase ¡è ¡Power ¡usage ¡à ¡$$ ¡ What ¡about ¡using ¡reduced ¡precision? ¡(15 ¡bits ¡instead ¡of ¡64 ¡double ¡precision ¡FP) ¡ ¡
29 ¡
Weather models precision comparison
30 ¡
What about 15 days of simulation?
Surface ¡pressure ¡azer ¡15 ¡days ¡of ¡simulaVon ¡for ¡the ¡double ¡precision ¡and ¡the ¡ reduced ¡precision ¡simulaVons ¡(quality ¡of ¡the ¡simulaVon ¡hardly ¡reduced) ¡
MAX-UP: Astro Chemistry
CPU DFE
Does it work?
32
Test problem 2D Linear advection 4th order Runge-Kutta Regular torus mesh Gaussian bump Bump is advected across the torus mesh After 20 timesteps it should be back where it started
Bump at t=20
CFD Performance
33
For this 2D linear advection test problem we achieve ca. 450M degree-of- freedom updates per second For comparison a GPU implementation (of a Navier- Stokes solver) achieves ca.50M DOFs/s
Max3A workstation with Xilinx Virtex 6 475t + 4-core i7
CFD Conclusions
You really can do unstructured meshes on a dataflow accelerator You really can max out the DRAM bandwidth You really can get exciting performance You have to work pretty hard Or build on the work of others This was not an acceleration project We designed a generic architecture for a family of problems
34