Predic'ng Coherence Communica'on by Tracking Synchroniza'on - - PowerPoint PPT Presentation

predic ng coherence communica on
SMART_READER_LITE
LIVE PREVIEW

Predic'ng Coherence Communica'on by Tracking Synchroniza'on - - PowerPoint PPT Presentation

Predic'ng Coherence Communica'on by Tracking Synchroniza'on Points at Run Time Socrates Demetriades and Sangyeun Cho 45 th Interna+onal Symposium in


slide-1
SLIDE 1

Predic'ng ¡Coherence ¡Communica'on ¡ ¡ by ¡Tracking ¡Synchroniza'on ¡Points ¡at ¡Run ¡Time

Socrates ¡Demetriades ¡ ¡ and ¡Sangyeun ¡Cho ¡

45th ¡Interna+onal ¡Symposium ¡in ¡Microarchitecture, ¡December ¡2012 ¡

slide-2
SLIDE 2

Coherence ¡Communica+on ¡

¡The ¡result ¡of ¡data ¡sharing ¡between ¡threads, ¡when ¡those ¡run ¡on ¡ a ¡shared ¡memory ¡mul6processor ¡with ¡coherent ¡private ¡caches. ¡ ¡

slide-3
SLIDE 3

Coherence ¡Communica+on ¡

A A

Miss

  • Block ¡A ¡exclusive ¡to ¡T0 ¡
  • T13: ¡Request ¡to ¡share ¡A ¡
  • T13 ¡“communicates” ¡ ¡

with ¡T0. ¡

  • Block ¡A ¡is ¡copied ¡to ¡T13. ¡ ¡

[Shared ¡Memory ¡Model ¡/ ¡Write-­‑Invalidate ¡Coherence ¡Protocol] ¡

slide-4
SLIDE 4

Coherence ¡Communica+on ¡

  • Block ¡A ¡is ¡shared. ¡ ¡
  • T13: ¡Request ¡for ¡

exclusive ¡ownership. ¡ ¡

  • T13 ¡“communicates” ¡ ¡

with ¡T0 ¡& ¡T6. ¡

  • Invalidate ¡copies. ¡ ¡ ¡

A A A

Upgrade

Communica6ng ¡Misses: ¡all ¡request ¡that ¡must ¡communicate ¡with ¡ at ¡least ¡one ¡other ¡core. ¡ ¡

[Shared ¡Memory ¡Model ¡/ ¡Write-­‑Invalidate ¡Coherence ¡Protocol] ¡

slide-5
SLIDE 5

Directory-­‑based ¡ ¡ Coherence ¡Protocol ¡

A

Miss

Snoop-­‑based ¡ ¡ Coherence ¡Protocol ¡

A

Miss

Communica+on ¡Overheads ¡

5

A A

Indirect ¡Miss ¡to ¡the ¡Directory ¡ => ¡Increase ¡Miss ¡Latency ¡ Broadcast ¡to ¡all ¡ => ¡Increase ¡traffic ¡

A: T0

slide-6
SLIDE 6

Communica+on ¡Predic+on ¡

A A

Miss

A: T0

Predict

slide-7
SLIDE 7

Tradi+onal ¡Predic+on ¡Approaches ¡

  • 1. Simple ¡temporal-­‑based ¡predic+on. ¡
  • ­‑ ¡Locality ¡between ¡consecu+ve ¡misses. ¡ ¡ ¡ ¡
  • 2. ADDRESS-­‑based ¡predic+on. ¡
  • ­‑ ¡Locality ¡based ¡on ¡the ¡address ¡of ¡the ¡request. ¡ ¡
  • 3. INSTRUCTION-­‑based ¡predic+on. ¡
  • ­‑ ¡Locality ¡based ¡on ¡the ¡sta+c ¡store/load ¡instr. ¡ ¡

A

Miss

ADDR ¡ PREDICTOR ¡ A ¡ ¡ ¡ ¡ ¡ ¡[T0, ¡… ¡ ¡ ¡] ¡ PREDICTOR ¡ ¡ ¡ ¡ ¡[T0, ¡…] ¡ INST ¡ PREDICTOR ¡ {LD} ¡ ¡ ¡ ¡ ¡ ¡[T0, ¡…] ¡

¡# ¡access ¡addresses ¡ ¡ # ¡sta6c ¡LD/SRs ¡

slide-8
SLIDE 8

Contribu+on ¡of ¡this ¡Work ¡

Synchronization Point based Prediction (SP-prediction) Inter-thread communication caused by coherence transactions is tightly related with the synchronization points in parallel execution

  • Main Idea: Associate the communication behavior with

synchronization points and utilize this association to predict the destination of misses.

  • Main ¡Advantage: ¡Has ¡very ¡low ¡storage ¡cost, ¡yet ¡delivers ¡

rela+vely ¡high ¡performance. ¡ ¡

slide-9
SLIDE 9

Outline ¡

 Introduc+on ¡  Mo+va+on ¡& ¡Observa+ons ¡  SP-­‑Predic+on ¡  Evalua+on ¡  Conclusion ¡

9

slide-10
SLIDE 10

Core 1 Core 2 Core 3 Core 4

Why ¡Synchroniza+on ¡Points? ¡

SIGNAL BARRIER LOCK UNLOCK WAIT

¡[Pthread ¡nota+on] ¡

BARRIER

shared ¡data ¡ ¡ communica+on ¡direc+on ¡

slide-11
SLIDE 11

0 ¡ 50 ¡ 100 ¡ 150 ¡ 200 ¡ 250 ¡ 300 ¡ 350 ¡ 400 ¡

0 ¡ 1 ¡ 2 ¡ 3 ¡ 4 ¡ 5 ¡ 6 ¡ 7 ¡ 8 ¡ 9 ¡ 10 ¡ 11 ¡ 12 ¡ 13 ¡ 14 ¡ 15 ¡

0 ¡ 50 ¡ 100 ¡ 150 ¡ 200 ¡ 250 ¡ 300 ¡ 350 ¡ 400 ¡ 450 ¡ 500 ¡ 0 ¡ 1 ¡ 2 ¡ 3 ¡ 4 ¡ 5 ¡ 6 ¡ 7 ¡ 8 ¡ 9 ¡ 10 ¡ 11 ¡ 12 ¡ 13 ¡ 14 ¡ 15 ¡

Synchroniza+on ¡Epochs ¡

Communica+on ¡Distribu+on ¡of ¡Core ¡0 ¡ ¡(full ¡interval) ¡

Core 0

SYNC-POINT A SYNC-POINT B SYNC-POINT C SYNC-POINT E SYNC-POINT D

Des'na'on ¡Core ¡ID ¡ Sync-epoch A Sync-epoch B Sync-epoch C Sync-epoch D Des'na'on ¡Core ¡ID ¡

Communica+on ¡Distribu+on ¡of ¡Core ¡0 ¡ (different ¡sync-­‑epochs) ¡

# ¡contacts ¡

¡[Benchmark: ¡Bodytrack ¡/ ¡16-­‑threads] ¡

slide-12
SLIDE 12

0 ¡ 50 ¡ 100 ¡ 150 ¡

0 ¡ 1 ¡ 2 ¡ 3 ¡ 4 ¡ 5 ¡ 6 ¡ 7 ¡ 8 ¡ 9 ¡ 10 ¡ 11 ¡ 12 ¡ 13 ¡ 14 ¡ 15 ¡

Communica+on ¡Distribu+on ¡of ¡Core ¡0 ¡ ¡(same ¡sync-­‑epoch ¡in ¡different ¡dynamic ¡instances) ¡

# ¡contacts ¡

Sync-­‑Epoch ¡Dynamic ¡Instances ¡

¡[Benchmark: ¡Bodytrack ¡/ ¡16-­‑threads] ¡

Core 0

SYNC-POINT A SYNC-POINT B SYNC-POINT C SYNC-POINT E SYNC-POINT D

Core 0

A B A B A B A B

slide-13
SLIDE 13

Outline ¡

 Introduc+on ¡  Mo+va+on ¡& ¡Observa+ons ¡  SP-­‑Predic+on ¡  Evalua+on ¡  Conclusion ¡

13

slide-14
SLIDE 14

SP-­‑predic+on ¡– ¡Overview ¡

  • Monitor ¡des+na+ons ¡of ¡each ¡miss ¡on ¡each ¡core. ¡ ¡
  • Extract ¡communica+on ¡signatures ¡for ¡each ¡sync-­‑epoch. ¡ ¡
  • Store ¡and ¡later ¡reuse ¡those ¡signatures ¡to ¡predict ¡misses ¡in ¡future ¡

sync-­‑epoch ¡instances. ¡

  • When ¡ini+al ¡predic+ons ¡do ¡not ¡exist ¡or ¡are ¡inaccurate, ¡

reconstruct ¡the ¡signatures ¡within ¡the ¡sync-­‑epochs. ¡ ¡ ¡

  • Sync ¡Points ¡must ¡be ¡exposed ¡to ¡the ¡hardware ¡so ¡it ¡can ¡sense ¡the ¡

beginning ¡and ¡end ¡of ¡sync-­‑epochs. ¡ ¡

– A ¡dedicated ¡instruc+on ¡must ¡be ¡inserted ¡at ¡the ¡calling ¡loca+on ¡of ¡the ¡ synchroniza+on ¡point. ¡ ¡ – PC, ¡lock ¡variable ¡and ¡type ¡must ¡be ¡extracted ¡and ¡pass ¡to ¡a ¡history ¡table. ¡ ¡

slide-15
SLIDE 15

SP-­‑predic+on: ¡History-­‑based ¡ ¡

Track Communication Extract Hot Commun.Set

CORE 0

SYNC-POINT A SYNC-POINT B SYNC-POINT A SYNC-POINT B

Sync-­‑Point ¡PC ¡ PREDICTOR ¡

A [hot comm. set ]

C0 ¡ C1 ¡ C2 ¡ C3 ¡

[hot comm. set ] Store to SP-table SP-­‑TABLE ¡ A A Retrieve hot core set

Miss

SP-­‑TABLE ¡ [hot comm. set ]

slide-16
SLIDE 16

SP-­‑predic+on: ¡History-­‑based ¡(for ¡Locks) ¡

CORE 0

LOCK A UNLOCK B

LOCK ¡ADDR ¡ PREDICTOR ¡ A ¡ ¡[C0] ¡

Lock Acquire: Retrieve Predictor

LOCK A UNLOCK B

CORE 2

SP-­‑TABLE ¡ [C0] Lock Release: Store Core Id [C0]

slide-17
SLIDE 17

SP-­‑predic+on: ¡First ¡Sync-­‑Epoch ¡Instances ¡

CORE 0 SYNC-POINT A SYNC-POINT B

1st Instance

  • No ¡history ¡exists ¡for ¡this ¡point ¡(first ¡instance). ¡ ¡
  • Allow ¡some ¡warm-­‑up ¡+me ¡and ¡then ¡extract ¡an ¡ ¡

“early” ¡hot ¡communica+on ¡set. ¡

  • Use ¡the ¡set ¡as ¡a ¡predictor ¡for ¡the ¡rest ¡of ¡the ¡interval. ¡ ¡

Early Hot Set

Sync-­‑Point ¡PC ¡ PREDICTOR ¡

SP-­‑TABLE ¡

slide-18
SLIDE 18

SP-­‑predic+on: ¡Adap+ve ¡Recovery ¡

CORE 0 SYNC-POINT A SYNC-POINT B

  • Sync-­‑point ¡is ¡detected, ¡predictor ¡is ¡retrieved ¡from ¡SP-­‑table ¡
  • Start ¡using ¡predictor ¡for ¡each ¡miss, ¡with ¡high ¡confidence. ¡
  • If ¡predic+on ¡accuracy ¡drops ¡low, ¡extract ¡a ¡new ¡hot ¡

communica+on ¡set ¡on ¡the ¡spot. ¡

  • Con+nue ¡predic+ons ¡based ¡on ¡the ¡new ¡predictor. ¡ ¡ ¡

Retrieved Hot Set New hot set

Sync-­‑Point ¡PC ¡ PREDICTOR ¡ A ¡ ¡[hot ¡comm. ¡set ¡] ¡

Miss Miss

SP-­‑TABLE ¡

slide-19
SLIDE 19

Why ¡SP-­‑predic+on ¡

  • In ¡contrast ¡to ¡simple ¡temporal ¡predic+on, ¡it ¡exploits ¡applica+on-­‑

defined ¡interval-­‑based ¡communica+on ¡locali+es. ¡ ¡

– No ¡restricted ¡on ¡temporal ¡locality ¡among ¡consecu+ve ¡misses. ¡ ¡ – Can ¡adapts ¡faster ¡to ¡the ¡changes. ¡ – Can ¡recall ¡old ¡and ¡forgolen ¡communica+on ¡palerns. ¡ ¡ ¡

  • Compared ¡to ¡address ¡and ¡instruc+on ¡based ¡predic+on, ¡it ¡has ¡very ¡

low ¡storage ¡requirements. ¡

– SP ¡table ¡must ¡holds, ¡on ¡average ¡5-­‑30 ¡sta+c ¡sync ¡points ¡for ¡a ¡given ¡applica+on. ¡ ¡

  • Take ¡advantage ¡of ¡the ¡exis+ng ¡programming ¡paradigm ¡while ¡

being ¡transparent ¡to ¡the ¡programmer. ¡ ¡

slide-20
SLIDE 20

Outline ¡

 Introduc+on ¡  Mo+va+on ¡& ¡Observa+ons ¡  SP-­‑Predic+on ¡  Evalua+on ¡  Conclusion ¡

20

slide-21
SLIDE 21

Evalua+on ¡Methodology ¡

  • Workloads ¡

– From ¡Splash ¡2 ¡& ¡PARSEC ¡Suites. ¡ ¡ – # ¡sta+c ¡sync-­‑epochs: ¡ ¡5-­‑30 ¡ – # ¡dynamic ¡sync-­‑epochs: ¡ ¡22-­‑20,000 ¡ ¡(for ¡the ¡evaluated ¡input ¡sizes) ¡

  • SP-­‑predic+on ¡implemented ¡on ¡top ¡of ¡Baseline ¡Directory. ¡ ¡
  • Simulated ¡Machine ¡Configura+on ¡(based ¡on ¡simics) ¡

– In ¡order ¡core ¡ – Private ¡L1/L2 ¡ – DIR ¡slice. ¡ ¡ – Network ¡logic ¡ – Coherence ¡Logic ¡

slide-22
SLIDE 22

Results: ¡Predic+on ¡Accuracy ¡

76%

Average ¡ Des+na+on ¡Set ¡Size ¡(actual) ¡ 1.2 ¡ SP-­‑predic+on ¡Set ¡Size ¡ ¡ 2.6 ¡

slide-23
SLIDE 23

Results: ¡Latency ¡& ¡Bandwidth ¡ ¡

13% 18% (5%)

slide-24
SLIDE 24

Results: ¡Latency ¡& ¡Bandwidth ¡ ¡

13% 18% (5%)

Execu'on ¡Time ¡Improvements: ¡7% ¡on ¡average. ¡ ¡ Addi'onal ¡Energy ¡Dissipa'on: ¡~7% ¡(25% ¡NoC+Cache ¡lookups). ¡ (more ¡than ¡90% ¡lower ¡compared ¡to ¡broadcas'ng) ¡ ¡

slide-25
SLIDE 25

Comparison ¡with ¡other ¡Predictors ¡

0 ¡ 10 ¡ 20 ¡ 30 ¡ 40 ¡ 50 ¡ 60 ¡ 70 ¡ 80 ¡ 90 ¡ 100 ¡ 0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ % ¡inccuring ¡Indirec'on ¡ % ¡Addi'onal ¡Bandwidth ¡per ¡Miss ¡ Last ¡2 ¡misses ¡ ADDR-­‑based ¡ INSTR-­‑based ¡ SP-­‑predic+on ¡ DIRECTORY ¡

BEST POSITION

slide-26
SLIDE 26

Comparison ¡with ¡other ¡Predictors ¡

0 ¡ 10 ¡ 20 ¡ 30 ¡ 40 ¡ 50 ¡ 60 ¡ 70 ¡ 80 ¡ 90 ¡ 100 ¡ 0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ % ¡inccuring ¡Indirec'on ¡ % ¡Addi'onal ¡Bandwidth ¡per ¡Miss ¡ Last ¡2 ¡misses ¡ ADDR-­‑based ¡ INSTR-­‑based ¡ SP-­‑predic+on ¡ DIRECTORY ¡

INFINIT ¡ENTRIES ¡ ¡

PREDICTION ¡ ¡TABLE ¡ ¡STORAGE ¡

BEST POSITION

slide-27
SLIDE 27

0 ¡ 10 ¡ 20 ¡ 30 ¡ 40 ¡ 50 ¡ 60 ¡ 70 ¡ 80 ¡ 90 ¡ 100 ¡ 0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ % ¡inccuring ¡Indirec'on ¡ % ¡Addi'onal ¡Bandwidth ¡per ¡Miss ¡ Last ¡2 ¡misses ¡ ADDR-­‑based ¡ INSTR-­‑based ¡ SP-­‑predic+on ¡ DIRECTORY ¡

Comparison ¡with ¡other ¡Predictors ¡

512 ¡ ¡ENTRIES ¡ ¡

PREDICTION ¡ ¡TABLE ¡ ¡STORAGE ¡

BEST POSITION

slide-28
SLIDE 28

Conclusions ¡

  • SP-­‑predic+on ¡is ¡a ¡new, ¡run-­‑+me ¡and ¡applica+on-­‑driven ¡approach ¡
  • n ¡communica+on ¡predictability. ¡
  • Promotes ¡very ¡low ¡storage ¡requirements, ¡an ¡important ¡property ¡

for ¡emerging ¡CMP ¡implementa+ons. ¡ ¡

  • Scales ¡independent ¡of ¡core ¡count ¡and ¡cache ¡sizes. ¡ ¡
  • Takes ¡advantage ¡of ¡the ¡exis+ng ¡shared ¡memory ¡programming ¡ ¡

paradigm ¡and ¡current ¡consistency ¡models. ¡

slide-29
SLIDE 29

Thank ¡you ¡for ¡your ¡aaen'on! ¡ ¡

45th ¡Interna+onal ¡Symposium ¡in ¡Microarchitecture, ¡December ¡2012 ¡