Petascale workshop 2013 Judit Gimenez Detailed evolution of performance metrics Folding.

1 www.bsc.es Petascale workshop 2013 Judit Gimenez (judit...
Author: Reynard Walker
0 downloads 2 Views

1 www.bsc.es Petascale workshop 2013 Judit Gimenez ([email protected]) Detailed evolution of performance metrics Folding

2 Since 1991 Based on traces Open Source – http://www.bsc.es/paraver Core tools: – Paraver (paramedir) – offline trace analysis – Dimemas – message passing simulator – Extrae – instrumentation Performance analytics – Detail, flexibility, intelligence – Behaviour vs syntactic structure Our Tools

3 What is a good performance? Performance of a sequential region = 2000 MIPS Is it good enough? Is it easy to improve?

4 What is a good performance? MR. GENESIS Interchanging loops

5 Application granularity vs. detailed granularity –Samples: hardware counters + callstack Folding: based on known structure: iterations, routines, clusters; –Project all samples into one instance Extremely detailed time evolution of hardware counts, rates and callstack with minimal overhead –Correlate many counters –Instantaneous CPI stack models Can I get very detailed perf. data with low overhead? Unveiling Internal Evolution of Parallel Application Computation Phases (ICPP 2011)

6 Benefit from applications’ repetitiveness Different roles –Instrumentation delimits regions –Sampling reports progress within a region Mixing instrumentation and sampling Iteration #1Iteration #2Iteration #3Synthetic Iteration Unveiling Internal Evolution of Parallel Application Computation Phases (ICPP 2011)

7 Instructions evolution for routine copy_faces of NAS MPI BT.B Red crosses represent the folded samples and show the completed instructions from the start of the routine Green line is the curve fitting of the folded samples and is used to reintroduce the values into the tracefile Blue line is the derivative of the curve fitting over time (counter rate) Folding hardware counters

8 Folded source code line Folded instructions Folding hardware counters with call stack

9 Folding hardware counters with call stack (CUBE)

10 10 Bursts Duration Using Clustering to identify structure Automatic Detection of Parallel Applications Computation Phases. (IPDPS 2009)

11 Example 1: PEPC A 96 MIPS Performance metrics (Region A) 16 MIPS 2.3 M L2 misses/s 0.1 M TLB misses/s htable%node = 0 htable%key = 0 htable%link = -1 htable%leaves = 0 htable%childcode = 0 do i = 1, n htable(i)%node = 0 htable(i)%key = 0 htable(i)%link = -1 htable(i)%leaves = 0 htable(i)%childcode = 0 End do Changes -70% time -18% instructions -63% L2 misses -78% TLB misses 253 MIPS (+163%)

12 Example 1: PEPC B 403 MIPS Performance metrics Region ARegion B 100 MIPS80 MIPS 4 M L2 misses/s2 M L2 misses/s 0.4 M TLB misses/s1 M TLB misses/s A

13 Example 1: PEPC Changes -70% time -18% instructions -63% L2 misses -78% TLB misses 253 MIPS (+163%) Changes -30% time -1% instructions -10% L2 misses -32% TLB misses 544MIPS (+34%)

14 Example 2: CG-POPwith CPI-Stack Folded lines –Interpolation  statistic profile Points to “small” regions iter_loop: do m = 1, solv_max_iters sumN1=c0 sumN3=c0 do i=1,nActive Z(i) = Minv2(i)*R(i) sumN1 = sumN1 + R(i)*Z(i) sumN3 = sumN3 + R(i)*R(i) enddo do i=iptrHalo,n Z(i) = Minv2(i)*R(i) enddo call matvec(n,A,AZ,Z) sumN2=c0 do i=1,nActive sumN2 = sumN2 + AZ(i)*Z(i) enddo call update_halo(AZ)... do i=1,n stmp = Z(i) + cg_beta*S(i) qtmp = AZ(i) + cg_beta*Q(i) X(i) = X(i) + cg_alpha*stmp R(i) = R(i) - cg_alpha*qtmp S(i) = stmp Q(i) = qtmp enddo end do iter_loop B D C A A BC D pcg_chrongear_linearmatvec Line number Framework for a Productive Performance Optimization (PARCO Journal 2013)

15 Example 2: CG-POP sumN1=c0 sumN3=c0 do i=1,nActive Z(i) = Minv2(i)*R(i) sumN1 = sumN1 + R(i)*Z(i) sumN3 = sumN3 + R(i)*R(i) enddo do i=iptrHalo,n Z(i) = Minv2(i)*R(i) enddo iter_loop: do m = 1, solv_max_iters sumN2=c0 call matvec_r(n,A,AZ,Z,nActive,sumN2) call update_halo(AZ)... sumN1=c0 sumN3=c0 do i=1,n stmp = Z(i) + cg_beta*S(i) qtmp = AZ(i) + cg_beta*Q(i) X(i) = X(i) + cg_alpha*stmp R(i) = R(i) - cg_alpha*qtmp S(i) = stmp Q(i) = qtmp Z(i) = Minv2(i)*R(i)} if (i

16 Example 2: CG-POP AB CD 11% improvement on an already optimized code B D C A CD AB

17 Example 3: CESM

18

19 4 cycles in Cluster 1 A BC Group A: –conden:2.7% –compute_uwshcu:3.3% –rtrnmc:1.75% Group B: –micro_mg_tend:1.36% (1.73%) –wetdepa_v2:2.5% Group C: –reftra_sw:1.71% –spcvmc_sw:1.21% –vrtqdr_sw1.43%

20 Example 3: CESM Consists of a double nested loop –Very long ~400 lines –Unnecessary branches with inhibit vectorization Restructuring wetdepa_v2 –Break up long loop to simplify vectorization –Promote scalar to vector temporaries –Common expression elimination CESM B-case, NE=16, 570 cores Yellowstone, Intel (13.1.1) –O2 % total timeduration (ms) improvement original2.5492.6- modified0.73121.14.07x

21 Energy counters @ SandyBridge 3 Energy Domains –Processor die (Package) –Cores (PP0) –Attached RAM (optional, DRAM) In comparison with performance counters –Per processor die information –Time discretization Measured at 1Khz  No control on boundaries (f.i separate MPI from computing) –Power quantization Energy reported in multiples of 15.3 µJoules Folding energy counters –Noise values Discretization – consider a uniform distribution? Quantization – select the latest valid measure?

22 Folding energy counters in serial benchmarks MIPS Core DRAM PACKAGE TDP FT.BLU.B 444.namd481.wrf437.leslie3d435.gromacs BT.B Stream

23 HydroC analysis HydroC, 8 MPI processes –Intel® Xeon® E5-2670 @ 2.60GHz (2 x octo-core nodes) 1 pps2 pps 4 pps8 pps

24 MrGenesis analysis MrGenesis, 8 MPI processes –Intel® Xeon® E5-2670 @ 2.60GHz (2 x octo-core nodes) 1 pps2 pps 4 pps8 pps

25 Performance answers are in detailed and precise analysis Analysis: [temporal] behaviour vs syntactic structure www.bsc.es/paraver Conclusions