Discovering and Exploiting Program Phases - PowerPoint PPT Presentation

About This Presentation
Title:

Discovering and Exploiting Program Phases

Description:

Programs exhibit diverse modes of behavior. 400 Million Instructions ... Attributable to different modes of behavior. Can discover phases automatically ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 36
Provided by: Just48
Learn more at: https://cseweb.ucsd.edu
Category:

less

Transcript and Presenter's Notes

Title: Discovering and Exploiting Program Phases


1
Discovering and Exploiting Program Phases
  • Timothy Sherwood, Erez Perelman,
  • Greg Hamerly, Suleyman Sair, Brad Calder
  • CSE 231 Presentation by Justin Ma

2
400 Million Instructions
Non-Existent Processor
New Processor
New Compiler
Spec2000
Benchmark
Simulator
3
400 Million Instructions
  • Suppose you have a time budget
  • Less than half second of execution time
  • What would you simulate?
  • Beginning?
  • Middle?
  • End?

4
400 Million Instructions
Programs exhibit diverse modes of behavior
gzip
gcc
5
400 Million Instructions
  • Suppose you have a time budget
  • Less than half second of execution time
  • What would you simulate?
  • Beginning?
  • Middle?
  • End?
  • Samples of different modes of behavior

6
Program Phases
  • Observation programs exhibit various modes of
    periodic behavior
  • These modes are program phases
  • Challenge Extract these automatically

7
Phase Basics
  • Intervals slices in times
  • Phases intervals with similar behavior

IPC
Time (Instruction Count)
8
Phase Basics
  • Intervals slices in times
  • Phases intervals with similar behavior

IPC
Time (Instruction Count)
9
Defining Similar Behavior
  • Metric for comparing intervals?
  • Cache misses?
  • IPC?
  • Branch misprediction rates?
  • Problem Performance alone is too architecture
    dependent

10
Defining Similar Behavior
  • Code path traversal
  • Directly affects time-varying behavior
  • Execute same code, same performance
  • Architecture independent
  • Metrics for code path traversal
  • Frequency of branches
  • Frequency of function calls
  • Frequency of basic block calls

11
Basic Block Vector
B1
0
0
0
0
Time t
B1
B2
B3
B4
B2
B3
B4
12
Basic Block Vector
B1
1
1
0
1
Time t
B1
B2
B3
B4
B2
B3
B4
13
Basic Block Vector
B1
2
1
1
2
Time t
B1
B2
B3
B4
B2
B3
B4
14
Basic Block Vector
B1
2
1
1
2
Time t
B1
B2
B3
B4
B2
B3
0
0
0
0
Time t 1
B1
B2
B3
B4
B4
15
Basic Block Vector
B1
2
1
1
2
Time t
B1
B2
B3
B4
B2
B3
1
1
0
1
Time t 1
B1
B2
B3
B4
B4
16
Basic Block Vector
B1
2
1
1
2
Time t
B1
B2
B3
B4
B2
B3
2
2
0
2
Time t 1
B1
B2
B3
B4
B4
Manhattan Distance 1 2 1 0
2 Euclidian Distance sqrt((1 2)2 (1 0)2)
sqrt(2)
17
Basic Block Similarity Matrix
  • gzip

18
Basic Block Similarity Matrix
  • gcc

BBV similarity between intervals reflects
performance similarity
19
Automatic Phase Classification
  • Classify intervals into phases
  • We do not know which BBVs correspond to
    particular phases a priori
  • k-means clustering
  • Iterative clustering algorithm
  • Dimension Reduction
  • Random Linear Projection
  • Try different k values
  • Use BIC to choose best

20
Automatic Phase Classification
21
Automatic Phase Classification
Clustering accurately distinguishes phases
automatically
22
SimPoint
  • Simulate large programs on a budget
  • Perform detailed simulation on representative
    code snippets
  • Choose centroid interval from each phase (10
    million instructions)
  • Extrapolate large program performance
  • Weighted by frequency of phase

23
SimPoint
  • Simulate 400 million instructions total

Accurate estimate despite instruction budget
24
Why SimPoint Succeeds
  • Program behavior varies over time
  • SimPoint intelligently chooses which intervals to
    simulate
  • Regularity within program phases allows accurate
    extrapolation

25
Online Classification
  • Detect phases as program is running
  • Applications
  • Thread scheduling
  • Power management
  • Predicting future phases
  • Challenges
  • One pass of input
  • Limited storage

26
Online Classification
27
Online Classification
High variance in metrics across full trace
Low variance shows online classification succeeds
in finding phases
28
Conclusions
  • Phases are a vital abstraction
  • Performance varies greatly w/in program
  • Attributable to different modes of behavior
  • Can discover phases automatically
  • Offline k-means clustering
  • Online
  • Code path characterization
  • Strong correlation with actual performance
  • SimPoint exploits this with great success

29
(No Transcript)
30
Outline
  • Introduction (motivate)
  • Basics (definitions, BBV, BBMatrix)
  • Offline Phase Classification
  • SimPoints
  • Online Phase Classification
  • Conclusions

31
Limitations of Clustering
32
Bayesian Information Criterion
  • Fit to Gaussians

33
Self-Modifying Code
Self-modifying code
85o
Program Phases
34
Learning Phases
35
Learning Phases
Write a Comment
User Comments (0)
About PowerShow.com