s6240 high level gpu programming using openmp 4 5 and
play

S6240 - High-Level GPU Programming Using OpenMP 4.5 and - PowerPoint PPT Presentation

S6240 - High-Level GPU Programming Using OpenMP 4.5 and Clang/LLVM Arpith Jacob , Alexandre Eichenberger, Samuel Antao, Carlo Bertolli, Tong Chen, Zehra Sura, Hyojin


  1. S6240 ¡-­‑ ¡High-­‑Level ¡GPU ¡ Programming ¡Using ¡OpenMP ¡4.5 ¡ and ¡Clang/LLVM Arpith ¡Jacob , ¡Alexandre ¡Eichenberger, ¡Samuel ¡Antao, ¡Carlo ¡Bertolli, ¡Tong ¡ Chen, ¡Zehra ¡Sura, ¡Hyojin ¡Sung, ¡Georgios ¡Rokos, ¡Kevin ¡O’Brien ¡ IBM ¡T. ¡J. ¡Watson ¡Research ¡Center ¡

  2. Overview • IBM ¡is ¡building ¡heterogeneous ¡systems ¡with ¡Power ¡+ ¡GPU ¡ GPU ¡ CPU ¡ • AdvocaKng ¡the ¡use ¡of ¡the ¡OpenMP ¡programming ¡model ¡ • IBM ¡Research ¡is ¡contribuKng ¡OpenMP ¡support ¡for ¡NVIDIA ¡GPUs ¡in ¡ Clang/LLVM ¡ • Upstreaming ¡in ¡progress. ¡download ¡at: ¡ ibm.biz/ykt-omp 2 ¡

  3. ExploiFng ¡Heterogeneous ¡Node ¡Resources Processing ¡ DP ¡units, ¡etc.. ¡ SP ¡CUDA ¡cores, ¡ SMTs ¡ T ¡ T ¡ T ¡ T ¡ T ¡ T ¡ T ¡ T ¡ Mul8processors ¡ Streaming ¡ C ¡ C ¡ C ¡ C ¡ PER ¡SOCKET ¡ SMX ¡ SMX ¡ SMX ¡ SMX ¡ SMX ¡ SMX ¡ 12 ¡CORES ¡ C ¡ C ¡ C ¡ C ¡ SMX ¡ SMX ¡ SMX ¡ SMX ¡ SMX ¡ SMX ¡ SMX ¡ C ¡ C ¡ C ¡ C ¡ Latency ¡SensiRve ¡ Throughput ¡OpRmized ¡ Kepler/Maxwell ¡ NVLINK/PCI-­‑E ¡ P8 ¡ High ¡single ¡thread ¡performance ¡ OpKmized ¡for ¡mulK-­‑threaded ¡code ¡ Kepler/Maxwell ¡ Hide ¡latency ¡via ¡memory ¡prefetch ¡or, ¡ Low ¡overhead ¡context ¡switch ¡ Kepler/Maxwell ¡ Cache ¡hierarchy ¡for ¡spaKal ¡and ¡temporal ¡locality ¡ P8 ¡ Hide ¡memory ¡latency ¡with ¡threads ¡ Kepler/Maxwell ¡ L1 ¡ Constant ¡ L2 ¡ Read-­‑Only ¡ L3 ¡ L1+SMEM ¡ off ¡chip ¡ off ¡chip ¡ L4 ¡ L2 ¡ L3 ¡ DRAM ¡ DRAM ¡ 12 ¡GB ¡ 2 ¡TB+ ¡ Storage ¡ Kepler ¡ 3 ¡

  4. Programmability ¡Challenge • ApplicaKons ¡must ¡exploit ¡heterogeneous ¡resources ¡in ¡a ¡ performance ¡portable ¡manner ¡ GPU ¡ CPU ¡ ¡ ¡ • Use ¡vendor ¡specific ¡languages ¡and ¡direcKves? ¡ • Compiler ¡specific ¡pragmas? ¡ • Mix ¡of ¡programming ¡models? ¡OpenMP, ¡OpenACC, ¡CUDA ¡ 4 ¡

  5. Programming ¡Overview RAJA ¡ KOKKOS ¡ OP2 ¡OPS ¡ … ¡ Fortran ¡ Kepler/Maxwell ¡ NVLINK/PCI-­‑E ¡ P8 ¡ Kepler/Maxwell ¡ Kepler/Maxwell ¡ P8 ¡ Kepler/Maxwell ¡ • OpenMP is widely used to program CPUs; latest specs support accelerators • Write performance portable code using flexible parallelism models • Industry-wide acceptance: IBM, Intel, PathScale, Cray, PGI, Oracle, MS 5 ¡

  6. OpenMP ¡Memory ¡Model ¡ node ¡memory ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ cache ¡ ¡ ¡ ¡ ¡ ¡ ¡ cache ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ L2 ¡ L2 ¡ L2 ¡ L2 ¡ ¡ ¡ ¡ ¡ ¡ L2 ¡ L2 ¡ L2 ¡ L2 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ core ¡ core ¡ core ¡ core ¡ core ¡ core ¡ core ¡ core ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ socket ¡ socket ¡ SMX ¡ SMX ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ GPU CPU 6 ¡

  7. OpenMP ¡Memory ¡Model ¡ node ¡memory L3 ¡ ¡ • CPU ¡threads ¡may ¡have ¡their ¡own ¡view ¡of ¡ ¡ ¡ shared ¡variables ¡ ¡ ¡ ¡ • Relaxed ¡consistency ¡ ¡ • Explicit ¡flush ¡operaKons ¡on ¡host ¡ required ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ • Unsynchronized ¡accesses ¡may ¡lead ¡to ¡data ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ L2 ¡ L2 ¡ L2 ¡ L2 ¡ ¡ ¡ ¡ ¡ L2 ¡ L2 ¡ L2 ¡ L2 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ races ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ core ¡ core ¡ core ¡ core ¡ core ¡ core ¡ core ¡ core ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ socket ¡ socket ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ CPU 7 ¡

  8. OpenMP ¡Memory ¡Model ¡ node ¡memory device ¡memory ¡ ¡ ¡ • OMP4 ¡extends ¡views ¡to ¡target ¡ ¡ ¡ ¡ ¡ devices ¡ ¡ ¡ ¡ ¡ • Map: ¡control ¡data ¡views ¡ ¡ ¡ ¡ ¡ • Target ¡data ¡enter/exit ¡ • Target ¡update ¡ ¡ ¡ ¡ ¡ • Unsynchronized ¡accesses ¡may ¡lead ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ cache ¡ ¡ ¡ ¡ ¡ ¡ ¡ cache ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ to ¡data ¡races ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ SMX ¡ SMX ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ GPU 8 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend