Evaluation of the Gini-index for Studying Branch Prediction Features Veerle Desmet Lieven Eeckhout Koen De Bosschere.

Slides:



Advertisements
Similar presentations
Branch prediction Titov Alexander MDSP November, 2009.
Advertisements

Dynamic History-Length Fitting: A third level of adaptivity for branch prediction Toni Juan Sanji Sanjeevan Juan J. Navarro Department of Computer Architecture.
Pipeline Computer Organization II 1 Hazards Situations that prevent starting the next instruction in the next cycle Structural hazards – A required resource.
Dynamic Branch Prediction
Pipeline Hazards Pipeline hazards These are situations that inhibit that the next instruction can be processed in the next stage of the pipeline. This.
Computer Architecture Computer Architecture Processing of control transfer instructions, part I Ola Flygt Växjö University
8 Processing of control transfer instructions TECH Computer Science 8.1 Introduction 8.2 Basic approaches to branch handling 8.3 Delayed branching 8.4.
Chapter 8. Pipelining. Instruction Hazards Overview Whenever the stream of instructions supplied by the instruction fetch unit is interrupted, the pipeline.
Clustered Indexing for Conditional Branch Predictors Veerle Desmet Ghent University Belgium.
Neural Methods for Dynamic Branch Prediction Daniel A. Jiménez Calvin Lin Dept. of Computer Science Rutgers University Univ. of Texas Austin Presented.
EECS 470 Branch Prediction Lecture 6 Coverage: Chapter 3.
1 COMP 206: Computer Architecture and Implementation Montek Singh Wed., Oct. 8, 2003 Topic: Instruction-Level Parallelism (Dynamic Branch Prediction)
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon., Oct. 7, 2002 Topic: Instruction-Level Parallelism (Dynamic Branch Prediction)
1 Improving Branch Prediction by Dynamic Dataflow-based Identification of Correlation Branches from a Larger Global History CSE 340 Project Presentation.
EE8365/CS8203 ADVANCED COMPUTER ARCHITECTURE A Survey on BRANCH PREDICTION METHODOLOGY By, Baris Mustafa Kazar Resit Sendag.
1 Lecture 8: Branch Prediction, Dynamic ILP Topics: branch prediction, out-of-order processors (Sections )
VLSI Project Neural Networks based Branch Prediction Alexander ZlotnikMarcel Apfelbaum Supervised by: Michael Behar, Spring 2005.
EECC551 - Shaaban #1 lec # 5 Fall Reduction of Control Hazards (Branch) Stalls with Dynamic Branch Prediction So far we have dealt with.
EENG449b/Savvides Lec /17/04 February 17, 2004 Prof. Andreas Savvides Spring EENG 449bG/CPSC 439bG.
1  2004 Morgan Kaufmann Publishers Chapter Six. 2  2004 Morgan Kaufmann Publishers Pipelining The laundry analogy.
Goal: Reduce the Penalty of Control Hazards
Trace Caches J. Nelson Amaral. Difficulties to Instruction Fetching Where to fetch the next instruction from? – Use branch prediction Sometimes there.
Branch Target Buffers BPB: Tag + Prediction
EECC551 - Shaaban #1 lec # 5 Winter Reduction of Control Hazards (Branch) Stalls with Dynamic Branch Prediction So far we have dealt with.
Computer Architecture Instruction Level Parallelism Dr. Esam Al-Qaralleh.
Branch Prediction Dimitris Karteris Rafael Pasvantidιs.
1 COMP 740: Computer Architecture and Implementation Montek Singh Thu, Feb 19, 2009 Topic: Instruction-Level Parallelism III (Dynamic Branch Prediction)
Branch pred. CSE 471 Autumn 011 Branch statistics Branches occur every 4-6 instructions (16-25%) in integer programs; somewhat less frequently in scientific.
EENG449b/Savvides Lec /25/05 March 24, 2005 Prof. Andreas Savvides Spring g449b EENG 449bG/CPSC 439bG.
1 Lecture 7: Branch prediction Topics: bimodal, global, local branch prediction (Sections )
Branch Prediction CSE 4711 Branch statistics Branches occur every 4-7 instructions on average in integer programs, commercial and desktop applications;
Neural Methods for Dynamic Branch Prediction Daniel A. Jiménez Department of Computer Science Rutgers University.
Evaluation of Dynamic Branch Prediction Schemes in a MIPS Pipeline Debajit Bhattacharya Ali JavadiAbhari ELE 475 Final Project 9 th May, 2012.
Analysis of Branch Predictors
A STUDY OF BRANCH PREDICTION STRATEGIES JAMES E.SMITH Presented By: Prasanth Kanakadandi.
1 Dynamic Branch Prediction. 2 Why do we want to predict branches? MIPS based pipeline – 1 instruction issued per cycle, branch hazard of 1 cycle. –Delayed.
CSCI 6461: Computer Architecture Branch Prediction Instructor: M. Lancaster Corresponding to Hennessey and Patterson Fifth Edition Section 3.3 and Part.
University of Texas at Austin CS352H - Computer Systems Architecture Fall 2009 Don Fussell CS352H: Computer Systems Architecture Topic 8: MIPS Pipelined.
Branch Hazards and Static Branch Prediction Techniques
CS 6290 Branch Prediction. Control Dependencies Branches are very frequent –Approx. 20% of all instructions Can not wait until we know where it goes –Long.
11 Pipelining Kosarev Nikolay MIPT Oct, Pipelining Implementation technique whereby multiple instructions are overlapped in execution Each pipeline.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 13: Branch prediction (Chapter 4/6)
Branch Prediction Perspectives Using Machine Learning Veerle Desmet Ghent University.
Ghent University Veerle Desmet Lieven Eeckhout Koen De Bosschere Using Decision Trees to Improve Program-Based and Profile-Based Static Branch Prediction.
CSL718 : Pipelined Processors
CS203 – Advanced Computer Architecture
Computer Structure Advanced Branch Prediction
Computer Architecture
Dynamic Branch Prediction
CS 704 Advanced Computer Architecture
Pipeline Implementation (4.6)
Samira Khan University of Virginia Dec 4, 2017
Module 3: Branch Prediction
So far we have dealt with control hazards in instruction pipelines by:
Branch statistics Branches occur every 4-6 instructions (16-25%) in integer programs; somewhat less frequently in scientific ones Unconditional branches.
Advanced Computer Architecture
Hyesoon Kim Onur Mutlu Jared Stark* Yale N. Patt
Pipelining and control flow
So far we have dealt with control hazards in instruction pipelines by:
* From AMD 1996 Publication #18522 Revision E
So far we have dealt with control hazards in instruction pipelines by:
So far we have dealt with control hazards in instruction pipelines by:
Pipelining: dynamic branch prediction Prof. Eric Rotenberg
Dynamic Hardware Prediction
So far we have dealt with control hazards in instruction pipelines by:
So far we have dealt with control hazards in instruction pipelines by:
So far we have dealt with control hazards in instruction pipelines by:
So far we have dealt with control hazards in instruction pipelines by:
So far we have dealt with control hazards in instruction pipelines by:
Gang Luo, Hongfei Guo {gangluo,
Presentation transcript:

Evaluation of the Gini-index for Studying Branch Prediction Features Veerle Desmet Lieven Eeckhout Koen De Bosschere

2 A simple prediction example outlook t° windy season,... umbrella prediction mechanism features goal = prediction accuracy of 100% past observations

3 A simple prediction example Daily prediction Binary prediction: yes or no Outcome in the evening Prediction strategies: –No need in summer, yes otherwise Easy, not very accurate –Based on humidity and temperature More complex, very accurate

4 Predicting How to improve prediction accuracy? Shortcomings of existing models? –Feature set –Prediction mechanism –Implementation limits –... This talk: evaluation of prediction features for branch prediction

5 Program execution Phases during instruction execution: Fetch = read next instruction Decode = analyze type and read operands Execute Write Back = write result FetchDecodeExecuteWrite Back R1=R2+R3 addition 43 computation R1 contains 7

6 Pipelined architectures Parallel versus sequential: Constant flow of instructions possible Faster applications Limitation due to branches FetchDecodeExecuteWrite Back R1=R2+R3 R5=R2+1R1=R2+R3R5=R2+1R4=R3-1R1=R2+R3R5=R2+1R4=R3-1R7=2*R1R5=R2+1R4=R3-1R7=2*R1R5=R6R4=R3-1R7=2*R1R5=R6R1=4

7 Branches FetchDecodeExecuteWrite Back R1=R2+R3 R5=R2+1 R4=R3-1R7=2*R1R5=R6 test R1=0 R5=R2+1R5=R6 ? test R1=0R5=R2+1 ?? test R1=0 R7=2*R1 R1=R2+R3 R5=R2+1 R7=0 R7=2*R1 R5=R6 test R1=0 yes no R2=R2-1 Branches determine program flow or execution path Introduce 2 bubbles affecting pipeline throughput

8 Solution 1 out of 8 instructions is a branch Waiting for the outcome of branches seriously affects amount of parallelism Increasing number of pipeline stages –Pentium 4: up to 20 stages Predict outcome of branch

9 Branch prediction Fetch those instructions that are likely to be executed Correct prediction eliminates bubbles FetchDecodeExecuteWrite Back R1=R2+R3 R5=R2+1 R4=R3-1R7=2*R1R5=R6 test R1=0 R5=R2+1R5=R6 R7=2*R1 test R1=0R5=R2+1 R7=2*R1R2=R2-1 R1=R2+R3 R5=R2+1 R7=0 R7=2*R1 R5=R6 test R1=0 yes no R2=R2-1

10 Branch prediction Prediction for each branch execution Binary prediction: taken or not-taken Outcome after the test is excuted Prediction strategies: –Many predictors in literature –Static versus dynamic

11 Static branch prediction BTFNT: Backward Taken, Forward Not Taken –Loops (e.g. For, while) –Summer no need of umbrella Based on type of test in branch –Branch if equal mostly not-taken –Sunday no need of umbrella Easy, prediction fixed at compile-time Prediction accuracy: about 75%

12 Dynamic branch prediction Bimodal Global Gshare Local Simulations: SimpleScalar/Alpha SPEC2000 integer benchmarks 250M branches

13 Bimodal branch predictor Averaging outcomes from previous years branch address saturating counter e.g. 2 saturating counter e.g. 3 prediction e.g. taken update with outcome e.g. taken

14 Global branch predictor Averaging last day outcomes global history e.g saturating counter e.g. 2 saturating counter e.g. 3 prediction e.g. taken update with outcome e.g. taken global history e.g. 1111

15 Gshare branch predictor saturating counter e.g. 2 prediction e.g. taken branch address XOR global history e.g update with outcome AMD K6

16 Local branch predictor Record day outcomes of previous years Averaging over same day histories branch address prediction local history e.g saturating counter e.g. 2

17 Accuracy versus storage local bimodal gshare global Prediction Accuracy (%) Predictor Size (byte)

18 Branch prediction strategies All saturating counter mechanism All use of limited tables –problem with so-called aliasing Different prediction features Accuracies up to 95% Further improvement? Predictive power of features?

19 Feature selection Which features are relevant? Less features –require less storage –faster prediction prediction mechanism features ? Feature selection

20 Systematic feature evaluation Feature = input to predictor Power of features –predictor size not fixed –prediction strategy not fixed Decision trees: –Selects feature –Split observations –Recursive algorithm –Easy understandable

21 Decision Tree Construction Outlookt°windy sunnyhighno sunnylowyes overcasthighno overcastlowno overcasthighyes overcastlowyes rainlownoyes rainhighyes past observations features outlook windy YES NOYES yesno sunny overcast rain prediction mechanism prediction

22 Gini-index Metric for partition purity of a data set S: Gini (S) = 1 – p 0 ² – p 1 ² where p i is the relative frequence of class i in S For binary prediction: minimum 0 maximum 0.5 The higher the Gini-index, the more difficult to predict

23 Finding good split points If data set S is split into two subsets S0 and S1 with sizes N0 and N1 (N = N0 + N1): Feature with lowest Gini split is chosen Extensible for non binary features Looking for features with low Gini split -index, i.e. features with good predictive power N0 N N1 N Gini(S0) +Gini(S1) Gini split (S) =

24 Individual feature bits 0 0,05 0,1 0,15 0,2 0,25 0,3 0,35 0,4 0,45 0,5 global history local history branch address gshare-index target direction branch type ending type successor basic block dynamic features static features Gini split -index

25 Individual features Local history bits very good –perfect local history uses branch address Static features powerful –non-binary –except target direction –known at compile-time Looking for good feature combinations...

26 Features as used in predictors 0 0,05 0,1 0,15 0,2 0,25 0,3 0,35 0,4 0,45 0, Gini split -index global history branch address gshare-index local history Feature length (bit)

27 Features as used in predictors Static features better for small lengths Better if longer features A few local history bits enough Same behaviour as accuracy curves –low Gini-index implies high accuracy Independent to predictor size Independent to prediction strategy

28 Remark Limitation of decision trees: outliers –majority vote –clean data Keep implementation in mind Outlookt°windy sunnyhighno sunnyhighnoyes sunnyhighno

29 Conclusion Need of accurate branch prediction in modern microprocessors Towards systematic predictor development –Selecting features –Predictive power of features Gini-index useful for studying branch prediction features –without fixing any predictor aspect

Thanks for Listening

31 Branch prediction Incorrect prediction or misprediction Penalty for cancelling instructions (3 bubbles) FetchDecodeExecuteWrite Back test R1=0R5=R2+1R5=R6 R7=2*R1 test R1=0R5=R2+1 R7=2*R1R2=R2-1 R1=R2+R3 R5=R2+1 R7=0 R7=2*R1 R5=R6 test R1=0 yes no R2=R2-1 R7=0 test R1=0R7=2*R1 R2=R2-1