bimode cascading: adaptive rehashing for ittage indirect branch predictor

26
Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor Y.Ishii, K.Kuroyanagi, T.Sawada, M.Inaba, and K.Hiraki

Upload: haru

Post on 23-Feb-2016

44 views

Category:

Documents


0 download

DESCRIPTION

Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor. Y.Ishii , K.Kuroyanagi , T.Sawada , M.Inaba , and K.Hiraki. Introduction. Indirect branches are categorized into two types Monomorphic Branch Takes only one target Easy-to-predict Polymorphic Branch - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Bimode Cascading: Adaptive Rehashing forITTAGE Indirect Branch Predictor

Y.Ishii, K.Kuroyanagi, T.Sawada, M.Inaba, and K.Hiraki

Page 2: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Introduction Indirect branches are categorized into two types

Monomorphic Branch Takes only one target Easy-to-predict

Polymorphic Branch Takes multiple targets Hard-to-predict

We have analyzed the balance between the monomorphic branch and the polymorphic branch

Page 3: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Classifies workloads into 3 types

0.0% 20.0% 40.0% 60.0% 80.0% 100.0%0

2000

4000

6000

8000

10000

Coverage of polymorphic branches (dynamic)

# of

indi

rect

bra

nche

s (s

tatic

)

Workload analysis in CBP3

Monomorphic Dominant

PolymorphicDominant

Otherworkloads

Page 4: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

0.0% 20.0% 40.0% 60.0% 80.0% 100.0%3

30

300

3000

30000

Coverage of polymorphic branches (dynamic)

# of

indi

rect

bra

nche

s (s

tatic

)

For Your Interest, In the paper, same chart uses different scale

Monomorphic Dominant

Polymorphic Dominant

Other workloads

Page 5: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

How to predict indirect branches

Monomorphic Branch Polymorphic Branch

Branch target buffer (BTB) Tagged Target Cache (TTC)

BTB

PC

TTC

PC

target

BHR

+

tag

=

targettag

=

Page 6: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Adaptive Rehashing Rehashable-BTB [Li+ 2002]

One tables are used to predict the branches.

Monomorphic branch Use Only PC

Polymorphic branch Use both PC & BHR

BHR PC

+BTB / TTC

targettag

=

Page 7: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Cascaded Predictor [Driesen+ 1998]

Multiple separated tables are used for predictions

Monomorphic branch BTB-like base predictor

Polymorphic branch TTC-like tagged predictor

Target

T0

Target

BASE

Page 8: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

ITTAGE Branch Predictor [Seznec+ 2006]

Target

T0

Target

BASE

Target

T1

Target

T2

Target

T3

Target

T4

The balance between BTB & TTC is fixed in design time.Wasting resource for monomorphic- or polymorphic-dominant workloads

Page 9: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Our Proposal

BCTAGE(Bimode Cascading ITTAGE)

Page 10: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

BCTAGE Key Idea

Dynamic reconfiguration to adapt the predictor to match the workload characteristics

Solution Combines adaptive rehashing and

cascaded predictor to improve the performance

Page 11: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Advantage of BCTAGE

Effective use of limited hardware resources For strongly monomorphic-dominant workloads For strongly polymorphic-dominant workloads

Page 12: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Adaptive Rehashing for ITTAGE Bimode Component

BIM mode: monomorphic friendly (using only PC) TAG mode: polymorphic friendly (using both PC & BHR)

Workload detector Decides the workload characteristics dynamically Tracks the capacity shortage of BTB-like resources

TTC50%

BTB50%

TTC75%

BTB25%

TTC90%

BTB10%

Monomorphic-dominant Normal Workloads Polymorphic-dominant

Page 13: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

T0BASE T1 T2 T3 T4

Bimode Cascading ITTAGE (BCTAGE)

BIM Cascading Multiplexer

TAG Cascading Multiplexer

Bimode components Several normal tagged

components are replaced

Two cascading MUXes BIM Cascading MUXes

For monomorphic branch TAG Cascading MUXes

For polymorphic branch

Switches data path and bimode component

T0BASE T1Bimode

T2 T3Bimode

T4

Page 14: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

For monomorphic-dominant workloads All bimode components

switch to BIM mode Provides predictions for

BIM Cascading MUXes

Blue boxes use only a PC to predict the branch Resources for BTB-like

predictions are increased

T0BASE T1BimodeBIM

T2 T3BimodeBIM

T4

BTB-like predictionTTC-like prediction

Page 15: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

For polymorphic-dominant workloads All bimode components

switches to TAG mode Provides predictions for

TAG Cascading Muxes

Yellow boxes use branch history to predict the branch Resources for TTC-like

predictions are increased

T0BASE T1BimodeTAG

T2 T3BimodeTAG

T4

BTB-like predictionTTC-like prediction

Page 16: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

For other workloads Combines BIM mode

and TAG mode

T1 (BIM mode) Makes BTB-like

predictions

T3 (TAG mode) Makes TTC-like

predictions

T0BASE T1BimodeBIM

T2 T3BimodeTAG

T4

BTB-like predictionTTC-like prediction

Page 17: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

The details of the bimode components Designed for adaptive

rehashing

Two input vectors Only PC Both PC and BHR

Select one input vector appropriate for current workload

BHR

Tag

PC

+

Target

=

Bimode

Page 18: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

The details of the bimode components Designed for adaptive

rehashing

Two hash function Only PC Both PC and BHR

Select one input vector appropriate for current workload

BHR

Tag

PC

+

Target

=

BimodeBIM mode

BIM mode:Using only PCBTB-like predictions

Page 19: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

The details of the bimode components Designed for adaptive

rehashing

Two hash function Only PC Both PC and BHR

Select one input vector appropriate for current workload

TAG mode:Using both PC & BHRTTC-like predictions

BHR

Tag

PC

+

Target

=

BimodeTAG mode

Page 20: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Workload Detector Responsible to decide the running mode

Check the capacity shortage of BTB-like resources BTB-like resource = BASE / BIM-mode components Tag miss in BTB-like resource is counted

Decide running modes Not enough BTB-like resource is assumed that

monomorphic-dominant workload Enough BTB-like resource is assumed that polymorphic-

dominant workload

Page 21: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Three modes supported by BCTAGE

T0BASE T1BIM

T2 T3TAG

T4

T0BASE T1BIM

T2 T3BIM

T4

T0BASE T1TAG

T2 T3TAG

T4

Monomorphic-dominant

Normal Workloads

Polymorphic-dominant

1-base component10-TAG components9-BIM components

1-base component10-normal tagged components4-TAG bimode components5-BIM bimode components

1-base component10-normal tagged components9-TAG bimode components

Page 22: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Implementation parameters Prediction Components

The base predictor Partially tagged BTB (8-bit tag, 5-way, 1280-entry)

The tagged components (13~23-bit tag) 10-normal tagged components 9-bimode components

Other storage Global branch/path/target history register (length = 281) Mode registers (2-bit) Performance counters (16-bit x 2)

Page 23: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Performance impact of the rehashing BCTAGE reduces MPKI/MPPKI in several workloads

Especially, monomorphic workloads

CLIENT05 SERVER01

BCTAGE

ITTAGE

ΔMPPKI 7.1% 0.6%

CLIENT05 SERVER01

BCTAGE

ITTAGE

ΔMPKI 9.2% 1.5%

Miss penalties per 1000 instructions Miss predictions per 1000 instructions

Total performance of BCTAGE outperforms ITTAGE

Page 24: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Related Work Base Algorithm

Branch Target Buffer [Lee+ 1983] Target Cache [Chang+ 1997]

Hybrid Strategy Cascaded Predictor [Driesen+ 1998] Rehashable BTB [Li+ 2002]

Novel implementation ITTAGE [Seznec+ 2006] VPC prediction [Kim+ 2007]

Page 25: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Summary Bimode Cascading ITTAGE (BCTAGE)

Adaptive Rehashing for Cascaded Predictor Uses one component for both polymorphic- and

monomorphic- branches Integrates multiple bimode components to improve the

accuracy Detects the workload characteristic dynamically and

modify the predictor configuration.

Improves the state-of-the-art branch predictor Effective use of the limited hardware resource

Page 26: Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor

Q & A