Exploring Branch Prediction

Slides:



Advertisements
Similar presentations
H-Pattern: A Hybrid Pattern Based Dynamic Branch Predictor with Performance Based Adaptation Samir Otiv Second Year Undergraduate Kaushik Garikipati Second.
Advertisements

Branch prediction Titov Alexander MDSP November, 2009.
Pipelining V Topics Branch prediction State machine design Systems I.
Dynamic History-Length Fitting: A third level of adaptivity for branch prediction Toni Juan Sanji Sanjeevan Juan J. Navarro Department of Computer Architecture.
Lecture 8 Dynamic Branch Prediction, Superscalar and VLIW Advanced Computer Architecture COE 501.
CPE 631: Branch Prediction Electrical and Computer Engineering University of Alabama in Huntsville Aleksandar Milenkovic,
Dynamic Branch Prediction
Clustered Indexing for Conditional Branch Predictors Veerle Desmet Ghent University Belgium.
CPE 731 Advanced Computer Architecture ILP: Part II – Branch Prediction Dr. Gheith Abandah Adapted from the slides of Prof. David Patterson, University.
W04S1 COMP s1 Seminar 4: Branch Prediction Slides due to David A. Patterson, 2001.
Computer Architecture 2011 – Branch Prediction 1 Computer Architecture Advanced Branch Prediction Lihu Rappoport and Adi Yoaz.
1 Lecture 7: Static ILP, Branch prediction Topics: static ILP wrap-up, bimodal, global, local branch prediction (Sections )
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.
1 Lecture 7: Out-of-Order Processors Today: out-of-order pipeline, memory disambiguation, basic branch prediction (Sections 3.4, 3.5, 3.7)
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 )
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 Lecture 8: Branch Prediction, Dynamic ILP Topics: branch prediction, out-of-order processors (Sections )
Goal: Reduce the Penalty of Control Hazards
Branch Target Buffers BPB: Tag + Prediction
1 Lecture 8: Instruction Fetch, ILP Limits Today: advanced branch prediction, limits of ILP (Sections , )
Computer Architecture Instruction Level Parallelism Dr. Esam Al-Qaralleh.
1 Lecture 8: Branch Prediction, Dynamic ILP Topics: static speculation and branch prediction (Sections )
Dynamic Branch Prediction
EENG449b/Savvides Lec /25/05 March 24, 2005 Prof. Andreas Savvides Spring g449b EENG 449bG/CPSC 439bG.
CIS 429/529 Winter 2007 Branch Prediction.1 Branch Prediction, Multiple Issue.
Spring 2003CSE P5481 Control Hazard Review The nub of the problem: In what pipeline stage does the processor fetch the next instruction? If that instruction.
1 Lecture 7: Branch prediction Topics: bimodal, global, local branch prediction (Sections )
1 Branch Prediction Techniques Computer Architecture Vahe Poladian & Stefan Niculescu October 14, 2002.
EECC722 - Shaaban #1 Lec # 9 Fall Conventional & Block-based Trace Caches In high performance superscalar processors the instruction fetch.
Evaluation of Dynamic Branch Prediction Schemes in a MIPS Pipeline Debajit Bhattacharya Ali JavadiAbhari ELE 475 Final Project 9 th May, 2012.
Evaluation of the Gini-index for Studying Branch Prediction Features Veerle Desmet Lieven Eeckhout Koen De Bosschere.
Analysis of Branch Predictors
ACSAC’04 Choice Predictor for Free Mongkol Ekpanyapong Pinar Korkmaz Hsien-Hsin S. Lee School of Electrical and Computer Engineering Georgia Institute.
1 A New Case for the TAGE Predictor André Seznec INRIA/IRISA.
Branch.1 10/14 Branch Prediction Static, Dynamic 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.
Branch Prediction Perspectives Using Machine Learning Veerle Desmet Ghent University.
Yiorgos Makris Professor Department of Electrical Engineering University of Texas at Dallas EE (CE) 6304 Computer Architecture Lecture #13 (10/28/15) Course.
Dynamic Branch Prediction
CSL718 : Pipelined Processors
Lecture: Out-of-order Processors
CS203 – Advanced Computer Architecture
Computer Structure Advanced Branch Prediction
Dynamic Branch Prediction
Computer Architecture Advanced Branch Prediction
CS5100 Advanced Computer Architecture Advanced Branch Prediction
COSC3330 Computer Architecture Lecture 15. Branch Prediction
CMSC 611: Advanced Computer Architecture
Exploring Value Prediction with the EVES predictor
Lecture 6: Static ILP, Branch prediction
So far we have dealt with control hazards in instruction pipelines by:
CPE 631: Branch Prediction
Dynamic Branch Prediction
So far we have dealt with control hazards in instruction pipelines by:
Lecture 10: Branch Prediction and Instruction Delivery
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
Adapted from the slides of Prof
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:
Lecture 7: Branch Prediction, Dynamic ILP
CPE 631 Lecture 12: Branch Prediction
Presentation transcript:

Exploring Branch Prediction Aditya Akella Shuchi Chawla Jia-Yu Pan

A Framework for Branch Prediction

Dividing Streams First level: per branch substream Finer decomposition Branch pattern history Global pattern history Global path history 1011… 1110… (b1,1)(b2,1)(b2,1)… Loop1: addq r1, r2, r3 addq r2, r4, r5 loop 2: subq r2,r3,r5 beq r5, loop2 bne r5, loop1 Executes twice

Path vs Pattern As expected, path history provides better correlation

Predictors Static vs Dynamic Adapt to changing bias Biased stream: Majority prediction Adapt to changing bias Damping: 2 (or more) – bit predictor Is more better? Static is better on a large number of branches But, dynamic far outperforms static on the rest Adaptive schemes should exploit this

Implementation Issues: Limited space Many branches map to same stream: Aliasing Mostly a destructive effect More aggressive schemes may not be necessarily better

gshare GAs  6 bits branch identifier 6 bits history concatenate 6 bits history 12 bits stream identifier 12 bits branch identifier 12 bit history  12 bits stream identifier truncate to 1024 streams

Implementation Issues: Limited space Many branches map to same stream: Aliasing Mostly a destructive effect More aggressive schemes may not be necessarily better

Cross-procedure Correlation Some static prediction schemes “forget” history on returning from a procedure call Fun_call: if (x>0) return(1); else return(0); Main: a = fun_call(); if (a>0) goto… Direction taken by the branch inside the procedure completely specifies the direction taken by the branch outside

Branch Prediction Using Data Values Traditional approach Local history information Global path and history information Reducing table interference (better indexing) Use PCs and branch outcomes as input Do not contain all the information Misprediction!!

How can one improve prediction of such branches? Use Data Values!!!!!!!!!!!!

How to Use Data Values Speculative branch execution Second scheme was chosen Lower-latency prediction Some branches can use combined predictions Solution avoids data value prediction Using data values directly

Design Problems… (1) Large number of data values to store… Soln – store their difference Branch Difference Predictor (BDP) Backing Predictor predicts most cases REP predicts the small remaining subset Fringe cases with exceptional outcomes VHT provides ‘tag-check’.

Design Problems… (2) Delay in updating data values Out-of-order execution, pipeline latencies BDC -- most recently committed branch difference (indexed by branch PC) BCT -- count of the outstanding instances Staleness of the data value Operation Branch Fetch : Increment counter Branch Commit : Reset counter and update difference cache REP replacement policy Replace least successful entries Randomly ignore a chunk of mispredictions

Search for a good predictor design Paper: “A Language for Describing Predictors and its Application to Automatic Synthesis”

Designing a predictor Components of a predictor Counters and History More? Formulate as a search problem How?

Search the design space Representation Feedback Loop Model + Primitives P[w,d](I;U) => parse tree Feedback/ Update (U) d Input Index (I) Prediction (P) w

Examples Onebit[d](PC;T) Counter[n,d](I;T) Twobit[d](PC;T) =P[1,d](PC; T) Counter[n,d](I;T) = P[n,d](I; if T then P+1 else P-1) Twobit[d](PC;T) =MSB(Counter[2,d](PC;T))

Genetic Programming Process Operations on parse trees Population, Evaluation, Selection and populate next generation Operations on parse trees Replication, Crossover, Mutation, Encapsulation

Discussion Comparable good prediction accuracy Complex but new components Rediscover counters and local/global histories Predictors for other purposes, e.g. indirect jump target prediction

End Comments? Thank you.