palm easing the burden of analy7cal performance modeling
play

Palm: Easing the Burden of Analy7cal Performance Modeling - PowerPoint PPT Presentation

Palm: Easing the Burden of Analy7cal Performance Modeling NATHAN TALLENT, ADOLFY HOISIE Pacific Northwest Na7onal Lab Petascale Tools Workshop August 5,


  1. Palm: ¡Easing ¡the ¡Burden ¡of ¡ Analy7cal ¡Performance ¡Modeling ¡ NATHAN ¡TALLENT, ¡ADOLFY ¡HOISIE ¡ Pacific ¡Northwest ¡Na7onal ¡Lab ¡ Petascale ¡Tools ¡Workshop ¡ August ¡5, ¡2014 ¡ ¡

  2. Analy7cal ¡Modeling ¡of ¡Performance ¡is ¡Hard ¡ � Analy7cal ¡model ¡of ¡performance ¡ � Quan7ta7vely ¡explains ¡and ¡predicts ¡applica7on ¡execu7on ¡7me ¡ sta7s7cal ¡model ¡ sta7s7cal ¡model ¡ analy7cal ¡model ¡ simula7on ¡ simula7on ¡ analy7cal ¡model ¡ insight ¡ (high) ¡ evalua7on ¡7me ¡ (high) ¡ � Diagnose ¡performance-­‑limi7ng ¡resources, ¡design ¡machines, ¡etc. ¡ � How ¡is ¡applica7on ¡modeling ¡difficult? ¡ � Modeling ¡requires ¡exper7se ¡and ¡labor ¡ � model ¡cri7cal ¡path: ¡iden7fy ¡parameters ¡for ¡each ¡cri7cal ¡path ¡segment ¡ � parameter ¡reduc7on: ¡represent ¡‘invariant’ ¡code ¡as ¡measurement ¡ � validate: ¡iterate ¡un7l ¡model ¡captures ¡all ¡interes7ng ¡behavior ¡ � Reproducing ¡and ¡distribu7ng ¡models ¡is ¡ad ¡hoc ¡ � 1 ¡modeler, ¡N ¡applica7on ¡variants ¡ � 1 ¡applica7on, ¡N ¡modelers ¡ What ¡can ¡a ¡tool ¡automate? ¡Can ¡we ¡pair ¡model ¡and ¡source ¡code? ¡ 2 ¡

  3. Palm: ¡How ¡Can ¡Tools ¡Help? ¡ � Iden7fy ¡and ¡formalize ¡best ¡prac7ces ¡ � Make ¡the ¡simple ¡easy ¡and ¡the ¡difficult ¡possible ¡ � Provide ¡a ¡fully ¡general ¡framework ¡(do ¡not ¡hinder) ¡ � Automate ¡rou7ne ¡tasks ¡ � Facilitate ¡a ¡divide-­‑and-­‑conquer ¡modeling ¡strategy ¡ � Construct ¡model ¡by ¡composing ¡sub-­‑models ¡ � Define ¡model ¡structure ¡from ¡sta7c ¡& ¡dynamic ¡code ¡structure ¡ � Assist ¡reproducibility ¡ � Generate ¡same ¡model ¡given ¡same ¡input ¡ � Generate ¡model ¡according ¡to ¡well-­‑defined ¡rules ¡ � Assist ¡valida7on ¡(feedback ¡loop) ¡ � Generate ¡contribu7on ¡and ¡error ¡reports ¡ Palm: ¡Performance ¡& ¡Architecture ¡Lab ¡Modeling ¡Tool ¡ 3 ¡

  4. Palm: ¡Annota7ons ¡Guide ¡Modeling ¡ reference ¡& ¡instrumented ¡executables ¡ annotated ¡ ¡ Palm ¡ Palm ¡ source ¡ Compiler ¡ Monitor ¡ sta7c ¡analysis ¡ � Annota7ons ¡guide ¡modeling ¡and ¡express ¡insight ¡ profiles ¡ � Develop ¡model ¡and ¡applica7on ¡in ¡tandem ¡ � Decompose ¡modeling ¡task ¡into ¡sub-­‑problems ¡ � Reasonable ¡because ¡applica7ons ¡change ¡slowly ¡ Palm ¡ Generator ¡ � To ¡annotate ¡a ¡block ¡of ¡code: ¡ � assign ¡it ¡a ¡name ¡(will ¡be ¡qualified ¡by ¡dynamic ¡instance) ¡ � associate ¡a ¡modeling ¡expression ¡with ¡it ¡ � expressions ¡may ¡use ¡model ¡func7ons ¡and ¡program ¡values ¡ parameters ¡ � define ¡model ¡func7ons/variables ¡for ¡convenience ¡ model ¡ refine ¡as ¡necessary ¡ predic7on ¡& ¡diagnos7cs ¡ (program) ¡ 4 ¡

  5. Simple ¡Annota7ons ¡for ¡Nekbone ¡(CG ¡solver) ¡ model: ¡classify ¡code ¡block ¡and ¡model ¡one ¡ program ¡nekbone ¡ instance ¡of ¡its ¡execu7on; ¡if ¡expression ¡is ¡ ¡!$pal ¡model ¡init ¡ omiped, ¡automa7cally ¡synthesize ¡one ¡ ¡call ¡init_dim, ¡call ¡init_mesh, ¡… ¡ ¡ ¡!$pal ¡model ¡cg ¡ loop: ¡model ¡several ¡instances ¡of ¡a ¡code ¡block; ¡ ¡call ¡cg(…) ¡ ¡ name ¡block ¡and ¡model ¡its ¡trip ¡count ¡ end ¡ def: ¡define ¡model ¡variable ¡or ¡func7on ¡ subrou7ne ¡cg(…) ¡ ¡!$pal ¡loop ¡n cg ¡= ¡${n_iter} ¡ ${x}: ¡program ¡value ¡reference: ¡capture ¡x’s ¡ ¡do ¡iter=1,n_iter ¡ value ¡during ¡program ¡execu7on ¡and ¡ ¡ ¡… ¡ compute ¡sta7s7c ¡across ¡instances ¡& ¡ranks ¡ ¡enddo ¡ #pal ¡def ¡snd(sz) ¡= ¡… ¡ void ¡halo_exchange(buf[n], ¡n…) ¡ ¡#pragma ¡pal ¡loop ¡n send ¡= ¡${n}[max] ¡ void ¡isend(…size_t ¡n, ¡uint ¡dst…) ¡ ¡for(i ¡= ¡0; ¡I ¡< ¡n; ¡++i) ¡ ¡#pal ¡model ¡send ¡= ¡snd(${n}) ¡ ¡ ¡isend(…, ¡buf[i]…); ¡ ¡MPI_Isend(… ¡n, ¡dst…) ¡ 5 ¡

  6. Palm: ¡Sta7c ¡& ¡Dynamic ¡Analysis ¡ reference ¡& ¡instrumented ¡executables ¡ annotated ¡ ¡ Palm ¡ Palm ¡ source ¡ Compiler ¡ Monitor ¡ sta7c ¡analysis ¡ � Compile ¡with ¡Palm ¡Compiler ¡ ➝ ¡Annota7on ¡structure ¡ profiles ¡ � Execute ¡with ¡Palm ¡Monitor ¡ ¡ ¡ ➝ ¡Calling ¡context ¡tree ¡ nekbone ¡ • sta7c ¡& ¡dynamic ¡annota7on ¡structure ¡ init ¡ cg ¡ … ¡ • context-­‑sensi7ve ¡measurements ¡ Palm ¡ • sta7s7cs ¡for ¡program ¡values ¡ Generator ¡ … ¡ … ¡ • leaves ¡represent ¡computa7on ¡ n cg ¡= ¡${n_iter} ¡ … ¡ … ¡ model ¡annota7on ¡ n send ¡= ¡${n}[max] ¡ reduce 1 ¡ parameters ¡ reduce 2 ¡ loop ¡annota7on ¡ … ¡ send ¡= ¡snd(${n}) ¡ unannotated ¡sub-­‑tree ¡ … ¡ … ¡ model ¡ refine ¡as ¡necessary ¡ predic7on ¡& ¡diagnos7cs ¡ (program) ¡ 6 ¡

  7. Palm: ¡Genera7ng ¡Models ¡ reference ¡& ¡instrumented ¡executables ¡ annotated ¡ ¡ Palm ¡ Palm ¡ source ¡ Compiler ¡ Monitor ¡ sta7c ¡analysis ¡ � Generate ¡model ¡from ¡ (sta7c/dynamic) ¡annota7on ¡structure ¡ profiles ¡ � combine ¡annota7on ¡expressions ¡and ¡measurements ¡ nekbone ¡ Generate ¡model ¡by ¡composing ¡model ¡nodes ¡ init ¡ cg ¡ nekbone() ¡= ¡init() ¡+ ¡cg() ¡+ ¡ k 2 ¡ … ¡ Palm ¡ ¡ init() ¡= ¡ k 1 ¡ Generator ¡ … ¡ … ¡ ¡ cg() ¡= ¡n cg ¡ * ¡(reduce 1 () ¡+ ¡reduce 2 () ¡ n cg ¡= ¡${n_iter} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡+ ¡n send ¡* ¡snd( k )) ¡ … ¡ … ¡ model ¡annota7on ¡ n send ¡= ¡${n}[max] ¡ reduce 1 ¡ parameters ¡ reduce 2 ¡ loop ¡annota7on ¡ … ¡ send ¡= ¡snd(${n}) ¡ unannotated ¡sub-­‑tree ¡ … ¡ … ¡ model ¡ refine ¡as ¡necessary ¡ predic7on ¡& ¡diagnos7cs ¡ (program) ¡ 7 ¡

  8. Model ¡Genera7on ¡for ¡Nekbone ¡ Calling ¡Context ¡Tree ¡ Model ¡Tree ¡ Model ¡ • Annota7on ¡structure ¡ • Model ¡structure ¡ • Annota7on ¡→ ¡model ¡func7on ¡ • Performance ¡measurements ¡ • Convert ¡sub-­‑trees ¡to ¡ • Compose ¡model ¡func7ons ¡ • Program ¡values ¡(run7me) ¡ measurement ¡constants ¡ • Combine ¡model ¡expressions ¡ • Resolve ¡expression ¡references ¡ and ¡measurements ¡ measurement ¡ program ¡value ¡ nekbone() ¡= ¡init() ¡+ ¡cg() ¡+ ¡k 2 ¡ nekbone ¡ nekbone ¡ ¡ init() ¡= ¡k 1 ¡ init ¡ cg ¡ init ¡ cg ¡ k 2 ¡ … ¡ ¡ cg() ¡= ¡n cg ¡ * ¡(reduce 1 () ¡+ ¡ ¡ k 1 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡reduce 2 () ¡+ ¡ ¡ … ¡ … ¡ n avg : ¡… ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡n send ¡* ¡snd(1600)) ¡ n cg ¡= ¡${n_iter} ¡ ¡n cg ¡= ¡n avg ¡ ¡ n max : ¡26 ¡ reduce 1 () ¡= ¡… ¡ … ¡ … ¡ ¡ n send ¡= ¡n max ¡ snd(sz) ¡= ¡… ¡ reduce 1 ¡ n send ¡= ¡${n}[max] ¡ reduce 1 ¡ reduce 2 ¡ n avg ¡= ¡1600 ¡ reduce 2 ¡ … ¡ def-­‑namespace ¡ send ¡= ¡snd(${n}) ¡ snd(n avg ) ¡ … ¡ snd(sz) ¡= ¡… ¡ context ¡sensi7ve ¡ 8 ¡

  9. Palm: ¡Using ¡Models ¡ reference ¡& ¡instrumented ¡executables ¡ annotated ¡ ¡ Palm ¡ Palm ¡ source ¡ Compiler ¡ Monitor ¡ sta7c ¡analysis ¡ � Models ¡are ¡(Ruby) ¡programs ¡ profiles ¡ � scrip7ng ¡language ¡is ¡convenient; ¡could ¡use ¡machine ¡code ¡ � invoke ¡by ¡passing ¡appropriate ¡parameters ¡(e.g., ¡# ¡cores) ¡ � replace ¡sub-­‑models ¡by ¡re-­‑defining ¡func7ons ¡ � Refine ¡annota7ons ¡using ¡model ¡diagnos7cs ¡ Palm ¡ Generator ¡ � show ¡contribu7on ¡of ¡each ¡sub-­‑model ¡(expression) ¡ � quan7ta7vely ¡dis7nguish ¡1 st -­‑ ¡and ¡2 nd -­‑order ¡effects ¡ � show ¡errors ¡of ¡each ¡sub-­‑model ¡w.r.t. ¡measurements ¡ � understand ¡effects ¡of ¡replacing ¡a ¡sub-­‑model ¡(func7on) ¡ parameters ¡ � example: ¡new ¡communica7on ¡model ¡ model ¡ refine ¡as ¡necessary ¡ predic7on ¡& ¡diagnos7cs ¡ (program) ¡ 9 ¡

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