kokkos hierarchical task data parallelism
play

Kokkos Hierarchical Task-Data Parallelism Photos placed in - PowerPoint PPT Presentation

Kokkos Hierarchical Task-Data Parallelism Photos placed in horizontal position with even amount for C++ HPC Applica9ons of white space between photos and header GPU Tech. Conference Photos


  1. Kokkos ¡ Hierarchical ¡Task-­‑Data ¡Parallelism ¡ Photos placed in horizontal position with even amount for ¡C++ ¡HPC ¡Applica9ons ¡ of white space between photos and header GPU ¡Tech. ¡Conference ¡ Photos placed in horizontal April ¡4-­‑7, ¡2016 ¡ position with even amount of white San ¡Jose, ¡CA ¡ space ¡ between photos and header H. ¡Carter ¡Edwards ¡ ¡ SAND2016-­‑3114 ¡C ¡ Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary of Lockheed Martin Corporation, for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000. SAND NO. 2011-XXXXP

  2. LAMMPS ¡ EMPIRE ¡ Albany ¡ SPARC ¡ Drekar ¡ Applica9ons ¡& ¡Libraries ¡ Trilinos ¡ Kokkos* ¡ performance ¡portability ¡for ¡C++ ¡applica?ons ¡ HBM ¡ HBM ¡ HBM ¡ HBM ¡ DDR ¡ DDR ¡ DDR ¡ DDR ¡ DDR ¡ Mul9-­‑Core ¡ APU ¡ CPU+GPU ¡ Many-­‑Core ¡ * κόκκος Greek: ¡“granule” ¡or ¡“grain” ¡; ¡ ¡like ¡grains ¡of ¡sand ¡on ¡a ¡beach ¡ 1 ¡

  3. Abstrac9ons: ¡PaWerns, ¡Policies, ¡and ¡Spaces ¡ § Parallel ¡PaWern ¡of ¡user’s ¡computa9ons ¡ § parallel_for, ¡parallel_reduce, ¡parallel_scan, ¡... ¡ EXTENSIBLE ¡ § Execu9on ¡Policy ¡tells ¡ how ¡user ¡computa9on ¡will ¡be ¡executed ¡ § Sta9c ¡scheduling, ¡dynamic ¡scheduling, ¡thread-­‑teams, ¡... ¡ EXTENSIBLE ¡ § Execu9on ¡Space ¡tells ¡ where ¡user ¡computa9ons ¡will ¡execute ¡ § Which ¡cores, ¡numa ¡region, ¡GPU, ¡... ¡ (extensible) ¡ § Memory ¡Space ¡tells ¡ where ¡user ¡data ¡resides ¡ § Host ¡memory, ¡GPU ¡memory, ¡high ¡bandwidth ¡memory, ¡... ¡ (extensible) ¡ § Array ¡Layout ¡(policy) ¡tells ¡ how ¡ user ¡data ¡is ¡laid ¡out ¡in ¡memory ¡ § Row-­‑major, ¡column-­‑major, ¡array-­‑of-­‑struct, ¡struct-­‑of-­‑array ¡… ¡ ¡ (extensible) ¡ § Differen9a9ng ¡feature: ¡Array ¡Layout ¡and ¡Memory ¡Space ¡ § Versus ¡other ¡programming ¡models ¡(OpenMP, ¡OpenACC, ¡…) ¡ § Cri9cal ¡for ¡performance ¡portability ¡… ¡see ¡previous ¡GPU-­‑Tech ¡Kokkos ¡talks ¡ 2 ¡

  4. Acknowledgements ¡ § Sandia ¡Na9onal ¡Laboratory ¡(SNL) ¡ Laboratory ¡Directed ¡Research ¡& ¡Development ¡(LDRD) ¡Project ¡ § Strategic ¡R&D ¡funded ¡at ¡Sandia’s ¡discre9on ¡ § Recognized ¡with ¡$$ ¡as ¡strategic ¡high ¡priority ¡ § SNL ¡LDRD ¡Team ¡ § myself, ¡Stephen ¡Olivier, ¡Jonathan ¡Berry, ¡Greg ¡Mackey, ¡Siva ¡Rajamanickam, ¡ Kyungjoo ¡Kim, ¡George ¡Stelle, ¡and ¡Michael ¡Wolf ¡ § Scheduling ¡algorithm ¡inspired ¡from ¡SNL’s ¡Qthreads ¡library ¡ § Cri9cal ¡support ¡from ¡NVIDIA ¡ § Thanks ¡to ¡Tony ¡Scudiero, ¡Greg ¡Branch, ¡Ujval ¡Kapasi, ¡and ¡the ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ whole ¡nvcc ¡development ¡team ¡ § Early ¡access ¡to ¡nvcc ¡CUDA ¡8 ¡essen9al ¡for ¡relocatable ¡device ¡code ¡ 3 ¡

  5. New ¡(prototype) ¡Kokkos ¡Capability: ¡ Dynamic ¡Directed ¡Acyclic ¡Graph ¡(DAG) ¡of ¡Tasks ¡ § Extension ¡of ¡Parallel ¡PaWern ¡ § Tasks: ¡Heterogeneous ¡collec9on ¡of ¡parallel ¡computa9ons ¡ § DAG: ¡Tasks ¡may ¡have ¡acyclic ¡“execute ¡aker” ¡dependences ¡ § Dynamic: ¡New ¡tasks ¡may ¡be ¡created/allocated ¡by ¡execu9ng ¡tasks ¡ § Extension ¡of ¡Execu9on ¡Policy ¡ ¡ § Schedule ¡tasks ¡for ¡execu9on ¡ § Manage ¡tasks’ ¡dynamic ¡lifecycle ¡ 4 ¡

  6. Use ¡Cases ¡(mini-­‑applica9ons) ¡ 1. Incomplete ¡Level-­‑K ¡Cholesky ¡factoriza9on ¡of ¡sparse ¡matrix ¡ ¡ § Block ¡par99oning ¡into ¡submatrices ¡ Chol 0 1 2 3 4 5 6 7 8 9 10 11 0 0 X X Chol Trsm § DAG ¡of ¡submatrix ¡computa9ons ¡ 1 1 X X Trsm Chol Trsm Herk 2 2 X X X 3 3 X § Each ¡submatrix ¡computa9on ¡ Herk Trsm Trsm Gemm Herk 4 4 X X X 5 5 X Herk Gemm Herk is ¡internally ¡data ¡parallel ¡ 6 6 X X X Chol 7 7 X 8 8 X Trsm § Lead: ¡Kyungjoo ¡Kim ¡ 9 9 Herk 10 10 11 11 Chol 2. Triangle ¡enumera9on ¡in ¡social ¡networks ¡(highly ¡irregular ¡graphs) ¡ ¡ § Iden9fy ¡triangles ¡within ¡the ¡graph ¡ § Compute ¡sta9s9cs ¡on ¡triangles ¡ 3 k1 § Triangles ¡are ¡an ¡intermediate ¡result ¡ that ¡do ¡not ¡need ¡to ¡be ¡saved ¡/ ¡stored ¡ 4 Ø Problem: ¡memory ¡“high ¡water ¡mark” ¡ 1 5 § Lead: ¡Michael ¡Wolf ¡ k2 2 5 ¡

  7. Use ¡Case ¡1: ¡Incomplete ¡Cholesky ¡Factoriza9on ¡ § Reordering ¡and ¡Block ¡Par99oning ¡of ¡Sparse ¡Matrix ¡ § One ¡driver ¡task ¡that ¡creates ¡and ¡spawns ¡submatrix ¡task-­‑DAG ¡ § Submatrix ¡tasks ¡factor, ¡triangular ¡solve, ¡rank-­‑k ¡update, ¡mul9ply ¡ Chol 0 1 2 3 4 5 6 7 8 9 10 11 0 0 X X Chol Trsm 1 1 X X Trsm Chol Trsm Herk 2 2 X X X 3 3 X Herk Trsm Trsm Gemm Herk 4 4 X X X 5 5 X Herk Gemm Herk 6 6 X X X Chol 7 7 X 8 8 X Trsm 9 9 Herk 10 10 11 11 Chol 6 ¡

  8. Use ¡Case ¡1: ¡Incomplete ¡Cholesky ¡Factoriza9on ¡ Driver ¡Task: ¡Spawn ¡Submatrix ¡Task-­‑DAG ¡ CHOL CHOL CHOL CHOL CHOL 0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 0 X X 0 0 0 0 X X X X X X X X CHOL CHOL TRSM TRSM CHOL CHOL CHOL TRSM TRSM TRSM 1 X X 1 1 1 1 X X X X X X X X DONE DONE CHOL TRSM 0 DONE 0 0 0 0 2 X X X 2 2 2 2 X X X X X X X X X X X X DONE DONE TRSM CHOL TRSM HERK TRSM CHOL TRSM HERK TRSM TRSM TRSM CHOL CHOL CHOL TRSM TRSM TRSM HERK HERK HERK 3 X 3 X 3 3 3 X X X DONE DONE 4 X X X CH DONE 4 X X DONE X 4 4 4 X X X X X X X X X HERK TRSM TRSM GEMM HERK 1 T TRSM HERK HERK HERK TRSM TRSM TRSM TRSM TRSM TRSM GEMM GEMM GEMM HERK HERK HERK HERK TRSM TRSM GEMM HERK 1 1 1 1 OL 5 X 5 X 5 5 5 X X X CH 6 X X X 6 X X X 6 6 6 X X X X X X X X X T TRSM HERK GEMM HERK HERK HERK HERK GEMM GEMM GEMM HERK HERK HERK HERK GEMM HERK 2 2 2 2 2 OL 7 X 7 X 7 7 7 X X X H GEMM 3 8 H X C GEMM TRSM 3 8 X CHOL 3 3 3 8 8 8 X X X CHOL CHOL CHOL CHOL 9 9 9 9 9 HERK 4 HERK 10 HERK HERK TRSM TRSM TRSM CHOL TRSM TRSM 4 10 4 4 4 10 10 10 11 11 11 11 11 HERK HERK HERK HERK HERK CHOL CHOL CHOL CHOL CHOL § Periodically ¡stop ¡itera9ng ¡and ¡respawn ¡this ¡task ¡with ¡low ¡priority ¡ § ThroWle ¡back ¡submatrix ¡task ¡genera9on ¡for ¡memory ¡constraint ¡ § Allow ¡submatrix ¡tasks ¡to ¡complete ¡and ¡their ¡memory ¡to ¡be ¡reclaimed ¡ 7 ¡

  9. Use ¡Case ¡2: ¡Triangle ¡Enumera9on ¡ and ¡Sta9s9cs ¡of ¡Social ¡Network ¡ ¡ § miniTri: ¡proxy ¡(mini-­‑applica9on) ¡for ¡triangle ¡based ¡data ¡analy9cs ¡ § Current ¡linear-­‑algebra ¡strategy ¡ miniTri 1 C = A * B § “A” ¡is ¡the ¡adjacency ¡matrix ¡ 2 t v = C * 1 § “B” ¡is ¡the ¡incidence ¡matrix ¡ 3 t e = C T * 1 4 kcount(C, t v , t e ) § Challenges ¡ § Very ¡irregular ¡graph, ¡difficult ¡to ¡sta9cally ¡load ¡balance ¡ § Graph ¡BLAS ¡strategy ¡explicitly ¡forms ¡“C” ¡which ¡is ¡all ¡triangles ¡in ¡the ¡graph ¡ Ø Extremely ¡large ¡intermediate ¡storage ¡of ¡“C” ¡ C=A ! B T1 T2 T3 T4 T5 T6 T7 T8 § Task ¡parallelism ¡pipelines ¡opera9ons ¡ t v = C ! 1 T1 T2 T3 T4 T5 T6 T7 T8 § Each ¡phase ¡is ¡a ¡data ¡parallel ¡BLAS ¡ § Block ¡par99on ¡and ¡pipeline ¡via ¡DAG ¡ t e = C T ! 1 T6 T1 T2 T3 T4 T5 T7 T8 § Priori9ze ¡downstream ¡tasks ¡to ¡“re9re” ¡ K-count T6 T1 T2 T3 T4 T5 T7 T8 temporary ¡“C” ¡submatrices ¡ 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