The O-GEHL branch predictor
Download
Report
Transcript The O-GEHL branch predictor
Looking for limits in branch prediction
with the GTL predictor
André Seznec
IRISA/INRIA/HIPEAC
1
André Seznec
Caps Team
IRISA/INRIA
Motivations
Geometric history length predictors introduced in 20042006
OGEHL, CBP-1, dec. 2004
TAGE, JILP ’06, feb. 2006
• Storage effective
• Exploits very long global histories
• Were defined with possible implementation in mind
What are the limits of accuracy that can be captured
with these schemes ?
How do they compare with unconstrained prediction
schemes ?
2
André Seznec
Caps Team
Irisa
Geometric history length predictors:
global history +multiple lengths
TO
T1
T2
L(0)
L(1)
L(2)
T3
?
T4
L(3)
L(4)
3
André Seznec
Caps Team
Irisa
GEometric History Length
predictor
The set of history lengths forms a geometric series
L(0) 0
L(i) α i 1L(1)
Capture correlation
on very long histories
{0, 2, 4, 8, 16, 32, 64, 128}
most of the storage
What
is important:
for short
history !!L(i)-L(i-1) is drastically increasing
4
André Seznec
Caps Team
Irisa
Combining multiple predictions
Neural inspired predictors
Use a (multiply)-add tree
O-GEHL, CBP-1
Partial matching
Use tagged tables and the longest matching history
TAGE, JILP’ 06
5
André Seznec
Caps Team
Irisa
CBP-1 (2004): O-GEHL
Final computation through a sum
TO
T1
T2
L(0)
L(1)
L(2)
T3
∑
T4
L(3)
Prediction=Sign
L(4)
256Kbits: 12 components 3.670 misp/KI
6
André Seznec
Caps Team
Irisa
JILP ‘06: TAGE
longest matching history
=?
1
=?
1
1
=?
1
1
1
1
1
1
256Kbits: 3.358 misp/KI
7
André Seznec
Caps Team
Irisa
What is global history
conditional branch history:
path confusion on short histories
path history:
Direct hashing leads to path confusion
1. Represent all branches in branch history
2. Use path AND direction history
8
André Seznec
Caps Team
Irisa
Using a kernel history and a user
history
Traces mix user and kernel activities:
Kernel activity after exception
• Global history pollution
Solution: use two separate global histories
User
history is updated only in user mode
Kernel history is updated in both modes
9
André Seznec
Caps Team
Irisa
Accuracy limits for TAGE
Varying the predictor size, the number of
components, the tag width, the history length.
Allowing multiple allocations
The best accuracy on distributed traces:
3.054 misp/KI
• History length around 1,000
• 15-20 components
• No need for tags wider than 16 bits
10
André Seznec
Caps Team
Irisa
Accuracy limits for GEHL
Varying the predictor size, the number of components,
the history length, counter width
(slightly) improving the update policy
and fitting in the two hours simulation rule
on the distributed traces:
2.842 misp/KI
• 97 components
• 8 bits counter
• 2,000 bits global history
11
André Seznec
Caps Team
Irisa
GEHL vs TAGE
Realistic implementation parameters (storage
budget, number of components)
TAGE is more accurate than (O-)GEHL
Unlimited budget, huge number of components
GEHL is more accurate than TAGE
12
André Seznec
Caps Team
Irisa
Will it be sufficient
to win
The Championship ?
GEHL history length: 2,000
97 components
2.842 misp/KI
13
André Seznec
Caps Team
Irisa
A step further: hybrid GEHL-TAGE
On a few benchmarks, TAGE is more accurate
than GEHL,
Let
us try an hybrid GEHL-TAGE predictor
14
André Seznec
Caps Team
Irisa
Hybrid GEHL-TAGE
Branch/path history + PC
GEHL
mux
TAGE
Meta
=
egskew
Inherit from:
Agree/bimode, YAGS, 2bcgskew,
15
André Seznec
Caps Team
Irisa
GEHL+TAGE
GEHL provides the main prediction:
also used as the base predictor for TAGE
(YAGS inspired)
TAGE records when GEHL fails:
{prediction, address, history}
(agree/bimode, YAGS inspired)
Meta selects between GEHL and TAGE
(2bcgskew inspired)
16
André Seznec
Caps Team
Irisa
Let us have fun !!
GEHL history length: 400
TAGE history length: 100,000
2.774 misp/KI
17
André Seznec
Caps Team
Irisa
Might still be
unsufficient
GEHL history length: 400
TAGE history length: 100,000
2.774 misp/KI
18
André Seznec
Caps Team
Irisa
Adding a loop predictor
The loop predictor captures the number of
iterations of a loop
When successively encounters 8 times the
same number of iterations, the loop
predictor provides the prediction.
Advantage:
Very reliable
19
André Seznec
Caps Team
Irisa
GTL predictor
Branch/path history + PC
GEHL
=
egskew
Loop
predictor
+ static prediction on first occurrence
20
confidence
Meta
mux
mux
TAGE
André Seznec
Caps Team
Irisa
Hope this will be sufficient
to win
the Championship !!
GTL
GEHL, 97 comp., 400 hist.
+ TAGE, 19 comp., 100,000 hist
+ loop predictor
2.717 misp/KI
21
André Seznec
Caps Team
Irisa
Geometric History Length predictors
and limits on branch prediction
Unlimited budget, huge number of components
GEHL is more accurate than TAGE
Very old correlation can be captured:
On two benchmarks, using 10,000 history is really
helping
Does not seem to be a lot of potential extra benefit
from local history
We did not find any interesting extra scheme apart loop
prediction
Loop prediction, very marginal apart gzip
22
André Seznec
Caps Team
Irisa
The End
23
André Seznec
Caps Team
Irisa