Opencl in Scientific High Performance Computing

Opencl in Scientific High Performance Computing

OpenCL in Scientific High Performance Computing Matthias Noack [email protected] Zuse Institute Berlin Distributed Algorithms and Supercomputing 2019-09-24, IXPUG Annual Conference 2019 1 / 32 Audience Survey • Who has a rough idea what OpenCL is? • Who has hands-on experience with OpenCL? • Who is using OpenCL in a real-world code? • . Why? • . Why not? • . What are you using instead? 2 / 32 Audience Survey • Who has a rough idea what OpenCL is? • Who has hands-on experience with OpenCL? • Who is using OpenCL in a real-world code? • . Why? • . Why not? • . What are you using instead? 2 / 32 Audience Survey • Who has a rough idea what OpenCL is? • Who has hands-on experience with OpenCL? • Who is using OpenCL in a real-world code? • . Why? • . Why not? • . What are you using instead? 2 / 32 Audience Survey • Who has a rough idea what OpenCL is? • Who has hands-on experience with OpenCL? • Who is using OpenCL in a real-world code? • . Why? • . Why not? • . What are you using instead? 2 / 32 Audience Survey • Who has a rough idea what OpenCL is? • Who has hands-on experience with OpenCL? • Who is using OpenCL in a real-world code? • . Why? • . Why not? • . What are you using instead? 2 / 32 Audience Survey • Who has a rough idea what OpenCL is? • Who has hands-on experience with OpenCL? • Who is using OpenCL in a real-world code? • . Why? • . Why not? • . What are you using instead? 2 / 32 Audience Survey • Who has a rough idea what OpenCL is? • Who has hands-on experience with OpenCL? • Who is using OpenCL in a real-world code? • . Why? • . Why not? • . What are you using instead? 2 / 32 • intra-node parallelism dominated by OpenMP (e.g. Intel) and CUDA (Nvidia) ⇒ vendor and tool dependencies ⇒ limited portability ⇒ multiple diverging code branches ⇒ hard to maintain • inter-node communication = MPI • hardware life time: 5 years • software life time: multiple tens of years ⇒ outlives systems by far ⇒ aim for portability The Situation with Scientific HPC • tons of legacy code (FORTRAN) authored by domain experts ⇒ rather closed community ⇒ decoupled from computer science (ask a CS student about FORTRAN) • highly conservative code owners ⇒ modern software engineering advances are picked up very slowly 3 / 32 • hardware life time: 5 years • software life time: multiple tens of years ⇒ outlives systems by far ⇒ aim for portability The Situation with Scientific HPC • tons of legacy code (FORTRAN) authored by domain experts ⇒ rather closed community ⇒ decoupled from computer science (ask a CS student about FORTRAN) • highly conservative code owners ⇒ modern software engineering advances are picked up very slowly • intra-node parallelism dominated by OpenMP (e.g. Intel) and CUDA (Nvidia) ⇒ vendor and tool dependencies ⇒ limited portability ⇒ multiple diverging code branches ⇒ hard to maintain • inter-node communication = MPI 3 / 32 The Situation with Scientific HPC • tons of legacy code (FORTRAN) authored by domain experts ⇒ rather closed community ⇒ decoupled from computer science (ask a CS student about FORTRAN) • highly conservative code owners ⇒ modern software engineering advances are picked up very slowly • intra-node parallelism dominated by OpenMP (e.g. Intel) and CUDA (Nvidia) ⇒ vendor and tool dependencies ⇒ limited portability ⇒ multiple diverging code branches ⇒ hard to maintain • inter-node communication = MPI • hardware life time: 5 years • software life time: multiple tens of years ⇒ outlives systems by far ⇒ aim for portability 3 / 32 • use modern techniques with a broad community (beyond HPC) ⇒ e.g. modern C++ for host code ⇒ e.g. CMake for building • develop code interdisciplinary ⇒ domain experts design the model . ⇒ . computer scientists the software Do not contribute to that situation! What can we do better? • put portability first (6= performance portability) ⇒ OpenCL has the largest hardware coverage for intra-node programming • CPUs, GPUs, AI accelerators, FPGAs, . ⇒ library only ⇒ no tool dependencies 4 / 32 • develop code interdisciplinary ⇒ domain experts design the model . ⇒ . computer scientists the software Do not contribute to that situation! What can we do better? • put portability first (6= performance portability) ⇒ OpenCL has the largest hardware coverage for intra-node programming • CPUs, GPUs, AI accelerators, FPGAs, . ⇒ library only ⇒ no tool dependencies • use modern techniques with a broad community (beyond HPC) ⇒ e.g. modern C++ for host code ⇒ e.g. CMake for building 4 / 32 Do not contribute to that situation! What can we do better? • put portability first (6= performance portability) ⇒ OpenCL has the largest hardware coverage for intra-node programming • CPUs, GPUs, AI accelerators, FPGAs, . ⇒ library only ⇒ no tool dependencies • use modern techniques with a broad community (beyond HPC) ⇒ e.g. modern C++ for host code ⇒ e.g. CMake for building • develop code interdisciplinary ⇒ domain experts design the model . ⇒ . computer scientists the software 4 / 32 • higher-level programming model for OpenCL • single source, standard C++, ⇒ SYCL compiler needed • Standard Portable Intermediate Representation • standardised intermediate language ⇒ based on LLVM-IR • device-independent binaries for OpenCL Big Picture: OpenCL, SYCL, SPIR-V and Intel One API Application Intel One API Data Parallel C++ (DPC++) SYCL SPIR-V OpenCL CPU GPU FPGA AI ... 5 / 32 • Standard Portable Intermediate Representation • standardised intermediate language ⇒ based on LLVM-IR • device-independent binaries for OpenCL Big Picture: OpenCL, SYCL, SPIR-V and Intel One API Application • higher-level programming model for Intel One API OpenCL Data Parallel C++ • single source, standard C++, (DPC++) ⇒ SYCL compiler needed SYCL SPIR-V OpenCL CPU GPU FPGA AI ... 5 / 32 Big Picture: OpenCL, SYCL, SPIR-V and Intel One API Application • higher-level programming model for Intel One API OpenCL Data Parallel C++ • single source, standard C++, (DPC++) ⇒ SYCL compiler needed SYCL • Standard Portable Intermediate SPIR-V Representation • standardised intermediate language OpenCL ⇒ based on LLVM-IR • device-independent binaries for CPU GPU FPGA AI ... OpenCL 5 / 32 OpenCL (Open Computing Language) in a Nutshell • open, royalty-free standard for • personal computers, servers, mobile cross-platform, parallel programming devices and embedded platforms • maintained by Khronos Group • first released: 2009-08-28 https://www.khronos.org/opencl/ 6 / 32 OpenCL (Open Computing Language) in a Nutshell • open, royalty-free standard for • personal computers, servers, mobile cross-platform, parallel programming devices and embedded platforms • maintained by Khronos Group • first released: 2009-08-28 https://www.khronos.org/opencl/ 6 / 32 Memory Model: • CD has device memory with glottal/constant addr. space • CU has local memory addr. space • PE has private memory addr. space ⇒ relaxed consistency OpenCL Platform and Memory Model Compute Device (CD) Compute Unit (CU) ... ... ... Processing Element ... ... ... (PE) ... ... ... ... Host 7 / 32 OpenCL Platform and Memory Model Compute Device (CD) Compute Unit (CU) Memory Model: • ... ... ... CD has device Processing memory with glottal/constant Element ... ... ... (PE) ... addr. space . • CU has local memory addr. space ... ... ... • PE has private memory addr. space Host ⇒ relaxed consistency 7 / 32 ⇒ currently: widest practical portability of parallel programming models ⇒ write code for this abstract machine model ⇒ device-specific OpenCL compiler and runtime maps it to actual hardware ⇒ library-only implementation: no toolchain, many language bindings OpenCL Machine Model Mapping OpenCL Platform CPU Hardware GPU Hardware Compute Device Processor/Board GPU device Compute Unit Core (thread) Streaming MP Processing Element SIMD Lane CUDA Core global/const. memory DRAM DRAM local memory DRAM Shared Memory private memory Register/DRAM Priv. Mem./Register 8 / 32 ⇒ currently: widest practical portability of parallel programming models ⇒ device-specific OpenCL compiler and runtime maps it to actual hardware ⇒ library-only implementation: no toolchain, many language bindings OpenCL Machine Model Mapping OpenCL Platform CPU Hardware GPU Hardware Compute Device Processor/Board GPU device Compute Unit Core (thread) Streaming MP Processing Element SIMD Lane CUDA Core global/const. memory DRAM DRAM local memory DRAM Shared Memory private memory Register/DRAM Priv. Mem./Register ⇒ write code for this abstract machine model 8 / 32 ⇒ currently: widest practical portability of parallel programming models ⇒ library-only implementation: no toolchain, many language bindings OpenCL Machine Model Mapping OpenCL Platform CPU Hardware GPU Hardware Compute Device Processor/Board GPU device Compute Unit Core (thread) Streaming MP Processing Element SIMD Lane CUDA Core global/const. memory DRAM DRAM local memory DRAM Shared Memory private memory Register/DRAM Priv. Mem./Register ⇒ write code for this abstract machine model ⇒ device-specific OpenCL compiler and runtime maps it to actual hardware 8 / 32 ⇒ currently: widest practical portability of parallel programming models OpenCL Machine Model Mapping OpenCL Platform CPU Hardware GPU Hardware Compute Device Processor/Board GPU device Compute Unit Core (thread) Streaming MP Processing Element SIMD Lane CUDA Core global/const. memory DRAM DRAM local memory DRAM Shared Memory private memory Register/DRAM Priv. Mem./Register ⇒ write code for this abstract machine model ⇒ device-specific OpenCL compiler and runtime maps it to actual hardware ⇒ library-only implementation: no toolchain, many language

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    106 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us