Caliper: Pu,ng Performance Data in Context 9 th Scalable - - PowerPoint PPT Presentation

caliper pu ng performance data in context
SMART_READER_LITE
LIVE PREVIEW

Caliper: Pu,ng Performance Data in Context 9 th Scalable - - PowerPoint PPT Presentation

Caliper: Pu,ng Performance Data in Context 9 th Scalable Tools Workshop David Boehme Todd Gamblin Mar;n Schulz August 3, 2015 LLNL-PRES-675459 This work was performed


slide-1
SLIDE 1

LLNL-PRES-675459

This work was performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under contract DE-AC52-07NA27344. Lawrence Livermore National Security, LLC

Caliper: ¡ ¡ Pu,ng ¡Performance ¡Data ¡in ¡Context ¡

9th ¡Scalable ¡Tools ¡Workshop ¡

David ¡Boehme ¡ Todd ¡Gamblin ¡ Mar;n ¡Schulz ¡ August 3, 2015

slide-2
SLIDE 2

LLNL-PRES-675459

2 ¡

Performance ¡Analysis ¡requires ¡ ¡ Data ¡Correla:on ¡

Performance Insight

Source Code Context

  • Call path
  • Phase

Environment

  • Hardware topology
  • Software

configuration (OS, runtime versions)

Application domain

  • Domain topology
  • Physics data

Measurements

  • Time
  • FLOPS
  • Memory access

No ¡interface ¡to ¡collect ¡generic ¡context ¡data! ¡

slide-3
SLIDE 3

LLNL-PRES-675459

3 ¡

Example: ¡Visualiza:on ¡in ¡MemAxes ¡

slide-4
SLIDE 4

LLNL-PRES-675459

4 ¡

Caliper ¡Contribu:ons ¡

1.

Interface ¡for ¡applica:ons ¡to ¡provide ¡arbitrary ¡ ¡ context ¡informa;on ¡

2.

Interface ¡for ¡plug-­‑in ¡tools ¡that ¡provide ¡measurement ¡data ¡

3.

Enable ¡composi:on ¡of ¡context ¡annota;ons ¡and ¡ ¡ measurement ¡providers ¡

slide-5
SLIDE 5

LLNL-PRES-675459

5 ¡

Composite ¡Data ¡Collec:on ¡

§ Generic ¡a"ribute:value ¡data ¡model ¡

— Allows ¡storage ¡of ¡any ¡type ¡or ¡kind ¡of ¡data: ¡

not ¡limited ¡to ¡pre-­‑defined ¡context ¡categories ¡

§ In-­‑memory ¡data ¡store ¡

— Data ¡sources ¡update ¡context ¡/ ¡measurement ¡data ¡independently ¡ — Combines ¡data ¡across ¡the ¡soTware ¡stack ¡

Timer PAPI ...

Measurements Application

Component 1

phase, iteration no.

Component 2

coordinate, element

Libraries

Solver

solver iteration

Mesh

  • refin. level

rank, function, wait time

Runtime

MPI OpenMP

thread id, construct, wait time

Common context space

app.c1.phase, app.c1.iteration, app.c2.coordinate, app.c2.element, solver.iteration, mesh.refinementlvl, mpi.rank, mpi.function, mpi.wait, openmp.thread, openmp.construct, openmp.wait, time.duration, time.timestamp, papi.l2miss, papi.fpops, ...

Caliper

slide-6
SLIDE 6

LLNL-PRES-675459

6 ¡

Caliper ¡Framework ¡

In-memory data store

Annotated source code

Annotation API

Measurement module

Annotation / Service API

External on-line Tool

Query API Context stream File system / Database

Measurement trigger Context scope manager

Service API

slide-7
SLIDE 7

LLNL-PRES-675459

7 ¡

Caliper ¡Workflow ¡(1) ¡

In-memory data store

Annotated source code

Annotation API

Measurement module

Annotation / Service API

External on-line Tool

Query API Context stream File system / Database

Measurement trigger Context scope manager

Service API

  • Instrumented modules independently update context

information

slide-8
SLIDE 8

LLNL-PRES-675459

8 ¡

Caliper ¡Workflow ¡(2) ¡

In-memory data store

Annotated source code

Annotation API

Measurement module

Annotation / Service API

External on-line Tool

Query API Context stream File system / Database

Measurement trigger Context scope manager

Service API

  • Trigger creates record with context snapshot and

measurement data

slide-9
SLIDE 9

LLNL-PRES-675459

9 ¡

Caliper ¡Workflow ¡(3) ¡

In-memory data store

Annotated source code

Annotation API

Measurement module

Annotation / Service API

External on-line Tool

Query API Context stream File system / Database

Measurement trigger Context scope manager

Service API

  • Alternatively, external tool pulls context and

measurement snapshot on-line

slide-10
SLIDE 10

LLNL-PRES-675459

10 ¡

Data ¡Model ¡

§ Fully ¡flexible ¡a"ribute:value ¡format ¡

app.phase=“solve”,mpi.rank=42,time.duration=1234,mesh.level=3

§ A[ributes ¡contain ¡

— Unique ¡name ¡ — Data ¡type ¡(integer, ¡floa;ng ¡point, ¡string, ¡binary ¡blob) ¡

  • Future ¡extension: ¡JSON ¡descrip;on ¡for ¡complex ¡types ¡

— Scope ¡(process, ¡thread, ¡or ¡task) ¡

§ Entries ¡can ¡be ¡hierarchical ¡(e.g., ¡for ¡call ¡paths) ¡ § Automa;c ¡scoping ¡

— Caliper ¡keeps ¡separate ¡entries ¡per ¡thread ¡or ¡tasks ¡

§ Efficient ¡tree-­‑based ¡data ¡representa;on ¡

slide-11
SLIDE 11

LLNL-PRES-675459

11 ¡

Efficient ¡Context ¡Representa:on ¡

§ Build ¡up ¡context ¡tree ¡

— Stores ¡values ¡from ¡mul;ple ¡a[ributes ¡ — Transparent ¡to ¡the ¡user ¡

§ Represent ¡context ¡snapshot ¡through ¡

single ¡node ¡

§ Non-­‑repe;;ve ¡data ¡(measurements) ¡

stored ¡explicitly ¡

main init serial loop par. 1 work 2

Attributes

phase state iteration

Phase = main/loop/ work; state=parallel; iteration=1

slide-12
SLIDE 12

LLNL-PRES-675459

12 ¡

Data ¡Format ¡

§ Context ¡streams ¡include ¡performance/context ¡and ¡ ¡

metadata ¡records ¡of ¡a ¡single ¡Caliper ¡instance ¡

§ Node ¡records ¡describe ¡context ¡tree ¡and ¡metadata ¡(a[ributes) ¡

__rec=node,id=24,attr=8,data=iter,parent=23

§ Context ¡records ¡combine ¡context ¡and ¡immediate ¡data ¡entries ¡

  • f ¡a ¡context ¡snapshot ¡

__rec=ctx,ref=25,attr=19=24,data=13=1

slide-13
SLIDE 13

LLNL-PRES-675459

13 ¡

Data ¡Processing ¡/ ¡Analysis ¡Stack ¡

Caliper-instrumented Process

In-memory data store

Context stream Local DB

On-line or off-line parallel merge / aggregation

Caliper-instrumented process

In-memory data store

Context stream

Global DB Analysis

slide-14
SLIDE 14

LLNL-PRES-675459

14 ¡

Annota:on ¡API ¡

§ cali::Annotation

— Encapsulates ¡a[ribute ¡

§ begin()

— Append ¡new ¡value ¡

§ set()

— Set ¡(overwrite) ¡value ¡

§ end()

— Remove ¡last ¡value ¡

#include <Annotation.h> int main(int argc, char* argv[]) { cali::Annotation phase_ann("phase"); phase_ann.begin("init"); // Perform initialization initialize(); phase_ann.end(); // ends “init” phase_ann.begin("loop"); #pragma omp parallel for for (int i; i < MAX; ++i) { cali::Annotation("iteration").set(i); do_work(i); } phase_ann.end(); // ends “loop” }

slide-15
SLIDE 15

LLNL-PRES-675459

15 ¡

Service ¡API ¡

§ Instrumenta;on ¡+ ¡context ¡query ¡for ¡measurement ¡services ¡and ¡

third-­‑party ¡tools ¡

— push_context()

  • Trigger ¡snapshot ¡and ¡write ¡to ¡stream ¡

— pull_context()

  • Trigger ¡and ¡pull ¡snapshot ¡

— create_attribute()

  • Creates ¡a[ribute ¡

— begin() / end() / set()

  • Set ¡values ¡

— ( ¡Query ¡API ¡) ¡(not ¡defined ¡yet) ¡

§ Callback ¡func;ons ¡for ¡various ¡events ¡

— E.g. ¡snapshot ¡triggered, ¡a[ribute ¡created, ¡value ¡changed, ¡… ¡

slide-16
SLIDE 16

LLNL-PRES-675459

16 ¡

Measurement ¡Services ¡

Service Timer Timestamps and/or time duration Callpath Performs stack unwinding to retrieve call path MPI Wraps MPI functions and provides MPI rank OMPT OpenMP tools interface, provides thread ID, state, and OpenMP construct wrappers PAPI PAPI hardware counters

slide-17
SLIDE 17

LLNL-PRES-675459

17 ¡

Usage ¡(1): ¡Configure, ¡run ¡

§ Link ¡caliper ¡library ¡ § Configure ¡ ¡

— Add ¡measurement ¡services, ¡set ¡output ¡flags ¡

$ export CALI_SERVICES_ENABLE=recorder:timestamp $ ./test/cali-basic == CALIPER: Registered recorder service == CALIPER: Registered timestamp service == CALIPER: Initialized == CALIPER: Wrote 38 records. == CALIPER: Finished $ ls *.cali 150724-073336_479_ytM1by52l3yV.cali

§ Run ¡

slide-18
SLIDE 18

LLNL-PRES-675459

18 ¡

Usage ¡(2): ¡Examine ¡

§ cali-­‑query ¡expands ¡records ¡and ¡provides ¡basic ¡aggrega;on, ¡

filter, ¡and ¡merge ¡func;onality ¡

§ Export ¡to ¡your ¡favorite ¡data ¡analy;cs ¡/ ¡visualiza;on ¡tool ¡

$ cali-query –e *.cali time.duration=221 phase=main time.duration=140 phase=main/init time.duration=15 phase=main time.duration=12 phase=main/loop time.duration=18 iteration=0 phase=main/loop time.duration=15 iteration=1 phase=main/loop time.duration=7 iteration=2 phase=main/loop time.duration=6 iteration=3 phase=main/loop time.duration=10 phase=main/loop time.duration=13 phase=main time.duration=7

slide-19
SLIDE 19

LLNL-PRES-675459

19 ¡

Ongoing ¡Work ¡

§ On-­‑line ¡aggrega;on ¡

— Turns ¡Caliper ¡into ¡a ¡“real” ¡profiler ¡

§ Complex ¡datatypes ¡

— Describes ¡layout ¡of ¡binary ¡blobs ¡

§ Scalable ¡cross-­‑process ¡on-­‑line ¡merge ¡/ ¡aggrega;on ¡

— Use ¡MRNet ¡

slide-20
SLIDE 20

LLNL-PRES-675459

20 ¡

Further ¡Informa:on ¡

§ Available ¡on ¡github ¡LLNL ¡LC ¡Stash: ¡

h[ps://lc.llnl.gov/stash/projects/PIPER/repos/caliper/browse ¡

§ BSD ¡License ¡ § Release ¡version ¡available ¡soon ¡ § Contact: ¡

¡ ¡David ¡Boehme ¡ ¡ ¡boehme3@llnl.gov ¡