Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microprocessor Arch. 김인식 - 인사

Similar presentations


Presentation on theme: "Microprocessor Arch. 김인식 - 인사"— Presentation transcript:

1 2015. 05. 12. Microprocessor Arch. 김인식 - 인사
Bias-Free Branch Predictor th annual IEEE/ACM Int. Symposium on Microarchitecture Dibakar Gope and Mikko H. Lipasti Microprocessor Arch. 김인식 - 인사 - 논문 소개 : 2014년도 47번째 IEEE/ACM 심포지엄에서 발표된 Bias Fee Branch Predictor에 관한 논문

2 INDEX Introduction Global History : Biased Branch vs non-Biased Branch
Bias-Free Branch Predictor - Filtering Biased Branch from the Global History - Biased Branch Detection : Branch Status Table - Filtering multiple instances from the global history - Positional History Bias-Free Neural Branch Predictor Bias-Free TAGE Branch Predictor 6. Bias-Free Branch Predictor –Experimental Results - 목차 소개 인트로덕션 - 브랜치프레딕션에 대한 기본적인 내용 설명 글로벌히스토리 - 바이어스된 브랜치와 바이어스 되지 않은 브랜치를 설명 다음은 바이어스브랜치프레딕터를 구현하기 위해 사용되는 매커니즘 들에 대해 설명 이렇게 만들어진 새로운 글로벌히스토리를 이용하여 기존의 브랜치프레딕터에 적용하기(뉴럴, 테이지) 이렇게 적용된 브랜치프레딕터의 실제 실험적 성능들

3 Introduction - Branch Prediction
- Bi-modal Branch Predictor - 인트로덕션: 브랜치 프레딕션 현재까지 브랜치 프레딕션이 발전되어온 과정을 되짚어봄 ->가장 간단한 방법으로는 바이모달 방식. 2bit의 saturation counter를 이용하여 Prediction state를 정의하고 이를 패턴히스토리테이블로 만들어 Branch의 주소 중 일부 bit을 사용하여 indexing. 주소의 일부 bit만을 사용하여 indexing 하는데는 한계가 있음 서로 다른 Branch가 같은 PHT에 Access하는 Aliasing 발생 -> 경우의 수를 늘려주어야 함

4 Introduction - Branch Prediction
- Two-level Adaptive Branch Predictor Only Local Branch History → No Inter-Branch Correlation info. -> 다음으로는 2-level adaptive BP. 각 브랜치의 local history를 저장하여 이를 이용해서 패턴히스토리테이블을 액세스.

5 Introduction - Branch Prediction
PredictionMiss Only Local Information + Inst. Address Access Aliasing -> 이 두가지 프레딕션 방식은 액세스 앨리어싱이 빈번하게 발생하고 브랜치간의 correlation을 반영하지 못해서 misprediction rate가 높음

6 Introduction - Branch Prediction
PredictionMiss Only Local Information + Inst. Address Access Aliasing Global Branch History -> 그래서 도입하게 된 것이 글로벌 히스토리. 실행되는 프로그램에서 최근의 일부 Branch에 대하여 T/NT 정보를 1bit씩 저장하고 있다면 현재 Branch를 Prediction할 때 이 히스토리를 사용하여 PHT를 인덱싱한다면 저장된 브랜치들의 T/NT여부에 따른 경우의 수를 모두 분류해낼 수 있음

7 Introduction - Branch Prediction
Global Branch History - Branch Correlation -> 이렇게 글로벌히스토리와 현재브랜치의 주소를 적절히 혼합하여 프레딕션하는 방식이 등장. (지셀렉트, 지셰어)

8 Introduction - Branch Prediction
The number of case (Table index ↑) > 결국 브랜치의 프레딕션은 PHT의 엔트리 수를 늘려서 최대한 많은 경우의 수를 저장하는 방법과

9 Introduction - Branch Prediction
The number of case (Table index ↑) Branch Correlation (Global History ↑) -> 글로벌히스토리를 길게 할당하여 최대한 많은 브랜치들의 Correlation을 반영하는 방법

10 Introduction - Branch Prediction
The number of case (Table index ↑) High Prediction Accuracy Branch Correlation (Global History ↑) -> 이 두가지에 의해 높은 정확도를 이루어 낼 수 있음. 테이블 Entry를 늘리는 방법보다는 각 브랜치들에 대한 Correlation을 최대한 반영하는 방법이 더 효율이 높으므로 GHR의 길이는 점점 길어지게 되었음 현재 Neural, TAGE BP의 경우 천개에서 이천개까지의 Grobal HIstory를 저장한다고 함

11 Global History : Biased vs non-Biased Branch
Path_1 Path_2 - 글로벌히스토리 바이어스된 브랜치와 바이어스되지 않은 브랜치에 대하여 -> 글로벌 히스토리가 만들어질때는 프로그램의 각 브랜치에 대하여 T/NT여부를 Shift Register에 한 bit씩 저장함 -> 프로그램내에 다음과 같은 브랜치들이 존재한다고 하면 A에서 E로 가는 Path는 총 2가지가 존재

12 Global History : Biased vs non-Biased Branch
→ Branch B, C, D is always Taken or Not Taken fixed Path_1 A : 1 C : 1 D : 0 E : 1 Path_2 A : 0 B : 1 E : 0 Path_1 Path_2 -> A는 Branch방향이 조건에 따라 달라지고 B,C,D의 경우는 항상 같은 방향으로 Branch. E는 Path에 따라 다르게 Branch.

13 Global History : Biased vs non-Biased Branch
→ Branch B, C, D is always Taken or Not Taken fixed Path_1 A : 1 C : 1 D : 0 E : 1 Path_2 A : 0 B : 1 E : 0 Path_1 Path_2 -> A는 Branch방향이 조건에 따라 달라지고 B,C,D의 경우는 항상 같은 방향으로 Branch. E는 Path에 따라 다르게 Branch.

14 Global History : Biased vs non-Biased Branch
→ Branch B, C, D is always Taken or Not Taken fixed Path_1 A : 1 C : 1 D : 0 E : 1 Path_2 A : 0 B : 1 E : 0 Path_1 Path_2 -> A는 Branch방향이 조건에 따라 달라지고 B,C,D의 경우는 항상 같은 방향으로 Branch. E는 Path에 따라 다르게 Branch. -> 이처럼 실행도중 Branch방향이 달라지는 것을 바이어스되지 않은 브랜치라 하고 언제나 실행방향이 정해진 브랜치를 바이어스된 브랜치라 함

15 Global History : Biased vs non-Biased Branch
Path_1 A : 1 C : 1 D : 0 E : 1 → Biased Branch is always Taken or Not Taken fixed → Branch E is rely on direction of Branch A only → Branch C, D, B contribute No Useful information Path_2 A : 0 B : 1 E : 0 -> 이처럼 실행도중 Branch방향이 달라지는 것을 바이어스되지 않은 브랜치라 하고 언제나 실행방향이 정해진 브랜치를 바이어스된 브랜치라 함 -> E의 Branch 방향은 결국 A에 의해 정해진 Path로 인해 결정되므로 바이어스된 브랜치 B,C,D의 T/NT여부는 그다지 중요한 정보가 아님

16 Global History : Biased vs non-Biased Branch
Path_1 A : 1 C : 1 D : 0 E : 1 → Biased Branch is always Taken or Not Taken fixed → Branch E is rely on direction of Branch A only → Branch C, D, B contribute No Useful information Path_2 A : 0 B : 1 E : 0 Don’t provide Any useful Info. -> E의 Branch 방향은 결국 A에 의해 정해진 Path로 인해 결정되므로 바이어스된 브랜치 B,C,D의 T/NT여부는 그다지 중요한 정보가 아님 -> B,C,D의 브랜치 히스토리는 글로벌히스토리에서 우리가 원하는 브랜치간의 Correlation 정보에 별 필요가 없는 data.

17 Global History : Biased vs non-Biased Branch

18 Bias-Free Branch Predictor
1. Filtering Biased Branch from the Global History - Bias-free BP Only tracks non-biased branch at runtime A X Y B Z B C Unfiltered GHR: - 바이어스프리 브랜치프레딕터 -> 바이어스프리브랜치프레딕터는 실행중에 이러한 Non biased, biased 브랜치를 결정하고 새로운 방식의 히스토리를 생성함

19 Bias-Free Branch Predictor
1. Filtering Biased Branch from the Global History - Bias-free BP Only tracks non-biased branch at runtime A X Y B Z B C Unfiltered GHR: → non-Biased Branch History → Decide the execute path → Affect the next Branch’s direction → Important bits for Branch Correlation -> 앞에서 말했듯이 바이어스되지 않은 브랜치는 프로그램의 실행경로와 다음 브랜치들의 실행에 영향을 미치므로 correlation정보에 없어서는 안됨

20 Bias-Free Branch Predictor
1. Filtering Biased Branch from the Global History - Bias-free BP Only tracks non-biased branch at runtime A X Y B Z B C Unfiltered GHR: → Biased Branch History → Always fixed by execute paths → Don’t contribute the number of cases -> 바이어스된 브랜치의 히스토리는 언제나 고정되어 있고 새로운 경우의 수를 만들어내지 못함

21 Bias-Free Branch Predictor
1. Filtering Biased Branch from the Global History - Bias-free BP Only tracks non-biased branch at runtime A X Y B Z B C Unfiltered GHR: A B B C Bias-Free GHR: -> 이를 없앤다면 더 효율적으로 많은 브랜치의 correlation정보를 히스토리 안에 담을 수 있을 것이고 효율적으로 공간을 사용할 수 있음

22 Bias-Free Branch Predictor
1. Filtering Biased Branch from the Global History - Bias-free BP Only tracks non-biased branch at runtime A X Y B Z B C Unfiltered GHR: A B B C Bias-Free GHR: → We can save 3 bits without any Correlation information Loss -> 이를 없앤다면 더 효율적으로 많은 브랜치의 correlation정보를 히스토리 안에 담을 수 있을 것이고 효율적으로 공간을 사용할 수 있음

23 Bias-Free Branch Predictor
2. Biased Branch Detection : Branch Status Table (B.S.T) - Encoding 4 possible states by F.S.M - B.S.T is direct mapped structure - Branch in middle state executes in opposite direction, it is non-bias branch -> 이 프레딕터가 브랜치의 바이어스 논바이어스를 결정하는 방법은 다음과 같음 2bit FSM을 통해 state를 할당 각 state는 처음 실행시 not found, 이후 T/NT 여부에 따라서 중간 State로 바뀌고 이후 해당 브랜치의 T/NT여부가 바뀌면 non-biased로 구분됨 이와 같은 2bit의 정보를 가진 테이블을 Branch Status Table이라 하고 이는 각각의 Branch에 direct mapping됨 All branches begin being considered as biased Branch Status Table (BST) Direct-mapped Tracks status

24 Bias-Free Branch Predictor
3. Filtering multiple instances from the global history A B C B A C B Non-Biased Branches : Unfiltered GHR : A B C Bias-Free GHR : 1 0 0 바이어스프리 브랜치프레딕터의 세번째 특징은 한 브랜치의 여러 인스턴스를 필터링하여 마지막 인스턴스의 상태만을 저장하는 것임 같은 Branch의 Prediction 정보가 여러 개 저장될 필요는 없음 이는 correlation에 이득을 주는 정보가 아님 오히려 마지막 실행에 대한 정보만을 저장하고 다른 많은 Branch들의 History에 저장하는 것이 프로그램 전체의 Correlation을 고려할 수 있어서 정확도 상승

25 Bias-Free Branch Predictor
3. Filtering multiple instances from the global history A B C B A C B Non-Biased Branches : Unfiltered GHR : A B C Bias-Free GHR : 1 0 0 - B.F.B.P only tracks the latest occurrence of a non-biased Branch 같은 Branch의 Prediction 정보가 여러 개 저장될 필요는 없음 이는 correlation에 이득을 주는 정보가 아님 오히려 마지막 실행에 대한 정보만을 저장하고 다른 많은 Branch들의 History에 저장하는 것이 프로그램 전체의 Correlation을 고려할 수 있어서 정확도 상승

26 Bias-Free Branch Predictor
3. Filtering multiple instances from the global history A B C B A C B Non-Biased Branches : Unfiltered GHR : A B C Bias-Free GHR : 1 0 0 - B.F.B.P only tracks the latest occurrence of a non-biased Branch - In order to save more distant branch correlation Info. 같은 Branch의 Prediction 정보가 여러 개 저장될 필요는 없음 이는 correlation에 이득을 주는 정보가 아님 오히려 마지막 실행에 대한 정보만을 저장하고 다른 많은 Branch들의 History에 저장하는 것이 프로그램 전체의 Correlation을 고려할 수 있어서 정확도 상승

27 Bias-Free Branch Predictor
3. Filtering multiple instances from the global history A B C B A C B Non-Biased Branches : Unfiltered GHR : A B C Bias-Free GHR : 1 0 0 - B.F.B.P only tracks the latest occurrence of a non-biased Branch - In order to save more distant branch correlation Info. - Minimize the footprint of GHR -> 바이어스프리 브랜치프레딕터의 세번째 특징은 한 브랜치의 여러 인스턴스를 필터링하여 마지막 인스턴스의 상태만을 저장하는 것임 다음과 같이 필터링 되기전의 바이어스되지 않은 브랜치글로벌히스토리가 존재. 여기서 각 브랜치가 여러번 실행되면서 저장된 정보들이 있는데 오직 마지막 정보만을 취하여 히스토리의 길이를 줄임 -> 각 브랜치의 프레딕션정보가 굳이 여러개 저장될 필요는 없음 다음에 실행될 브랜치에 대하여 Correlation 정보를 주는것은 마지막 실행 한번이면 족함 -> 마지막 실행에 대한 정보만을 저장하고 이전의 다른 많은 브랜치들의 히스토리를 저장하는것이 더 많은 브랜치간의 Correlation을 고려할 수 있으므로 프레딕션 정확도가 상승함

28 Bias-Free Branch Predictor
3. Filtering multiple instances from the global history - Recency Stack structure D Q PC 𝑥 =? PC 𝑛𝑏 PC 𝑦 PC 𝑧 h 𝑖𝑛 CLK -> 이를 위한 하드웨어 구현은 다음과 같음

29 Bias-Free Branch Predictor
3. Filtering multiple instances from the global history - Recency Stack structure D Q PC 𝑥 =? PC 𝑛𝑏 PC 𝑦 PC 𝑧 h 𝑖𝑛 CLK

30 Bias-Free Branch Predictor
3. Filtering multiple instances from the global history - Recency Stack structure D Q PC 𝑥 =? PC 𝑛𝑏 PC 𝑦 PC 𝑧 h 𝑖𝑛 CLK Hit! 같은 Branch의 Prediction 정보가 여러 개 저장될 필요는 없음 이는 correlation에 이득을 주는 정보가 아님 오히려 마지막 실행에 대한 정보만을 저장하고 다른 많은 Branch들의 History에 저장하는 것이 프로그램 전체의 Correlation을 고려할 수 있어서 정확도 상승

31 Bias-Free Branch Predictor
3. Filtering multiple instances from the global history - Recency Stack structure D Q PC 𝑥 =? PC 𝑛𝑏 PC 𝑦 PC 𝑧 h 𝑖𝑛 CLK Hit! Clock Gated → hold bit shifting

32 Bias-Free Branch Predictor
3. Filtering multiple instances from the global history - Recency Stack structure D Q PC 𝑥 =? PC 𝑛𝑏 PC 𝑦 PC 𝑧 h 𝑖𝑛 CLK Hit! Clock Gated → hold bit shifting

33 Bias-Free Branch Predictor
3. Filtering multiple instances from the global history - Recency Stack structure D Q PC 𝑥 =? PC 𝑛𝑏 PC 𝑦 PC 𝑧 h 𝑖𝑛 CLK PCnb 에 일치하는 entry 없으면 보통 shift register와 같이 행동함 -> 마지막 엔트리는 저절로 새로 들어오는 PC의 정보로 대체

34 Bias-Free Branch Predictor
4. Positional History if (Some Condition) / / Branch A array [ 10 ] = 1; for ( i = 0 ; i < 100 ; i ++) / / Branch L { if ( array [ i ] == 1 ) { } / / Branch X -> 100 instances } - Only one instance of Branch X(when i is 10) is correlate with Branch A - Branch X is classified to Biased Branch until [i==10] - Non-biased branch includes its Positional History - Positional history conveys the distance of non-biased branch in the past history Positional history 에는 해당 Branch들 사이에 Counting된 Branch의 수가 저장되는 것이 아닐런지. - 포지셔널 히스토리 -> 다음과 같은 코드에서 브랜치x는 100개의 인스턴스 중 오로지 i=10일때의 인스턴스만이 브랜치A와 Correlation을 가짐 이 때 어쩔 수 없이 미스프레딕션이 발생하게 되는데 이전의 Branch히스토리는 최근에 실행된 모든 인스턴스의 정보를 저장하므로 이후 구별이 가능하지만 BF_GHR은 오로지 마지막 실행에 대한 정보 1bit만을 가지므로 이 후에도 똑같이 mispredition할 수 밖에 없음 그리하여 각 브렌치마다 이전 브랜치와 현재브랜치사이에 얼마나 많은 브랜치가 있는지를 저장하는 포지셔널 히스토리가 존재 ->위와같은 상황 구별가능

35 Bias-Free Neural Branch Predictor
Q PC 𝑥 =? PC 𝑛𝑏 PC 𝑦 PC 𝑧 h 𝑖𝑛 CLK 기존의 Neural Branch Predictor의 Global History 를 BF-GHR로 대체. 각 Branch 사이의 가중치를 matrix로 만들어 현재 History와의 Correlation 값을 연산해서 Branch Prediction을 하는 만큼 Aliasing을 줄이기 위해서는 긴 Global histor가 필요. 이때 Correlation정보는 유지하면서 H/W 크기를 크게 줄일 수 있는 BF-GHR로 대체하면 H/W area나 전력소모 측면에서 이득을 볼 수 있음 -그러나 짧은 거리에서 다른 Branch와의 Correlation이 적고 한 방향으로 강하게 Bias된 Branch의 Prediction에는 굉장히 취약(positional history 쪽 내용 참고) -> 해결책으로 최근 몇 개의 Branch에 대해서는 Bias된 Branch의 History도 저장하여 기존의 방식과 새로운 방식을 혼합 -

36 Bias-Free TAGE Branch Predictor
TAgged Geometric Branch Predictor 여러 개의 BranchPredictor가 매우 긴 Global History Register의 한정된 Bit를 이용하여 Prediction. 이 때 각 Predictor가 이용하는 History bit의 수는 기하급수형태를 띄고 있어서 tagged geometric. - 여러 개의 Branch Predictor가 존재하는 만큼 상당히 많은 Table을 보유하고 있어서 H/W area를 매우 많이 차지하고 전력소모 또한 심함 - 상업용 프로세서에서 이는 큰 문제가 될 수 있음 - GHR을 이용한 Tag 접근방식을 수정하여 BF-GHR로써 Tag접근 및 Branch Prediction. 기존의 15개 Tag Table을 10개로 줄여 거의 비슷한 성능을 유지하면서도 H/W area와 전력소모를 훨씬 줄일 수 있음 기존 Global history를 겹치지 않게 나누어(이 때 segment 크기는 Geometric) 각 segment마다 non-biased branch를 filtering 하는 Segmented RS를 배치 각 Rs의 크기는 Segment의 크기에 관계없이 L로 고정. 약 2000개에 가까운 Global history를 150~200개의 BF-history로 압축 가능 이렇게 생성된 BF-History를 hashing하여 Tag Table접근.

37 Bias-Free Branch Predictor – Experimental Results
- OH-SNAP average 2.63 / BF Neural : 2.49 / TAGE : MPKI - BF-Neural improves the accuracy by 5.32% 1000개의 Inst. 당 Oh-snap은 평균 2.63개의 misprediction, BF_Neural 은 2.49개, TAGE는 2.445개의 Misprediction을 보임 OH-SNAP방식보다 월등히 좋고 TAGE와 비등한 성능을 나타내면서도 기존 Neural Predictor보다 H/W area가 작음

38 Bias-Free Branch Predictor – Experimental Results
- MPKI Comparison for Different Number of Tables. 더 작은 Table을 가지면서도 좋은 성능을 낼 수 있는 것은 기존의 Global history보다 현재의 BF_GH가 더 많은 경우의 수를 생성해 낼 수 있기 때문 Bias branch의 bit을 없앰으로써 더 먼 Branch 사이의 Correlation 정보를 Prediction에 반영할 수 있게 되기 때문

39 Bias-Free Branch Predictor – Experimental Results
- MPKI Comparison for Different Number of Tables. - MPKI of BF-TAGE with 7 tagged table is 2.57/ ISL-TAGE is 2.73 ※ Both use 70-history Bit to index 7’th table → BF GHR can offer much richer context Poor performance of 10 table -> 10 tagged Table의 경우 SPEC07, MM5에서 퍼포먼스 저하 발생

40 Bias-Free Branch Predictor – Experimental Results
- TAGE achieves best accuracy using 15 tagged tables. - ARM’s Cortex-A15, branch predictor accounts for 12 − 15% of all core energy. - It is important to implement smaller TAGE with few Tables - BF-TAGE with 10 tagged tables matches the accuracy of TAGE with 15 tagged tables. → It is suitable choice for embedded, mobile Processors SERV 에서 많이 위축되는 모습은 SERV가 많은 Biased Branch를 포함하고 있기 때문 FP1과 MM5 역시 마찬가지 이유 Biased Branch가 많을 경우 BF_GHR의 내용을 채워 넣기 힘들어짐?

41 Thank you.


Download ppt "Microprocessor Arch. 김인식 - 인사"

Similar presentations


Ads by Google