Active Harmony’s Plug-in Interface
description
Transcript of Active Harmony’s Plug-in Interface
![Page 1: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/1.jpg)
Active Harmony’sPlug-in Interface
A World of Possibilities
Ray S. Chen <[email protected]>Jeffrey K. Hollingsworth <[email protected]>
Paradyn/Dyninst Week 2013April 30, 2013
![Page 2: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/2.jpg)
2
Overview and Motivation• Auto-tuning has a broad range of applications
o Optimization of run-time, throughput, energy, etc.
• Supporting new features increasingly difficult due to monolithic internalso 10+ years of non-structured developmento Core search logic implemented in Tcl
• Reorganization produced a generalized auto-tuning frameworko Á la componentization of Dyninst APIo Eases integration with other projects
![Page 3: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/3.jpg)
3
Auto-tuning Basics• Empirically test configurations for performance
o Searches a set of valid configurations for optimal
• Valid configurations defined by tuning variableso Variables can be integer, real, or enumerated stringso Each variable bound by minimum, maximum, and step
• Set of tuning variables define a parameter spaceo N variables create an N-dimensional spaceo Cartesian coordinates represent unique configurations
![Page 4: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/4.jpg)
4
Parameter Space Example• Variable 1
o Name: Tileo Min: 2o Max: 16o Step: 2
• Variable 2o Name: Unrollo Min: 0o Max: 10o Step: 1
2 4 6 8 10 12 14 160123456789
10
Tile
Unr
oll
![Page 5: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/5.jpg)
5
Auto-Tuning Feedback Loop
AutoTuner
ClientApplication
Candidate Points
Evaluated Performance5.1
SearchStrategy
![Page 6: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/6.jpg)
6
Search Strategies• Drives the feedback loop• Pluggable module with two major interfaces
o Fetch: Generates a new point for cliento Report: Accepts a point/performance pair from client
• Four strategies included in Active Harmonyo Brute Forceo Randomo Nelder-Meado Parallel Rank Order (PRO)
![Page 7: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/7.jpg)
7
Generalized Auto-Tuning
ActiveHarmony321
ClientApplication
Candidate Points
Evaluated Performance
SearchStrategy
FETCH REPO
RT
123
![Page 8: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/8.jpg)
8
Onion Model Workflow• Allows for paired
functionality, but either hook is optional.
• Fetch hooks executed in ascending order.
• Report hooks executed in descending order.
• Point values cannot be modified (directly).
SearchStrategy
FETCH REPO
RT
123
![Page 9: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/9.jpg)
9
Plug-in Workflow: ACCEPT• Indicates successful
processing at this level.• Plug-in relinquishes
control of the point to entity below.
SearchStrategy
123
![Page 10: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/10.jpg)
10
Plug-in Workflow: RETURN• Allows a short-circuit in
the feedback loop.• Plug-in must provide
the performance value.• Processing resumes at
the same level from the report workflow.
SearchStrategy
123
![Page 11: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/11.jpg)
11
Plug-in Workflow: REJECT• Allows modification of
the search indirectly.• Plug-in must provide an
alternate valid point.o Search strategy is not
obligated to use it.
• Processing jumps directly back to search strategy.
SearchStrategy
123
![Page 12: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/12.jpg)
12
Plug-in Example: Point Logger
logger_init(){
outfd = open(“performance.log”);}
logger_report(flow_t *flow, point_t *pt, double perf){
fprintf(outfd, “%s -> %lf\n”, string(pt), perf);
flow->type = ACCEPT;}
logger_fini(){
close(outfd);}
![Page 13: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/13.jpg)
13
Plug-in Workflow: WAIT• Allows asynchronous
point processing• Plug-in sends point to
external process• Other points processed
in the mean time• Processing resumes at
the same level upon return
SearchStrategy
123
External Process
![Page 14: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/14.jpg)
14
Plug-in Example: Code Servercs_init()
{sockfd = tcp_connect(CODE_SERVER);register_fetch_callback(sockfd,
code_ready);}
cs_fetch(flow_t *flow, hpoint_t *pt){
send_point(sockfd, pt);flow->type = WAIT;
}
code_ready(flow_t *flow, hpoint_t *pt_list[]){
recv_completed_id(sockfd, id);flow->point =
find_point_in_list(pt_list, id);flow->type = ACCEPT;
}
![Page 15: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/15.jpg)
15
Plug-in Example: Constraints
• Support for non-rectangular parameter spaces.o Implemented as plug-in #2 using REJECT workflow.
SearchStrategy
123
𝑥
𝑦
![Page 16: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/16.jpg)
16
Plug-in Example: TAUdb• Integration with TAU via TAUdb.
o Tuning and Analysis Utilities
• Search data stored in persistent database
• Adds parameter analysis to any tuning session.• Can potentially be used as result cache
![Page 17: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/17.jpg)
17
Specifying Plug-ins• Pluggable modules read from configuration
o Unstructured key/value pair system queried at launch
• Directly from the command-lineo Tuna to accept in-line configuration directiveso Syntax to be determined
> cat harmony.cfgSESSION_STRATEGY=pro.soSESSION_PLUGIN_LIST=logger.so:taudb.so
![Page 18: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/18.jpg)
18
Availability• Current release is Active Harmony 4.0
o Includes Tuna and preliminary plug-in interface
• Upcoming release to includeo Improved plug-in interfaceo Library of basic strategies and plug-inso No more Tcl code!
![Page 19: Active Harmony’s Plug-in Interface](https://reader036.fdocuments.in/reader036/viewer/2022062520/56816271550346895dd2e124/html5/thumbnails/19.jpg)
19
Summary and Next Steps• Generalized auto-tuning framework presented
o Variety of systems possible with minimal codingo Functionality encapsulated to simplify development
• Next stepso Develop library of search strategies and plug-ins
o Hierarchical search?o We could use your help!
o Investigation of further abstractionso Parameter spaces