Post on 16-Jan-2016
ACSAC’04
Choice Predictor for Choice Predictor for FreeFree
Mongkol EkpanyapongMongkol EkpanyapongPinar KorkmazPinar Korkmaz
HsienHsien--Hsin SHsin S. . LeeLee
School of Electrical and Computer EngineeringSchool of Electrical and Computer EngineeringGeorgia Institute of TechnologyGeorgia Institute of Technology
Atlanta, GA 30332Atlanta, GA 30332
Presented byDr. Youfeng WuDr. Youfeng WuIntel CorportaionIntel Corportaion
22Choice Predictor for Free
Branch Prediction SchemesBranch Prediction Schemes
Static Branch PredictionStatic Branch Prediction Predict at compile timePredict at compile time Based on inst. type or Based on inst. type or
profilingsprofilings Work well on easy-to Work well on easy-to
predict branch such as predict branch such as for-loopfor-loop
Dynamic Branch PredictionDynamic Branch Prediction Predict at run timePredict at run time Using hardware to track Using hardware to track
run-time behaviorrun-time behavior More accurateMore accurate Require more die area Require more die area
and power dissipationand power dissipation
33Choice Predictor for Free
Bimodal Branch PredictorBimodal Branch Predictor
Using counters to determine branch Using counters to determine branch directiondirection
Example of bimodal branch predictor Example of bimodal branch predictor
Branch addr
2 bit-counter
Counter > 1 :: hitCounter <= 1 :: miss
44Choice Predictor for Free
Global Branch PredictorGlobal Branch Predictor
Using global branch history to determine Using global branch history to determine the directionthe direction
Example of global branch predictorExample of global branch predictor
1 1 . . . . .
1 0
00…..0000…..0100…..10
11…..1111…..10
index
Branch History Pattern
Pattern History Table (PHT)Pattern History Table (PHT)
Rc-k Rc-1
Branch History Register (BHR)Branch History Register (BHR)(Shift left when update)
2 bit-counter
55Choice Predictor for Free
Hybrid Branch PredictorHybrid Branch Predictor
Combining advantages of different branch Combining advantages of different branch predictorspredictors
Increasing branch prediction accuracyIncreasing branch prediction accuracyUse choice predictor to decide which Use choice predictor to decide which
branch predictors to favorbranch predictors to favorEmploys by many high performance Employs by many high performance
processorsprocessors
66Choice Predictor for Free
Example of Hybrid Branch Example of Hybrid Branch PredictorPredictor
77Choice Predictor for Free
MotivationMotivation
for i = 0 to 100000for i = 0 to 100000
a: if(i>0) …..a: if(i>0) …..
b: if(i%2 == 0) …..b: if(i%2 == 0) …..
end forend for
Choice Predictor
Branch address
Bimodal Predictor Global Predictor
Branch address Branch history
2 bit-counter
a: bimodalb: global
88Choice Predictor for Free
OutlineOutline
IntroductionIntroductionRelated WorkRelated WorkStatic Prediction GenerationStatic Prediction GenerationExperimental ResultsExperimental ResultsConclusionConclusion
99Choice Predictor for Free
Related WorkRelated Work
Profile guided branch prediction by Fisher and Profile guided branch prediction by Fisher and Freundenberger [ASPLOS,1992]Freundenberger [ASPLOS,1992]
Program based branch prediction by Ball and Larus Program based branch prediction by Ball and Larus [PLDI,1993][PLDI,1993]
Static correlated branch prediction by Yang and Smith Static correlated branch prediction by Yang and Smith [TOPLAS, 1999][TOPLAS, 1999]
Branch classification by Chang et al. [IJPP, 1999]Branch classification by Chang et al. [IJPP, 1999] Static methods in hybrid branch prediction by GrunwaldStatic methods in hybrid branch prediction by Grunwald Branch prediction on demand by Chaver [ISLPED, 2003]Branch prediction on demand by Chaver [ISLPED, 2003]
1010Choice Predictor for Free
OutlineOutline
IntroductionIntroductionRelated WorkRelated WorkStatic Prediction GenerationStatic Prediction GenerationExperimental ResultsExperimental ResultsConclusionConclusion
1111Choice Predictor for Free
Static Prediction Static Prediction GenerationGeneration
Profile guided static choice predictionProfile guided static choice predictionWe can eliminate choice predictorWe can eliminate choice predictor
Less areaLess areaLess power consumption for updatingLess power consumption for updating
We propose two classification modelsWe propose two classification modelsStatic Correlation Choice (SCC) prediction Static Correlation Choice (SCC) prediction Static Choice (SC) predictionStatic Choice (SC) prediction
1212Choice Predictor for Free
Static Choice PredictionStatic Choice Prediction
1313Choice Predictor for Free
SCC ModelSCC Model
If biased branch (more than 90%If biased branch (more than 90% hit rate) then favor bimodalhit rate) then favor bimodalCCLPLP == # consecutive taken and not taken for a given branch address# consecutive taken and not taken for a given branch addressE.g. branch pattern = 111100000101010 then CE.g. branch pattern = 111100000101010 then CLPLP = 3 + 4 = 7= 3 + 4 = 7
CCGPGP == # consecutive taken and not taken of k-history group for a given # consecutive taken and not taken of k-history group for a given branch addressbranch address
E.g. Suppose k =2 and branch history is as follows:E.g. Suppose k =2 and branch history is as follows:101000001111 for the 00 group, 11111111110 for the 01 group, 101000001111 for the 00 group, 11111111110 for the 01 group, 1110 for the 10 group, and 1000000 for the 11 group1110 for the 10 group, and 1000000 for the 11 groupThen CThen CGP GP = 7 + 9 +2 +5 = 22.= 7 + 9 +2 +5 = 22.
If CIf CLPLP >> CCGPGP then favor bimodal branch predictorthen favor bimodal branch predictorElse favor global branch predictorElse favor global branch predictor
1414Choice Predictor for Free
SC ModelSC Model
Using results collected from software Using results collected from software based choice predictor from simulatorbased choice predictor from simulator
Count number of predication using Count number of predication using bimodal and global branch prediction, bimodal and global branch prediction, favor the majorityfavor the majority
This can be done by incorporate simulator This can be done by incorporate simulator into profile guided compilerinto profile guided compiler
1515Choice Predictor for Free
Comparing between SCC and Comparing between SCC and SCSC
SC model consider SC model consider aliasing into accountaliasing into account
Consider if branch a and Consider if branch a and c destructively interfere c destructively interfere each other in global each other in global branch predictor tablebranch predictor table
SCC will still favor global SCC will still favor global branch predictorbranch predictor
SC will favor bimodalSC will favor bimodal
1616Choice Predictor for Free
OutlineOutline
IntroductionIntroductionRelated WorkRelated WorkStatic Prediction GenerationStatic Prediction GenerationExperimental ResultsExperimental ResultsConclusionConclusion
1717Choice Predictor for Free
Simulation InfrastructureSimulation Infrastructure Execution Engine Out-of-order
Fetch Width 8 instruction
Issue Width 8 instruction
ALU Units 4 units
Branch Target Buffer 4-way, 4096 sets
Register Update Unit 128 entries
Cache organization 4-way split I- and D-L1:
64 KB each
2 cycle hit latency
32 bytes line
4-way L2(unified):
512 KB
16 cycle hit latency
64 bytes line
Memory latency 120 core cycles
1818Choice Predictor for Free
Miss Prediction RatesMiss Prediction Rates
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
gzip vpr mcf crafty parser perl gap bzip2 twolf Avg
hybrid_g10 hybrid_g10+scc hybrid_g10+sc hybrid_g10+rand
1919Choice Predictor for Free
Normalized SpeedupNormalized Speedup
0.95
1.05
1.15
1.25
1.35
gzip vpr mcf crafty parser perl gap bzip2 twolf Avg
hybrid_g10 hybrid_g10+scc hybrid_g10+sc hybrid_g10+rand
2020Choice Predictor for Free
Normalized Power Normalized Power ConsumptionConsumption
0
0.5
1
1.5
2
2.5
3
3.5
gzip vpr mcf crafty parser perl gap bzip2 twolf Avg
hybrid_g10 hybrid_g10+scc hybrid_g10+sc hybrid_g10+rand
2121Choice Predictor for Free
Normalized Processor Normalized Processor EnergyEnergy
0.85
0.87
0.89
0.91
0.93
0.95
0.97
0.99
1.01
gzip vpr mcf crafty parser perl gap bzip2 twolf Avg
hybrid_g10 hybrid_g10+scc hybrid_g10+sc hybrid_g10+rand
2222Choice Predictor for Free
Normalized Performance on Normalized Performance on Different Input SetsDifferent Input Sets
2323Choice Predictor for Free
Normalized Performance on Normalized Performance on Different Hybrid Branch Different Hybrid Branch
PredictorsPredictors
0.95
1
1.05
1.1
1.15
1.2
1.25
1.3
1.35
gzip vpr mcf crafty parser perl gap bzip2 twolf Avg
hybrid_g10 hybrid_g10_sc hybrid_PAg hybrid_PAg_sc hybrid_GAp hybrid_GAp_sc
2424Choice Predictor for Free
Normalized Power on Different Normalized Power on Different Hybrid Branch Predictors Hybrid Branch Predictors
0.95
1.05
1.15
1.25
1.35
gzip vpr mcf crafty parser perl gap bzip2 twolf Avg
hybrid_g10 hybrid_g10_sc hybrid_PAg hybrid_PAg_sc hybrid_GAp hybrid_GAp_sc
2525Choice Predictor for Free
Normalized Energy on Normalized Energy on Different Hybrid Branch Different Hybrid Branch
PredictorsPredictors
0.60.650.70.750.80.850.90.95
11.05
gzip vpr mcf crafty parser perl gap bzip2 twolf Avg
hybrid_g10 hybrid_g10_sc hybrid_PAg hybrid_PAg_sc hybrid_GAp hybrid_Gap_sc
2626Choice Predictor for Free
Normalized Area of Normalized Area of Hybrid branch predictorsHybrid branch predictors
Branch predictor Normalized area
gshare11 1.9822
gshare12 4.806
hybrid_g10 2.973
hybrid_g10+scc/sc 1.986
hybrid_g11 3.955
hybrid_g11+scc/sc 2.968
hybrid_PAg 4.946
hybrid_PAg+sc 3.959
hybrid_GAp 3.713
hybrid_Gap+sc/scc 2.726
2727Choice Predictor for Free
OutlineOutline
IntroductionIntroductionRelated WorkRelated WorkStatic Prediction GenerationStatic Prediction GenerationExperimental ResultsExperimental ResultsConclusionConclusion
2828Choice Predictor for Free
ConclusionConclusion
We propose two profile-guided techniques We propose two profile-guided techniques Static Correlation Choice and Static Static Correlation Choice and Static ChoiceChoice
From this, we can eliminate the need of From this, we can eliminate the need of choice predictor which can save power choice predictor which can save power (40% on avg.) and area (27% on avg.)(40% on avg.) and area (27% on avg.)
It can be extended to more complex It can be extended to more complex branch predictors with more complex branch predictors with more complex choice predictorchoice predictor
2929Choice Predictor for Free
Thank YouThank You