Program Behavior Sequence Prediction Bo Wu, Yunlian Jiang, Xipeng - - PowerPoint PPT Presentation

program behavior sequence prediction
SMART_READER_LITE
LIVE PREVIEW

Program Behavior Sequence Prediction Bo Wu, Yunlian Jiang, Xipeng - - PowerPoint PPT Presentation

Program Behavior Sequence Prediction Bo Wu, Yunlian Jiang, Xipeng Shen (The College of William & Mary) Yaoqing Gao, Raul Silvera, Graham Yiu (IBM Toronto) Thursday, November 10, 11 Outline Motivation Our perspectives Behavior


slide-1
SLIDE 1

Program Behavior Sequence Prediction

Bo Wu, Yunlian Jiang, Xipeng Shen (The College of William & Mary) Yaoqing Gao, Raul Silvera, Graham Yiu (IBM Toronto)

Thursday, November 10, 11

slide-2
SLIDE 2

Outline

 Motivation  Our perspectives  Behavior sequence prediction framework  Some results of loop trip count prediction  Possible uses  Summary

Thursday, November 10, 11

slide-3
SLIDE 3

Motivation

 Accurate and proactive prediction of program

behaviors is essential for many optimizations

 Loop trip counts for loop unrolling  Function hotness for function optimization level in JIT  profitability for speculative parallelization  Cache miss rates for prefetching aggressiveness  Loop coldness for outlining  ......

Thursday, November 10, 11

slide-4
SLIDE 4

Motivation

 The usefulness is not limited to program

  • ptimizations

 OS level

Provision in cloud computing Scheduling to reduce resource contention

 Architecture level

Voltage scaling

Thursday, November 10, 11

slide-5
SLIDE 5

Motivation

 However, the prediction of program behaviors is

challenging

Thursday, November 10, 11

slide-6
SLIDE 6

Motivation

 Opportunities do exist

Thursday, November 10, 11

slide-7
SLIDE 7

Our Perspectives

 Difgerence between instance prediction and

sequence prediction

 Instance prediction: the next one or several instances  Sequence Prediction: the whole sequence of the considered behavior

 Statistical correlation among difgerent behaviors

 Trip counts of two difgerent loops  Loop trip counts and function hotness

 Context awareness

 Loop stack and call stack  Correlated behaviors happened before

Thursday, November 10, 11

slide-8
SLIDE 8

Our Perspectives

 Three requirements for behavior prediction

 Accuracy  Proactivity  Scope

Thursday, November 10, 11

slide-9
SLIDE 9

Sequence Prediction Framework

 The initial study is on loop trip counts prediction

 Loops are dominant parts  Resource requirements  inlining  Computation granularity  ...

Thursday, November 10, 11

slide-10
SLIDE 10

Sequence Prediction Framework

 Loop trip count sequences follow patterns

Thursday, November 10, 11

slide-11
SLIDE 11

Sequence Prediction Framework

 Three steps

 Simplification Recognize the pattern of a sequence and use several features to represent it  Prediction Predict the sequence features through correlation  Generation Reconstruct sequences from the predicted features

Thursday, November 10, 11

slide-12
SLIDE 12

Sequence Prediction Framework

 Pattern Recognition

Thursday, November 10, 11

slide-13
SLIDE 13

Sequence Prediction Framework

 Pattern Recognition

<c1.4,1,1,17> <c2.1.1,c1.4,10,31,-1,c1.1,18,23>

Thursday, November 10, 11

slide-14
SLIDE 14

Sequence Prediction Framework

 Correlation Prediction

Thursday, November 10, 11

slide-15
SLIDE 15

Sequence Prediction Framework

Thursday, November 10, 11

slide-16
SLIDE 16

Results

0.25 0.50 0.75 1.00

m c f l i b q u a n t u m b z i p 2 g

  • b

m k h m m e r m i l c p a r s e r s p h i n x 3 h 2 6 4 r e f s j e n g A v e r a g e

Loop Coverage

Thursday, November 10, 11

slide-17
SLIDE 17

Results

0.700 0.775 0.850 0.925 1.000

m c f l i b q u a n t u m b z i p 2 g

  • b

m k h m m e r m i l c p a r s e r s p h i n x 3 h 2 6 4 r e f s j e n g A v e r a g e

  • Pred. Acc.

Thursday, November 10, 11

slide-18
SLIDE 18

Possible Uses

 Aggressive Optimizations

 Loop unrolling for non-countable loops

While(!p) { if(satisfySomeCondition(p)) { result = p; break; } else p = p->next; }

 Need runtime check and recovery support

Thursday, November 10, 11

slide-19
SLIDE 19

Possible Uses

 Loop parallelization

loop1 { loop2 { loop2 { loop1 { ...; ...; } } } }

loop interchange?

Thursday, November 10, 11

slide-20
SLIDE 20

Possible Uses

 From loop trip counts to other behaviors

– Function hotness – Prefetching aggressiveness – Software pipelining – Trace selection in trace JIT

Thursday, November 10, 11

slide-21
SLIDE 21

Summary

 Program behavior prediction is useful for many

compiler optimizations, and even for OS and architecture level

 Behavior Sequences show extreme complexity,

but correlation provides an opportunity to predict them

 Three requirements for useful predictions  High prediction accuracy is possible for many

loops

Thursday, November 10, 11

slide-22
SLIDE 22

Bo Wu @ William & Mary

Thanks!

Thursday, November 10, 11