presented by: sameer kulkarni dept of computer & information sciences university of delaware

30
CISC 879 - Machine Learning for Solving Systems Problems Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware Phase Ordering

Upload: yuri

Post on 21-Jan-2016

18 views

Category:

Documents


0 download

DESCRIPTION

Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware. Phase Ordering. Optimization??. does it really work??. No. of optimizations. O64 = 264 (on last count) JikesRVM = 67. Search space. Consider a hypothetical case where we apply 40 optimizations - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Presented by: Sameer KulkarniDept of Computer & Information Sciences

University of Delaware

Phase Ordering

Page 2: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Optimization??

does it really work??

Page 3: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

No. of optimizations

• O64 = 264 (on last count)

• JikesRVM = 67

Page 4: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Search space

• Consider a hypothetical case where we apply 40 optimizations

• O64 : 3.98 x 1047

• Jikes: 4.1 x 1018

Page 5: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Could take a while

• Considering the smaller problem, assume that running all the benchmarks take just 1 sec to run

• Jikes would take: 130.2 billion years

• Age of the universe 13 billion years

Page 6: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Some basic Optimizations

• Constant Sub-expression Elimination

• Loop Unrolling

• Local Copy Prop

• Branch Optimizations ...

Page 7: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Example

for(int i=0; i< 3;i++){

a = a + i + 1;

}

Loop Unrolling

CSE

Page 8: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Instruction Scheduling vs Register Allocation

• Maximizing Parallelism IS

• Minimizing Register Spilling RA

Page 9: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Phase Ord. vs Opt Levels

• Opt Levels ~ Timing Constraints

• Phase ordering ~ code interactions

Page 10: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Whimsical??

• Opt X would like to go before Opt Y, but not always.

Page 11: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Ideal Solution?

• Oracle Perfect sequence at the very start

• Wise Man Solution Given the present code predict the best optimization solution

Page 12: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Wise Man

?• Understand

Compilers

• Optimizations

• Source Code

Page 13: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Possible Solutions• Pruning the search space

• Genetic Algorithms

• Estimating running times

• Precompiled choices

Page 14: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Pruning Search space

Fast and Efficient Searches for Effective Optimization Phase Sequences, Kulkarni et al. TACO 2005

Page 15: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Optimization Profiling

Fast and Efficient Searches for Effective Optimization Phase Sequences, Kulkarni et al. TACO 2005

Page 16: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Genetic Algorithms

Fast Searches for Effective Optimization Phase Sequences, Kulkarni et al. PLDI ‘04

Page 17: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Exhaustive vs Heuristic [2]

Page 18: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Disadvantages• Benchmark Specific

• Architecture dependent

• Code disregarded

Page 19: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Improvements• Profiling the application

• Understand the code

• Understanding optimizations

• Continuous evaluation of transformations

Page 20: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Proposed solution

Input = Code Features

Output = Running time

Evolve Neural Networks

Page 21: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Proposed solution

Page 22: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Experimental Setup

• Neural Network Evolver (ANJI)

• Training Set { javaGrande }

• Testing Set { SpecJVM, Da Capo }

Page 23: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

ANJI• Mutating & generating n/w s

• Network phase ordering

• Timing Information

• Scoring the n/w

Page 24: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Training Phase

• Generations and Chromosomes

• Random chromosomes

• Back Propagation

• Add/Remove/Update hidden nodes

Page 25: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Experimental Setup

Page 26: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Network Evolution

Page 27: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

javaGrande• Set of very small benchmarks

• Low running times

• Memory management

• Machine Architecture

Page 28: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Testing• SpecJVM’98 & Da Capo

• Champion n/w

• Running times

Page 29: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Present Solution

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

Benchmarks

O1

O2 Data

O3

Default

ANJI

Page 30: Presented by: Sameer Kulkarni Dept of Computer & Information Sciences University of Delaware

CISC 879 - Machine Learning for Solving Systems Problems

Questions

Most of the files and this presentation have been uploaded to http://www.cis.udel.edu/~skulkarn/ta.html