readex: a tool suite for dynamic energy tuning · periscope tuning framework (ptf) • automatic...

36
READEX: A Tool Suite for Dynamic Energy Tuning Michael Gerndt Technische Universität München

Upload: others

Post on 28-Jul-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

READEX: A Tool Suite for Dynamic Energy Tuning

MichaelGerndt

TechnischeUniversitätMünchen

Page 2: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

CampusGarching

2

Page 3: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

SuperMUC:3Petaflops,3MW

3

Page 4: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

READEX

RuntimeExploitationofApplicationDynamismforEnergy-efficienteXascaleComputing

09/2015 to08/2018www.readex.eu

4

Page 5: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

Objectives• Tuningforenergyefficiency• Beyondstatictuning:exploit dynamism inapplicationcharacteristics

• Leverage system scenario based tuning

5

HPCAutomaticTuning

EmbeddedSystemScenarios

Page 6: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

SystemsScenariobasedMethodology

6

Page 7: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

PeriscopeTuningFramework (PTF)

• Automaticapplicationanalysis&tuning• Tuneperformanceandenergy(statically)• Plug-in-basedarchitecture• Evaluatealternativesonline• Scalableanddistributedframework

• Supportvarietyofparallelparadigms• MPI,OpenMP,OpenCL,Parallelpattern

• AutoTuneEU-FP7project

7

Page 8: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

Score-P

ScalablePerformanceMeasurementInfrastructureforParallelCodesCommoninstrumentationand measurement infrastructure

8

Page 9: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

TuningPluginInterface

Plugin PeriscopeFrontend

Applicationwith

Monitor

Scenario execution§ Tuningactions§ Measurement requests

SearchSpaceExplorationinsideofTuningSteps

Page 10: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

TuningPlugins

• MPIparameters• EagerLimit,Bufferspace,collectivealgorithms• ApplicationrestartorMPITToolsInterface

• DVFS• Frequencytuningforenergydelayproduct• Model-basedpredictionoffrequency• Regionleveltuning

• Parallelismcapping• Threadnumbertuningforenergydelayproduct• Exhaustiveandcurvefittingbasedprediction

Page 11: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

DynamicTuningwiththeREADEXToolSuite

• READEXextends theconceptoftuning inPeriscope• Dynamictuning

• Instead ofoneoptimalconfiguration,SWITCHbetweendifferentbestconfigurations.

• Dynamicadaptation tochanging programcharacteristics.

Page 12: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

Scenario-BasedTuning

12

Design Time Analysis

Tuning Model

Runtime Tuning

PeriscopeTuningFramework(PTF)

READEXRuntimeLibrary(RRL)

Page 13: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

Intra-phase Dynamism

PhasePhaseregion

Significantregion Runtimesituation

FREQ=2GHz

FREQ=1.5GHz

Intra-phasedynamism

13

Page 14: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

READEXIntra-phase TuningPlugin

Tuningpluginsupporting• Coreanduncorefrequencies,numthreads parameters,

applicationtuningparameters• ConfigurablesearchspaceviaREADEXConfigurationFile• Severalobjectivefunctions:energy,CPUenergy,EDP,EDP2,time• Severalsearchstrategies:exhaustive,individual,random,genetic

Approach1. Experimentwithdefaultconfiguration2. Experimentsforselectedconfigurations

• Configurationsetforphaseregion• Energyandtimemeasuredforallruntimesituations

3. Identificationofstaticbestforphaseandrts specific bestconfigurations

14

Page 15: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

Pre-Computation ofTuningModel

PeriscopeTuningFramework

Analysis

PluginControl

PerformanceDatabase

SearchAlgorithms Experiments

Engine

READEXTuningPlugin

DTAManagement

DTAProcessManagement

RTSManagement

RTS

Database

ScenarioIdentification

ApplicationTuningModel

Score-P READEXRuntimeLibrary

OnlineAccessInterface

SubstratePlugin

Interface

Instrumen-tation

MetricPlugin

Interface

EnergyMeasurements

(HDEEM)

15

Page 16: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

READEXRuntimeLibrary(RRL)• RuntimeApplicationTuningperformedbytheREADEXRuntimeLibrary.• TuningrequestsduringDesign Time AnalysisaresenttoRRL.• Alightweightlibrary

• Dynamicswitchingbetweendifferentconfigurationsatruntime.• ImplementedasasubstratepluginofScore-P.

• Developedby TUDandNTNU

16

Page 17: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

RuntimeScenarioDetectionandSwitchingDecisionduringProductionRun

• DuringRuntimeApplicationTuning

• Scenarioclassification

17

• Switchingdecisioncomponent

• Manipulationoftuningparameters

Page 18: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

BEM4I– Dynamicswitching– Energy

bladesummary,energyassemble_k

[J]assemble_v

[J]gmres_solve

[J]print_vtu

[J]main[J]

defaultsettings 1467 1484 2733 1142 6872statictuningonly 1876 1926 1306 402 5537dynamictuningonly 1348 1335 1150 268 4138static+ dynamictuning 1343 1322 1161 265 4125

staticsavings[%] -27.9% -29.8% 52.2% 64.8% +19.4%dynamicsavings[%] 8.4% 10.9% 57.5% 76.8% +40.0%static +dynamicsavings[%] 8.1% 10.0% 57.9% 76.5% +39.8%

"assemble_k":{"FREQUENCY":"23","NUM_THREADS":"24","UNCORE_FREQUENCY":”16”

},

"assemble_v":{"FREQUENCY":”25","NUM_THREADS":"24","UNCORE_FREQUENCY":”14”

},

"gmres_solve":{"FREQUENCY":”17","NUM_THREADS":”8","UNCORE_FREQUENCY":”22”

},

"print_vtu": {"FREQUENCY":"25","NUM_THREADS":”6","UNCORE_FREQUENCY":”24”

}

”static": {

"FREQUENCY": ”25", <--------- 2.5GHz

"NUM_THREADS": ”12", <--------- 12OpenMP threads

"UNCORE_FREQUENCY": ”22” <--------- 2.2GHz

},

18

http://bem4i.it4i.cz/

Page 19: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

simpleFoam• strongscalingtest• Motorbike example

• optimumdetectedforeveryrun

• Static:11.7%• Dynamic:4.4%• Total:15.5%

• Dynamicsavingsincreaseswithhighernumberofnodes

Doesnotscaleanymore

ScalabilityTests– OpenFOAM– Analysis

Page 20: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

Inter-phaseDynamism

20

All-to-allPerformance2048phases

PEPCBenchmarkoftheDEISABenchmarkSuite

Page 21: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

Inter-PhaseAnalysis

• Variationofbehavioramongphases• Group/clusterphases• Selectabestconfigurationforeachclusterofphases

Whatdoweneed?• Identifiersofphasecharacteristics(PhaseIdentifiers)• Providedbyapplicationexpert(??)

21

Page 22: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

Inter-PhaseAnalysis– Approach• Developedtheinterphase_tuning plugin• 3tuningsteps:

• Analysisstep:• Randomsearchstrategyisusedtocreatethesearchspace• Don’twanttoexplorethewholetuningspace• Clusterphasesandfindbestconfigurationforeachcluster

• Defaultstep:• Runtheapplicationforthedefaultsetting

• Verificationstep:• Selectthebestconfigurationforeach phase,asdeterminedforitscluster.

• Aggregatethesavings overthephases

22

Page 23: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

INDEED

23

• 3clustersidentified• Noisepointsmarkedinred

Page 24: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

ClusterPrediction inRRL• Howtohandlephase identifiers topredict clusters?

• Callpath ofanrts now includes theclusternumber• Solution:

• Addthe cluster number as auser parameter• AddPAPIeventstomeasure L3_TCM,Total_Instr andconditionalbranch instructions

• Predict the cluster of the upcomingphase• Iftheclusterwasmispredicted forthephase,correct itattheendofthephase

24

…SCOREP_OA_PHASE_BEGIN()

SCOREP_USER_PARAMETER_INT64(cluster, predict_cluster())…

SCOREP_OA_PHASE_END()

Page 25: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

Evaluationofthereadex_interphase plugin

25

• Performedontwoapplications:miniMD,INDEED• ExperimentsconductedontheTaurusHPCsystemattheZIHinDresden• Eachnodecontainstwo12-coreIntelXeonCPUsE5-2680v3(IntelHaswell family)

• RunswithadefaultCPUfrequencyof2.5GHz,uncore frequencyof3GHz

• EnergymeasurementsprovidedonTaurusviaHDEEMmeasurementhardware

• Providesprocessorandbladeenergymeasurements

Page 26: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

miniMD

26

• Lightweight,parallelmoleculardynamicssimulationcode

• PerformsmoleculardynamicssimulationofaLennard-JonesEmbeddedAtomModel(EAM)system

• WritteninC++• Providesinputfiletospecifyproblemsize,temperature,timesteps

• EvaluationofDTA:• Hybrid(MPI+OpenMP)AVXvectorized version

• Problemsizeof50fortheLennard-Jonessystem.

Page 27: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

miniMD (2)

ParCo'17,September13,Bologna

27

• 6clustersidentified• Noisepointsmarkedinred

Page 28: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

INDEED

ParCo'17,September13,Bologna

28

• INDEEDperformssheetmetalformingsimulationsoftoolswithdifferentgeometriesmovingtowardsastationaryworkpiece

• Contactbetweentoolandworkpiece causes:

• Adaptivemeshrefinement• Increaseinnumberoffiniteelementnodes

• Increasingcomputationalcost

• Timeloopcomputesthesolutiontoasystemofequationsuntilequilibriumisreached.

• OpenMP versionevaluated

Page 29: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

INDEED(2)

ParCo'17,September13,Bologna

29

• 3clustersidentified• Noisepointsmarkedinred

Page 30: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

EnergySavings

30

Application Phasebestfortherts’s(%)

rts best forthe rts’s(%)

miniMD 14.51 0.03

INDEED 9.24 10.45

• miniMDrecordslowerdynamicsavings• miniMD hasonlytwosignificantregions• Oneregioniscalledonlyonceduringtheentireapplicationrun

• Betterstaticanddynamicsavingsfortherts’s ofINDEED• INDEEDhasninesignificantregions• Providesmorepotentialfordynamism

Page 31: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

ApplicationTuningParameters(ATP)

• Exploit thedynamism incharacteristics throughtheuseofdifferentcodepaths(e.g.preconditioners)

• Identifythecontrolvariablesresponsibleforcontrolflowswitching.

• providesAPIstoannotatethesourcecode

Page 32: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

l FiniteElement(FEM)toolsanddomaindecompositionbasedFiniteElementTearingandInterconnect(FETI)solverl Contains aprojectedconjugategradient(PCG)solver.l Convergencecanbeimprovedbyseveralpreconditioners.

l Evaluatedpreconditioners onastructuralmechanicsproblemwith23millionunknownsl Onasinglecomputenodewith24MPIprocesses.

Preconditioner #iterations 1iteration Solution

None 172 125 ms 31.6 J 21.36 s 5 501.31 JWeightfunction 100 130+2 ms 32.3+0.53 J 12.89 s 3 284.07 J

Lumped 45 130+10 ms 32.3+3.86 J 6.32 s 1 636.11 JLightdirichlet 39 130+10 ms 32.3+3.74 J 5.46 s 1 409.82 J

Dirichlet 30 130+80 ms 32.3+20.62 J 6.34 s 1 594.50 J

15.9s 4091.5j

EvaluationofATP: Espreso

Page 33: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

Configuration VariableTuning

• Recently added readex_configuration tuning plugin• ApplicationConfiguration Parameterswithsearchspace

• Replace selected valueininput files andrerun theapplication

33

Page 34: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

InputIdentifiers

• Whataboutdifferentinputs?• AnnotationwithInputIdentifiers likeproblem size• Apply DesignTimeAnalysisandmerge generatedtuning models

• Selection atruntimebased ontheinput identifiers

34

Page 35: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

Summary

• Energy-efficiencytuning• DesignTimeAnalysis– TuningModel– RuntimeTuning

• Supportfor• Intra-phase dynamism• Inter-phase dynamism• ApplicationTuningParameters• ApplicationConfigurationParameters• Differentinput configurations

• Based on• Periscope TuningFramework• Score-PMonitoring

35

Page 36: READEX: A Tool Suite for Dynamic Energy Tuning · Periscope Tuning Framework (PTF) • Automatic application analysis & tuning • Tune performance and energy (statically) • Plug-in-based

Thankyou!Questions?

36