Automatic Performance Tuning: Automatic Development of Tunlets
Universitat Autònoma de Barcelona
Paola Caymes ScutariGenaro Costa, Ihab Salawdeh, Alexandre Guevara
Anna Morajko, Eduardo César, Andreu Moreno, Josep JorbaTomàs Margalef, Joan Sorribes, Emilio Luque
Universitat Autònoma de Barcelona
Paradyn WeekApril 30, 2007
Outline Introduction
MATE Tunlets Our work
Automatic Development of Tunlets Motivation Abstractions and Methodology Tunlet Specification Language Tunlet Generator
Use Case Conclusions
Outline Introduction
MATE Tunlets Our work
Automatic Development of Tunlets Motivation Abstractions and Methodology Tunlet Specification Language Tunlet Generator
Use Case Conclusions
IntroductionParallel/Distributed Computing
High performance
Developers must optimize application performance to provide efficient and useful applications
Application behavior may change on input data or environment
Difficult task especially for non-expert users
MATE Monitoring, Analysis and Tuning Environment
Dynamic automatic tuning of parallel/distributed applications
Modifications
Instrumentation
User
TuningMonitoring
Tool
SolutionProblem /
Performance analysis
Performance data
Application development
Application
Execution
Source
Events
DynInst
Analyzer
Tunlet
Analyzer
Tunlet
Performancemodel
Measurepoints
Tuningpoints/actions
MATE: TunletsAnalysis phase includes knowledge about possible
performance problems in the applications.
What to measure?Where?
How to determine problems and
solutions? What to modify?When?Where?
““TUNLETS”TUNLETS”
MATE (III) Key question:
Application specific code
Frameworks - Skeletons
Standard and custom libraries (API+code)
Operating system libraries (API+code)
Hardware
What can be tuned in an application?
Hardware
Operating System kernel
OS API
Libraries code
API
Application code
Framework code
API
Measure points
Performance model
Tuning point, action, sync
TuningMonitoring
Performance analysis
ExecutionHardware
Operating System kernel
OS API
Libraries code
API
Application code
Framework code
API Performance models for patterns
Performance models for libraries
MATE extensions:Tunlets Specification
Grid
What are we working on?
Outline Introduction
MATE Tunlets Our work
Automatic Development of Tunlets Motivation Abstractions and Methodology Tunlet Specification Language Tunlet Generator
Use Case Conclusions
Motivation
Framework TunletTunlet TunletTunlet…
Application
User MATEApplication
TunletTunlet
Motivation
Framework TunletTunlet TunletTunlet…
Application
TunletTunlet
User MATE
Automate
Application
Automatic Development of Tunlets
We propose a methodology to:
add new tunlets to overcome different performance problems
avoid the user to enter in implementations details of MATE
allow users to develop their applications without restrictions
Automatic Development of Tunlets
User
Tool Tuning
PerformanceAnalysis
Monitoring
Execution
Tunlet Tunlet...
ProgrammingModel
performanceproblem
Performance Model
Parameters p1, p2 ... pi
Mathematical Model e1 ... ej
Tunlet Specification
Measure Points p1, p2 ... pi
Performance Functions f1 ... fj
Tuning Actions/Points a1 ... ak tp1 ... tph
Automatic Generation
Automatic Development of Tunlets
User
Tool Tuning
PerformanceAnalysis
Monitoring
Execution
Tunlet Tunlet...
ProgrammingModel
performanceproblem
Performance Model
Parameters p1, p2 ... pi
Mathematical Model e1 ... ej
Tunlet Specification
Measure Points p1, p2 ... pi
Performance Functions f1 ... fj
Tuning Actions/Points a1 ... ak tp1 ... tph
Automatic Generation
Automatic Development of Tunlets
User
Tool Tuning
PerformanceAnalysis
Monitoring
Execution
Tunlet Tunlet...
ProgrammingModel
performanceproblem
Performance Model
Parameters p1, p2 ... pi
Mathematical Model e1 ... ej
Tunlet Specification
Measure Points p1, p2 ... pi
Performance Functions f1 ... fj
Tuning Actions/Points a1 ... ak tp1 ... tph
Automatic Generation
Automatic Development of Tunlets
User
Tool Tuning
PerformanceAnalysis
Monitoring
Execution
Tunlet Tunlet...
Application
ProgrammingModel
performanceproblem
Performance Model
Parameters p1, p2 ... pi
Mathematical Model e1 ... ej
Tunlet Specification
Measure Points p1, p2 ... pi
Performance Functions f1 ... fj
Tuning Actions/Points a1 ... ak tp1 ... tph
Automatic Generation
Automatic Development of Tunlets
User
Tool Tuning
PerformanceAnalysis
Monitoring
Execution
Tunlet Tunlet...
Application
ProgrammingModel
performanceproblem
Performance Model
Parameters p1, p2 ... pi
Mathematical Model e1 ... ej
Tunlet Specification
Measure Points p1, p2 ... pi
Performance Functions f1 ... fj
Tuning Actions/Points a1 ... ak tp1 ... tph
Automatic Generation
Automatic Development of Tunlets Abstractions
Tunlet Measure point Performance model Tuning point
Performance Model Performance parameters Performance functions
Application Actor Event Variable Value Attribute
Abstractions
Process_1
Data a,b,c,d......int i
Res f_1(Data d){ ...}
...
f_i(Data r, Data r1){ ...}
main(){ ... r=f_1(a) ... f_i(c,d) ...}
Process_2
Data a,b,c,d......int i
g_1(Data d,int x){ ...}
...
g_j(Data r){ ...}
main(){ ... g_1(b,i) ... g_j(d) ...}
Process_3
Data d......
h_1(Data e){ ...}
main(){ ... h_1() ...}
Actors
Variables
Values Events
Methodology
1. To provide a performance model (PM)1. Pre-existing model2. Ad hoc model
2. To understand the performance model1. Mainly the performance parameters
3. To interpret the PM in the application1. Identifying the events2. Identifying the variables and values
4. To identify the actors in the application
Methodology II Events
Function Entry or Exit Attributes
Variables and Values Variable, parameter or result Name Data Type
Actor Name Class Exe Min/Max Completion Condition Attributes
Process_3
Data d......
h_1(Data e){ ...}
h_3(){//final processing //in the iteration ...}
main(){ while(!end) { ... h_1(x) ... h_3() }}
Methodology II Events
Function Entry or Exit Attributes
Variables and Values Variable, parameter or result Name Data Type
Actor Name Class Exe Min/Max Completion Condition Attributes
Process_3
Data d......
h_1(Data e){ ...}
h_3(){//final processing //in the iteration ...}
main(){ while(!end) { ... h_1(x) ... h_3() }}
Methodology II Events
Function Entry or Exit Attributes
Variables and Values Variable, parameter or result Name Data Type
Actor Name Class Exe Min/Max Completion Condition Attributes
Process_3
Data d......
h_1(Data e){ ...}
Data h_3(){//final processing //in the iteration ...}
main(){ while(!end) { ... h_1(x) ... h_3() }}
Methodology II Events
Function Entry or Exit Attributes
Variables and Values Variable, parameter or result Name Data Type
Actor Name Class Exe Min/Max Completion Condition Attributes
Process_3
Data d......
h_1(Data e){ ...}
h_3(){//final processing //in the iteration ...}
main(){ while(!end) { ... h_1(x) ... h_3() }}
Automatic development of Tunlets
Performance Model
Parameters p1, p2 ... pi
Mathematical Model f1 (pm,...,pn) ... fk (pm,...,pn)
Model Evaluation r1 ... rk
Application
Tunlet Specification
Measure Points p1, p2 ... pi
Performance Functions f1 ... fj
Tuning Actions/Points a1 ... ak tp1 ... tph
Abstractions
Formalize using our
Tunlet Specification Language
Tunlet Specification Language
Tunlet
name:
comment:
Measure points
Performance functions
Tuning points
Analyzer
Tunlet
Analyzer
Tunlet
Performancemodel
Measurepoints
Tuningpoints/actions
How?
What?When?Where?
What, where?
What should be included?
Tunlet Specification Language
Tunlet
name:
comment:
Measure pointsvariablesactorseventsiteration infoperformance params.
Performance functions
Tuning points
Analyzer
Tunlet
Analyzer
Tunlet
Performancemodel
Measurepoints
Tuningpoints/actions
How?
What?When?Where?
What?where?
Tunlet Specification Language
Tunlet
name:
comment:
Measure points
Performance functions
f1()
…
fn()
Tuning points
Analyzer
Tunlet
Analyzer
Tunlet
Performancemodel
Measurepoints
Tuningpoints/actions
What?When?Where?
What?where?
How?
Tunlet Specification Language
Tunlet
name:
comment:
Measure points
Performance functions
Tuning points
point1
…
pointn
Analyzer
Tunlet
Analyzer
Tunlet
Performancemodel
Measurepoints
Tuningpoints/actions
How?
What?where?
What?When?Where?
Tunlet Specification Language
Tunlet
name:
comment:
Measure points
Performance functions
Tuning points
Analyzer
Tunlet
Analyzer
Tunlet
Performancemodel
Measurepoints
Tuningpoints/actions
How?
What?When?Where?
What, where?
Tunlet GenerationTunlet
name:
comment:
Measure points
…
Performance functions
…
Tuning points
…
<Tunlet name=“” comment=“” />
<Measure points>
…
</Measure points>
<Performance functions>
…
</Performance functions>
<Tuning points>
…
</Tuning points>
Tunlet.h Tunlet.cpp Stats.h Stats.cpp
Flex + DOM
XSLT
Outline Introduction
MATE Tunlets Our work
Automatic Development of Tunlets Motivation Abstractions and Methodology Tunlet Specification Language Tunlet Generator
Use Case Conclusions
Analyzer
Tunlet
Analyzer
Tunlet
Performance Model
Measurepoints
Tuning points/ actions
Framework + MATE
Define the tunlet basing on the classes of the framework.
Adapt the framework to allow tuning of the applications via MATE
Example: number of workers
Analyzer
Tunlet
Analyzer
Tunlet
Performance Model
Measurepoints
Tuning points/ actions
Framework + MATE
Define the tunlet basing on the classes of the framework.
Adapt the framework to allow tuning of the applications via MATE
Example: number of workers
tlTcVNopt )*(
Where...tl = latencyλ = inverse bandwidthV = data volumeTc= computing time
Analyzer
Tunlet
Analyzer
Tunlet
Performance Model
Measurepoints
Tuning points/ actions
Framework + MATE
Define the tunlet basing on the classes of the framework.
Adapt the framework to allow tuning of the applications via MATE
Example: number of workers
tlTcVNopt )*(
Events
• Entry(Computing)
• Exit(Computing)
• Entry(iteration)
• Exit(iteration)
Variables
• argvData
• ResSize
Actors
• Master
• Worker
Analyzer
Tunlet
Analyzer
Tunlet
Performance Model
Measurepoints
Tuning points/ actions
Framework + MATE
Define the tunlet basing on the classes of the framework.
Adapt the framework to allow tuning of the applications via MATE
Example: number of workers
tlTcVNopt )*(
Analyzer
Tunlet
Analyzer
Tunlet
Performance Model
Measurepoints
Tuning points/ actions
Framework + MATE
Define the tunlet basing on the classes of the framework.
Adapt the framework to allow tuning of the applications via MATE
Example: number of workers
tlTcVNopt )*(
Variable
• Nopt
Analyzer
Tunlet
Analyzer
Tunlet
Performance Model
Measurepoints
Tuning points/ actions
Framework + MATE
Define the tunlet basing on the classes of the framework.
Adapt the framework to allow tuning of the applications via MATE
Example: number of workers
tlTcVNopt )*(
Number of workers: SpecificationTunlet
name:numworkerscomment:tunlet to tune the number of workers
Measure points
variablesargvDataResSizenopt
eventsIterationStartsIterationFinishesWStartsTWFinishesT
actorsmasterworker
performance model parametersntllambdaVtCt
Performance Functions int pf(){return (int)sqrt((lambda*Vt+Ct)/tl);}
Tuning Pointsnopt
Outline Introduction
MATE Tunlets Our work
Automatic Development of Tunlets Motivation Abstractions and Methodology Tunlet Specification Language Tunlet Generator
Use Case Conclusions
Conclusions
We defined/developed: Methodology to define tunlets Tunlet Specification Language Automatic Tunlet Generator
In this way, we make MATE (dynamic-automatic tuning) easier and transparent to the user.
Automatic Performance Tuning:Automatic Development of Tunlets
Paola Caymes Scutari
Thank you…