19
Active Harmony’s Plug-in Interface A World of Possibilities Ray S. Chen <[email protected]> Jeffrey K. Hollingsworth <[email protected]> Paradyn/Dyninst Week 2013 April 30, 2013

Active Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

Embed Size (px)

Citation preview

Page 1: Active Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

2

Overview and Motivation

• Auto-tuning has a broad range of applicationso 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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

3

Auto-tuning Basics

• Empirically test configurations for performanceo 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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

4

Parameter Space Example

• Variable 1o 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

Unroll

Page 5: Active Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

5

Auto-Tuning Feedback Loop

AutoTuner

ClientApplication

Candidate Points

Evaluated Performance5.1

SearchStrategy

Page 6: Active Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

7

Generalized Auto-Tuning

ActiveHarmony321

ClientApplication

Candidate Points

Evaluated Performance

SearchStrategy

FETCH REPO

RT

123

Page 8: Active Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

14

Plug-in Example: Code Server

cs_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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

17

Specifying Plug-ins

• Pluggable modules read from configurationo 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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

18

Availability

• Current release is Active Harmony 4.0o 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 Harmonys Plug-in Interface A World of Possibilities Ray S. Chen Jeffrey K. Hollingsworth Paradyn/Dyninst Week 2013 April 30, 2013

19

Summary and Next Steps

• Generalized auto-tuning framework presentedo 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