André Seznec Caps Team IRISA/INRIA 1 Looking for limits in branch prediction with the GTL predictor André Seznec IRISA/INRIA/HIPEAC
André Seznec Caps Team Irisa 2 Motivations Geometric history length predictors introduced in OGEHL, CBP-1, dec TAGE, JILP 06, feb 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 ?
André Seznec Caps Team Irisa 3 L(0) ? L(4) L(3) L(2) L(1) TO T1 T2 T3 T4 Geometric history length predictors: global history +multiple lengths
André Seznec Caps Team Irisa 4 GEometric History Length predictor The set of history lengths forms a geometric series What is important: L(i)-L(i-1) is drastically increasing most of the storage for short history !! {0, 2, 4, 8, 16, 32, 64, 128} Capture correlation on very long histories
André Seznec Caps Team Irisa 5 Combining multiple predictions Neural inspired predictors Use a (multiply)-add tree Partial matching Use tagged tables and the longest matching history O-GEHL, CBP-1 TAGE, JILP 06
André Seznec Caps Team Irisa 6 L(0) L(4) L(3) L(2) L(1) TO T1 T2 T3 T4 CBP-1 (2004): O-GEHL Final computation through a sum Prediction=Sign 256Kbits: 12 components misp/KI
André Seznec Caps Team Irisa 7 =? JILP 06: TAGE longest matching history 256Kbits: misp/KI
André Seznec Caps Team Irisa 8 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
André Seznec Caps Team Irisa 9 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
André Seznec Caps Team Irisa 10 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: misp/KI History length around 1, components No need for tags wider than 16 bits
André Seznec Caps Team Irisa 11 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: misp/KI 97 components 8 bits counter 2,000 bits global history
André Seznec Caps Team Irisa 12 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
André Seznec Caps Team Irisa 13 Will it be sufficient to win The Championship ? GEHL history length: 2, components misp/KI
André Seznec Caps Team Irisa 14 A step further: hybrid GEHL-TAGE On a few benchmarks, TAGE is more accurate than GEHL, Let us try an hybrid GEHL-TAGE predictor
André Seznec Caps Team Irisa 15 Hybrid GEHL-TAGE Branch/path history + PC GEHL TAGE Meta = egskew mux Inherit from: Agree/bimode, YAGS, 2bcgskew,
André Seznec Caps Team Irisa 16 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)
André Seznec Caps Team Irisa 17 Let us have fun !! GEHL history length: 400 TAGE history length: 100, misp/KI
André Seznec Caps Team Irisa 18 Might still be unsufficient GEHL history length: 400 TAGE history length: 100, misp/KI
André Seznec Caps Team Irisa 19 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
André Seznec Caps Team Irisa 20 GTL predictor Branch/path history + PC GEHL TAGE Meta = egskew mux Loop predictor mux + static prediction on first occurrence confidence
André Seznec Caps Team Irisa 21 Hope this will be sufficient to win the Championship !! GTL GEHL, 97 comp., 400 hist. + TAGE, 19 comp., 100,000 hist + loop predictor misp/KI
André Seznec Caps Team Irisa 22 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
André Seznec Caps Team Irisa 23 The End