Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @...

15
Not- Taken? Taken ? The Frankenpredic tor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004

Transcript of Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @...

Page 1: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Not-Taken?

Taken?

The Frankenpredict

or

Gabriel H. LohGeorgia Tech

College of Computing

CBP-1 @ MICRODec 5, 2004

Page 2: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Design Objectives

• Capacity– SERV has large branch footprint

• Long history length correlation– INT and MM benefit from this

• 8KB makes interference a big issue

• … and don’t mess up FP

Page 3: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Overview

Perceptron Table

+Global BHR

Path-Neural:Long History

Fusion

Path-Neural:Long History

Fusion

Gskew-Agree:Capacity

Gskew-Agree:Capacity Ideas from:

static branch prediction, gskewed, agree, perceptron, path-based neural, 2bcgskew, fusion, MAC-RHSP, machine learning

Misc Other IdeasMisc Other Ideas

Page 4: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Gskew-Agree Lookup

PC

Target

BTFNT

hh11hh11 hh22

hh22

Global BHR

hh00hh00

BIMBIM G0G0 G1

G1

1

1

0

MAJMAJMAJMAJ

=?=?=?=? =?=?=?=? =?=?=?=? =?=?=?=?

xg0 xg1 xg2 xgM

>?>?>?>?

Page 5: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Gskew-Agree Update

• Shared Hysteresis– Every two counters share one hyst. bit

• Partial Update– Modified from 2bcgskew (no meta rules)– On mispred, update all three tables– If correct:

• If all agree, do nothing• Else update the two correct tables

11

0

Page 6: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Path-Based Perceptron

x0 xp0 xp1 x1 x2 x3 … x10

...

84 rows, 8-bit weights

168 rows, 8-bit weights

Bias, Pseudotag, Recent History

XX X X X X X +

B1B1

x11 x12 x13 ... x59

...

42 rows, 7-bit weights

Old History

X X X X

B2B2

xg0 xg1 xg2 xgM

Gskew-Agree

X X X X

B3B3

Page 7: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Redundant Indexing

… …

......

Bias, Pseudotag, Recent History Old History Gskew-Agree

X

X

X

X

X

X

X

X

X

X

X

X

X X

X X

X

X

X

X

X

X

X

X

X

X

X

X

X

X

X

X

X

X +

Page 8: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Non-Linear Learning Curves

• Slow start:– avoids transient/coincidental correlation

• Steep End:– quick unlearning

Stored Value

Act

ual V

alue

Stored Value

Act

ual V

alue

Stored Value

Act

ual V

alue

B1, B3B2 (older history)

Page 9: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Synergistic Reinforcement

BIMBIM PC

BTFNT

=?=?=?=?

hashhash

hashhash

=?=?=?=? signsign

xg0

<< 1<< 1

ToSummation

G0G0

Global BHRhashhash

=?=?=?=?

hashhash

signsign =?=?=?=?

xg1

<< 1<< 1

Page 10: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Notes on Initialization

• All neural weights initialized to zero except those corresponding to xgM– The perceptron will use the

gskew-agree prediction until other correlations are established

• All PHT banks initialized to “Weakly Agree”– gskew-agree provides a

BTFNT prediction at start of program

Page 11: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Unconditional Branches

• Always predict taken, of course

• No update to PHTs, neural weights, path

• Update global BHR:

Call:00000000

Return:11111111

Other:01010101

PC

xor

xor

xor

Page 12: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

“Path” History Update

PC

Path2Path3

Pa4Pa5Pa6Pa7Pa8Pa9

Pa10

Shift registers

Global BHR

Outcome

Branch Address

Path1

Page 13: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Index Generation

Primary Index:

Path History

PC

3 LSB

Redundant Index:

6 most recent BHR bits

+++

B1B1 B2

B2

Page 14: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Implementation Issues

• Frankenpredictor optimized for state

• Neural table sizes not power-of-two

• Redundant indexing biggest challenge– Many hash functions– Many ports– Huge adder tree

Page 15: Not- Taken? Taken? The Frankenpredictor Gabriel H. Loh Georgia Tech College of Computing CBP-1 @ MICRO Dec 5, 2004.

Summary

• Gskew for capacity, Neural for long-history– Neural also for fusion

• Gskew-Agree– Skewing for interference-avoidance– Agree-prediction for interference-tolerance

• Contact:– loh <at> cc.gatech.edu– http://www.cc.gatech.edu/~loh