Complexity-Effec/ve Mul/core Cache Coherence MCC2012 - - PowerPoint PPT Presentation

complexity effec ve mul core cache coherence mcc2012
SMART_READER_LITE
LIVE PREVIEW

Complexity-Effec/ve Mul/core Cache Coherence MCC2012 - - PowerPoint PPT Presentation

Complexity-Effec/ve Mul/core Cache-Coherence Complexity-Effec/ve Mul/core Cache Coherence MCC2012 Stefanos Kaxiras & Alberto Ros 1. Ros &


slide-1
SLIDE 1

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

1 ¡

Complexity-­‑Effec/ve ¡Mul/core ¡ Cache ¡Coherence ¡ MCC2012 ¡

1 ¡

Stefanos ¡Kaxiras ¡& ¡Alberto ¡Ros ¡ ¡ ¡

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 1 ¡

  • 1. ¡Ros ¡& ¡Kaxiras, ¡"Complexity-­‑Effec/ve ¡Mul/core ¡Coherence” ¡ ¡PACT2012 ¡
  • 2. ¡Kaxiras ¡& ¡Ros ¡"Efficient, ¡Snoopless, ¡System-­‑On-­‑Chip ¡Coherence" ¡IEEE ¡System ¡on ¡Chip ¡

Conference ¡(SOCC) ¡2012 ¡ ¡ ¡

¡

slide-2
SLIDE 2

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

2 ¡

Coherence ¡

“For ¡any ¡given ¡memory ¡loca0on, ¡at ¡any ¡given ¡moment ¡ in ¡0me, ¡there ¡is ¡either ¡a ¡single ¡core ¡that ¡may ¡write ¡it ¡ (and ¡that ¡may ¡also ¡read ¡it) ¡or ¡some ¡number ¡of ¡cores ¡ that ¡may ¡read ¡it. ¡...” ¡Sorin, ¡Wood, ¡& ¡Hill ¡

  • But ¡what ¡does ¡it ¡mean? ¡
  • Protocols ¡react ¡immediately ¡to ¡any ¡write ¡to ¡kill ¡all ¡
  • ther ¡cached ¡copies ¡

– Source ¡of ¡significant ¡complexity ¡à ¡ ¡ ¡ ¡Directories, ¡snooping, ¡broadcasts, ¡… ¡

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 2 ¡

slide-3
SLIDE 3

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

3 ¡

Coherence ¡(cont.) ¡

  • Why? ¡

– Coherence ¡must ¡be ¡“invisible” ¡to ¡the ¡memory ¡consistency ¡ model ¡à ¡coherence ¡must ¡be ¡able ¡to ¡allow ¡SC ¡in ¡the ¡ presence ¡of ¡data ¡races! ¡

  • But ¡what ¡if ¡we ¡have ¡a ¡weak ¡consistency? ¡

– Provide ¡SC ¡for ¡DATA-­‑RACE-­‑FREE ¡(DRF) ¡programs ¡[Adve ¡& ¡ Hill] ¡

  • Significant ¡simplifica/ons ¡are ¡possible! ¡

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 3 ¡

Thread 1 Thread 0 Read Write Data time DATA RACE Thread 1 Synchronization Read Write Data time Thread 0 DATA RACE FREE

slide-4
SLIDE 4

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

4 ¡

Simplifying ¡Coherence ¡

  • Many ¡have ¡tried: ¡SARC ¡Coherence ¡(IEEE ¡Micro ¡’10), ¡

DeNovo ¡(PACT’11), ¡SWEL ¡(PACT’11), ¡… ¡

  • DRF ¡+ ¡mul/core ¡memory ¡hierarchy ¡(presence ¡of ¡a ¡

large ¡shared ¡last ¡level ¡cache) ¡

  • Simplest ¡MULTICORE ¡Coherence: ¡VIPS ¡class ¡of ¡

protocols ¡

– TRULLY: ¡Directoryless, ¡Broadcastless, ¡Snoopless, ¡ Invalida/onless ¡… ¡prac/cally ¡Costless ¡ – Beier ¡than ¡MESI ¡in ¡performance ¡and ¡power ¡ – Sweet ¡spot ¡in ¡the ¡design ¡space, ¡complexity, ¡prac/cality ¡ – Important ¡implica/ons ¡for ¡whole ¡system ¡design ¡

11/30/12 ¡ 4 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-5
SLIDE 5

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

5 ¡

Mo/va/on: ¡Why ¡Simplify? ¡

Directory/Snooping ¡Coherence ¡is ¡a ¡relic ¡of ¡NUMA/SMP ¡ systems ¡of ¡the ¡past ¡

  • Complexity: ¡

– Does ¡not ¡take ¡into ¡account ¡the ¡on-­‑chip ¡memory ¡hierarchy ¡(e.g., ¡ Owned ¡state ¡for ¡$-­‑2-­‑$) ¡à ¡SHARED ¡LLC ¡cache ¡ – Adheres ¡to ¡a ¡strict ¡coherence ¡defini/on ¡(SC ¡in ¡the ¡presence ¡of ¡ data ¡races) ¡which ¡may ¡not ¡be ¡needed ¡ – MESI ¡is ¡already ¡complex ¡(30+ ¡hidden ¡and ¡stable ¡states) ¡

  • any ¡new ¡op/miza/on ¡à ¡verify ¡from ¡scratch ¡
  • but ¡what ¡the ¡heck, ¡we ¡know ¡how ¡to ¡do ¡it ¡… ¡
  • Cost ¡(area ¡+ ¡power): ¡

– Directories, ¡indirec/on, ¡… ¡ – Snooping ¡on ¡busses, ¡dual ¡tags, ¡… ¡

11/30/12 ¡ 5 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-6
SLIDE 6

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

6 ¡

Mo/va/on: ¡Why ¡Simplify? ¡

  • Not ¡a ¡big ¡issue ¡for ¡few ¡fat ¡cores ¡… ¡
  • But: ¡a ¡new ¡class ¡of ¡manycores ¡with ¡many ¡simple ¡

cores: ¡GPUs, ¡accelerators, ¡… ¡

– Desire ¡to ¡make ¡them ¡coherent ¡with ¡GP ¡cores ¡on ¡the ¡same ¡ chip ¡(coherent ¡Shared ¡Virtual ¡Memory ¡– ¡cSVM) ¡ – Coherence ¡overhead ¡(area, ¡power) ¡is ¡a ¡big ¡issue ¡à ¡don’t ¡ want ¡to ¡pay ¡much ¡per ¡core ¡ – Coherence ¡is ¡sporadically ¡needed ¡à ¡why ¡pay ¡always? ¡

  • Simple ¡coherence ¡à ¡simple ¡memory ¡system ¡& ¡NoC ¡

11/30/12 ¡ 6 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-7
SLIDE 7

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

7 ¡

Roadmap ¡

  • Mo/va/on: ¡Why ¡Simplify? ¡
  • VIPS ¡ ¡
  • VIPS-­‑M ¡
  • Data ¡Races/Synchroniza/on ¡
  • Numbers ¡
  • Unique ¡proper/es ¡& ¡Implica/ons ¡
  • Conclusions ¡

11/30/12 ¡ 7 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-8
SLIDE 8

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

8 ¡

Simplifying ¡Coherence: ¡Write ¡Through ¡

  • Write-­‑through ¡protocols ¡are ¡simple ¡

– Only ¡Valid ¡and ¡Invalid ¡states ¡in ¡the ¡caches ¡ – BUT ¡they ¡are ¡terrible ¡because ¡of ¡many ¡write ¡misses ¡

  • Most ¡of ¡the ¡write ¡misses ¡due ¡to ¡private ¡data ¡(≈ ¡90%) ¡

¡

11/30/12 ¡ 8 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

Barnes Cholesky FFT FMM LU Ocean Radiosity Raytrace Volrend Water-Nsq Water-Sp Em3d Tomcatv Swaptions x264 Average 0.0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0 Percentage of write misses Private Shared

slide-9
SLIDE 9

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

9 ¡

VIPS ¡

  • Dynamic ¡write ¡policy ¡in ¡the ¡L1s ¡(private ¡caches, ¡in ¡

general) ¡based ¡on ¡a ¡classifica/on ¡of ¡data ¡to ¡Private/ Shared: ¡

  • Write-­‑back ¡(WB) ¡for ¡Private ¡lines ¡

– Simple ¡(no ¡coherence ¡required) ¡as ¡in ¡uniprocessors ¡ – Efficient: ¡no ¡extra ¡misses ¡ ¡

  • Write-­‑through ¡(WT) ¡for ¡Shared ¡lines ¡

– Simple ¡(only ¡two ¡states, ¡VI) ¡ ¡ – Efficient: ¡WT ¡à ¡coherence ¡misses ¡

  • VIPS: ¡Valid/Invalid ¡Private/Shared ¡ ¡

11/30/12 ¡ 9 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-10
SLIDE 10

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

10 ¡

Private/Shared ¡Classifica/on ¡

  • Classify ¡data ¡(cache ¡lines) ¡into ¡Private ¡and ¡Shared ¡

– Private ¡are ¡accessed ¡by ¡one ¡core ¡only ¡and ¡DO ¡NOT ¡NEED ¡ COHERENCE ¡ – Shared ¡are ¡(poten/ally) ¡accessed ¡by ¡more ¡than ¡one ¡core ¡ and ¡need ¡coherence ¡ – Not ¡a ¡temporal ¡classifica/on! ¡but ¡for ¡the ¡life ¡/me ¡of ¡the ¡ program ¡(think ¡of ¡variable ¡declara/on ¡as ¡private ¡or ¡ shared) ¡ – Several ¡ways ¡to ¡do ¡this ¡(we ¡know ¡of ¡6 ¡good ¡ones!) ¡but ¡ here ¡we ¡will ¡discuss ¡only ¡one: ¡

  • Page-­‑level ¡classifica/on ¡using ¡the ¡OS ¡and ¡the ¡TLBs ¡

11/30/12 ¡ 10 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-11
SLIDE 11

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

11 ¡

Private/Shared ¡Classifica/on ¡(cont.) ¡

  • Page-­‑level ¡classifica/on ¡by ¡the ¡OS: ¡

– Used ¡in ¡various ¡contexts ¡(Hardavellas ¡et ¡al., ¡ISCA’09, ¡ NUCA, ¡Cuesta ¡et ¡al., ¡ISCA’11, ¡directory ¡reduc/on) ¡

  • Technique: ¡

– Each ¡page ¡(PTE/TLB) ¡has ¡a ¡P/S ¡bit ¡ – The ¡first ¡access ¡of ¡a ¡page ¡by ¡a ¡core ¡sets ¡it ¡to ¡P ¡ – Subsequent ¡accesses ¡by ¡other ¡cores ¡set ¡it ¡to ¡S, ¡interrupt ¡ the ¡single ¡core ¡that ¡first ¡set ¡it ¡to ¡P ¡and ¡correct ¡it ¡

11/30/12 ¡ 11 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-12
SLIDE 12

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

12 ¡

Delayed ¡Write-­‑Throughs ¡ ¡

S/ll ¡some ¡write ¡misses ¡for ¡shared ¡blocks ¡(~28% ¡of ¡a ¡ full ¡WT ¡policy) ¡

  • Delay ¡WTs ¡to ¡coalesce ¡as ¡many ¡writes ¡as ¡possible ¡on ¡

the ¡same ¡cache ¡line ¡for ¡performance ¡

  • WTs ¡are ¡delayed ¡in ¡the ¡MSHRs ¡
  • End ¡result: ¡

MESI ¡WB ¡Traffic ¡ ¡~ ¡6.5% ¡of ¡FULL ¡WT ¡traffic ¡ VIPS ¡(Private ¡WB ¡+ ¡Shared ¡Delayed ¡WT) ¡~ ¡9% ¡of ¡FULL ¡WT ¡ traffic ¡ ¡

11/30/12 ¡ 12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-13
SLIDE 13

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

13 ¡

Delayed ¡Write ¡Thoughà ¡delay ¡& ¡coalesce ¡writes ¡

11/30/12 ¡ 13 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

Barnes Cholesky FFT FMM LU Ocean Radiosity Raytrace Volrend Water-Nsq Water-Sp Em3d Tomcatv Canneal x264 Average 0.0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 Normalized Write misses WT-shared WT-shared-delayed Write-back 0.52 0.71 0.63

Delayed ¡WTs ¡(cont.) ¡

slide-14
SLIDE 14

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

14 ¡

VIPS ¡Protocol ¡

  • Private ¡cache ¡lines ¡have ¡NO ¡coherence ¡

– Follow ¡a ¡Write_BACK ¡(WrB) ¡policy ¡ – Only ¡two ¡stable ¡states ¡V/I ¡ ¡

Read Write Replacement

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 14 ¡

slide-15
SLIDE 15

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

15 ¡

VIPS ¡Protocol ¡(cont.) ¡

  • Dynamic ¡Write ¡Policy ¡(+ ¡Delayed ¡WTs) ¡

– Directory ¡protocol, ¡BUT ¡only ¡two ¡stable ¡states ¡V/I ¡ – Reads ¡and ¡Writes ¡block ¡the ¡directory ¡(simplicity) ¡ – Wri/ng ¡(write ¡miss) ¡s/ll ¡Invalidates ¡other ¡readers ¡ – Write_throughs ¡are ¡delayed ¡(V* ¡state) ¡

No inval No R/W

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 15 ¡

slide-16
SLIDE 16

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

16 ¡

VIPS ¡Protocol ¡(cont.) ¡

  • Simplifies ¡the ¡protocol ¡to ¡just ¡two ¡states ¡(VI) ¡
  • Write-­‑throughs ¡eliminate ¡the ¡need ¡to ¡track ¡writers ¡

at ¡the ¡directory ¡

→ ¡Area ¡reduc/on ¡

  • No ¡indirec/on ¡for ¡read ¡misses ¡(performance ¡win) ¡

→ ¡Correct ¡shared ¡data ¡always ¡at ¡the ¡LLC ¡

  • Supports ¡sequen/al ¡consistency ¡

– Same ¡consistency ¡model ¡as ¡the ¡more ¡complex ¡MESI ¡

  • But ¡s/ll ¡… ¡invalida/ons ¡and ¡directory ¡blocking ¡L ¡

11/30/12 ¡ 16 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-17
SLIDE 17

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

17 ¡

VIPS-­‑M: ¡directorlyless/invalida/onless ¡

  • Self-­‑Invalida/on ¡(SI) ¡for ¡the ¡shared ¡data: ¡ ¡

– Selec/vely ¡Self-­‑Invalidate ¡shared ¡data ¡upon ¡synchroniza/on ¡ points ¡(fences, ¡atomic ¡instruc/ons, ¡LL/SC) ¡ – Eliminates ¡INVALIDATION ¡ – No ¡need ¡to ¡track ¡readers ¡anymore ¡à à ¡no ¡directory ¡ – BUT ¡is ¡only ¡compa/ble ¡with ¡Data-­‑Race-­‑Free ¡(DRF) ¡opera/on: ¡

  • ffers ¡SC ¡for ¡DRF ¡
  • SI ¡can ¡be ¡op/mized ¡to: ¡

– Exclude ¡read-­‑only ¡data ¡ ¡ – Specula/ve ¡use ¡the ¡self-­‑invalidated ¡data ¡and ¡verify ¡with ¡a ¡ reload ¡from ¡LLC ¡ ¡(Coherence ¡Decoupling, ¡Huh ¡et ¡al.,ASPLOS’04) ¡ à ¡no ¡latency ¡penalty ¡from ¡self-­‑invalida/ng ¡unchanged ¡data ¡

11/30/12 ¡ 17 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-18
SLIDE 18

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

18 ¡

VIPS-­‑M: ¡WT ¡Diffs ¡

  • SI ¡works ¡for ¡DRF ¡@ ¡cache-­‑line ¡granularity ¡

– Does ¡not ¡work ¡w/ ¡false ¡sharing ¡because ¡there ¡are ¡no ¡ invalida/ons ¡

  • Solved ¡by ¡Wri/ng ¡Through ¡DIFFs ¡

– Send ¡only ¡the ¡words ¡(or ¡bytes) ¡that ¡are ¡modified ¡ ¡ – Merge ¡them ¡in ¡the ¡LLC ¡à ¡Mul/ple ¡Writers ¡& ¡Merge ¡(–M) ¡

  • NO ¡NEED ¡for ¡per-­‑word(byte) ¡dirty ¡bits ¡for ¡the ¡cache! ¡

– Dirty ¡bits ¡are ¡only ¡needed ¡while ¡a ¡Delayed ¡WT ¡is ¡

  • utstanding ¡(V* ¡state) ¡ ¡

à ¡Delayed ¡WTs ¡& ¡dirty-­‑bits ¡exist ¡only ¡while ¡in ¡MSHRs ¡

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 18 ¡

slide-19
SLIDE 19

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

19 ¡

0 ¡ 1 ¡

Χ

VIPS-­‑M: ¡WT ¡Diffs ¡

  • SI ¡works ¡for ¡DRF ¡@ ¡cache-­‑line ¡granularity ¡

– Does ¡not ¡work ¡w/ ¡false ¡sharing ¡because ¡there ¡are ¡no ¡ invalida/ons ¡

0 ¡ 0 ¡ LLC L11 L10 0 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 0 ¡ False sharing on a cache line (DRF @ word but not @ cache-line)

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 19 ¡

slide-20
SLIDE 20

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

20 ¡

VIPS-­‑M: ¡WT ¡Diffs ¡

  • Solved ¡by ¡Wri/ng ¡Through ¡DIFFs ¡

– Send ¡only ¡the ¡words ¡(or ¡bytes) ¡that ¡are ¡modified ¡ ¡ – Merge ¡them ¡in ¡the ¡LLC ¡à ¡Mul/ple ¡Writers ¡& ¡Merge ¡(–M) ¡

0 ¡ 0 ¡ LLC L11 L10 0 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 0 ¡

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 20 ¡

DIFF DIFF

slide-21
SLIDE 21

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

21 ¡

VIPS-­‑M: ¡WT ¡Diffs ¡

  • SI ¡works ¡for ¡DRF ¡@ ¡cache-­‑line ¡granularity ¡

– Does ¡not ¡work ¡w/ ¡false ¡sharing ¡because ¡there ¡are ¡no ¡ invalida/ons ¡

  • Solved ¡by ¡Wri/ng ¡Through ¡DIFFs ¡

– Send ¡only ¡the ¡words ¡(or ¡bytes) ¡that ¡are ¡modified ¡ ¡ – Merge ¡them ¡in ¡the ¡LLC ¡à ¡Mul/ple ¡Writers ¡& ¡Merge ¡(–M) ¡

  • NO ¡NEED ¡for ¡per-­‑word(byte) ¡dirty ¡bits ¡for ¡the ¡cache! ¡

– Dirty ¡bits ¡are ¡only ¡needed ¡while ¡a ¡Delayed ¡WT ¡is ¡

  • utstanding ¡

à ¡Delayed ¡WTs ¡& ¡dirty-­‑bits ¡exist ¡only ¡while ¡in ¡MSHRs ¡

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 21 ¡

slide-22
SLIDE 22

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

22 ¡

  • Eliminate ¡invalida/ons/directory, ¡allow ¡mul/ple ¡

writers ¡à ¡magic ¡happens ¡

  • Shared ¡read/write ¡SAME ¡as ¡private ¡data ¡

– Only ¡difference ¡is ¡WHEN ¡are ¡put ¡back ¡in ¡the ¡LLC ¡

  • Private ¡data ¡à ¡on ¡replacement ¡(Write_BACK) ¡
  • Shared ¡data ¡à ¡on ¡writes ¡(Write_THROUGH) ¡

V PrW DIFF V

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 22 ¡

VIPS-­‑M: ¡Mul/ple-­‑Writer-­‑Merge ¡(cont.) ¡ ¡

slide-23
SLIDE 23

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

23 ¡

What ¡about ¡data ¡races? ¡

  • Private ¡& ¡DRF ¡data ¡OK. ¡What ¡about ¡synchroniza/on ¡

data ¡accessed ¡through ¡atomic ¡RMW ¡(Test&Set, ¡ Compare&Swap, ¡LL/SC, ¡etc.)? ¡

  • The ¡problem ¡is ¡that ¡readers ¡are ¡NOT ¡invalidated ¡

– Readers ¡never ¡“see” ¡a ¡new ¡write ¡(unless ¡they ¡get ¡flushed ¡from ¡ the ¡cache) ¡

  • A ¡synchroniza/on ¡(inten/onal) ¡data-­‑race ¡must ¡“see” ¡

new ¡writes: ¡

For ¡data ¡accessed ¡via ¡atomic ¡instruc/ons: ¡

  • 1. Do ¡not ¡create ¡an ¡L1 ¡copy ¡à ¡Go ¡directly ¡to ¡the ¡LLC ¡where ¡the ¡

Write_throughs ¡are ¡visible ¡

  • 2. For ¡atomic ¡RMW ¡block ¡the ¡LLC ¡line ¡un/l ¡the ¡write_through ¡

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 23 ¡

slide-24
SLIDE 24

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

24 ¡

Blocking in the LLC is finite: number of cores that can RMW simultaneously

Lock Acquired Lock Released Lock Acquired Lock Released

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 24 ¡

Synchroniza/on ¡(data ¡race) ¡protocol ¡

L1 Core0 L1 Core1 LLC

slide-25
SLIDE 25

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

25 ¡

Recap: ¡VIPS-­‑M ¡

  • Classify ¡data ¡(P/S), ¡Dynamic ¡write ¡policy: ¡Write-­‑

Through ¡for ¡Shared ¡Write-­‑Back ¡for ¡Private, ¡Selec/ve ¡ Self ¡Invalida/on, ¡Mul/ple-­‑Writers/Merge ¡

  • Provide ¡correct ¡memory ¡seman/cs ¡for ¡atomic ¡RMW ¡

& ¡synchroniza/on ¡(inten/onal) ¡data ¡races ¡ ¡

11/30/12 ¡ 25 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-26
SLIDE 26

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

26 ¡

Evalua/on ¡(does ¡it ¡work?) ¡

  • Simulated ¡a ¡16 ¡/led ¡mul/core ¡(16K-­‑64K, ¡8MB ¡L2, ¡

512K ¡/les), ¡SIMICS ¡GEMS ¡

– NoC ¡based ¡design ¡ – Also ¡have ¡Bus ¡results ¡

  • Automa/c ¡classifica/on ¡of ¡data ¡to ¡private, ¡shared ¡(& ¡

read-­‑only) ¡through ¡the ¡page ¡table/TLB ¡

– Page ¡granularity ¡(1 ¡word ¡shared ¡à ¡whole ¡page ¡shared) ¡ – One ¡way ¡only ¡(Priv. ¡à ¡Shared, ¡RO ¡à ¡W) ¡ – Beier ¡results ¡with ¡finer ¡grain ¡classifica/on ¡

11/30/12 ¡ 26 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 26 ¡

slide-27
SLIDE 27

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

27 ¡

Performance ¡Results ¡

  • VIPS-­‑M ¡beier ¡than ¡MESI ¡(~5%) ¡

11/30/12 ¡ 27 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 27 ¡

Barnes Cholesky FFT FMM LU Ocean Radiosity Raytrace Volrend Water-Nsq Water-Sp Em3d Tomcatv Canneal x264 Average 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 Normalized execution time Hammer Directory Write-through VIPS VIPS-M 2.83 2.42 2.85 2.19 2.13 2.12 2.21

faster writes (no write-misses), faster reads (no directory indirection), and less traffic in the NoC.

slide-28
SLIDE 28

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

28 ¡

Power ¡Results ¡

  • Power ¡for ¡LLC ¡& ¡NoC ¡
  • VIPS-­‑M ¡beier ¡than ¡MESI ¡(25%): ¡no ¡superfluous ¡

coherence ¡traffic, ¡no ¡directory ¡access, ¡WT ¡DIFFs ¡

11/30/12 ¡ 28 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 28 ¡

Barnes Cholesky FFT FMM LU Ocean Radiosity Raytrace Volrend Water-Nsq Water-Sp Em3d Tomcatv Canneal x264 Average 0.0 0.5 1.0 1.5 2.0 2.5 3.0 Normalized energy consumption LLC Network 8.3 5.3 4.2 5.0 8.8 22.9 5.1 15.5 9.6 56.2 3.3 7.0

  • 1. Hammer
  • 2. Directory
  • 3. Write-through
  • 4. VIPS
  • 5. VIPS-M
slide-29
SLIDE 29

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

29 ¡

VIPS ¡Unique ¡Proper/es ¡

  • VIPS-­‑M ¡à ¡Self-­‑Invalida/on ¡AND ¡Self-­‑Downgrade: ¡

– VIPS ¡coherence ¡is ¡truly ¡distributed. ¡Coherence ¡decisions ¡ are ¡taken ¡independently ¡without ¡any ¡inter-­‑core ¡ interac/on ¡à ¡Simplifies ¡whole ¡system ¡design ¡

  • Strictly ¡Request-­‑Response ¡from ¡the ¡L1s ¡to ¡the ¡LLC ¡

– No ¡requests ¡from ¡LCC ¡to ¡L1s ¡ – No ¡traffic ¡among ¡L1s ¡ – Only ¡L1àLLC ¡

  • Implica/ons ¡… ¡ ¡

11/30/12 ¡ 29 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-30
SLIDE 30

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

30 ¡

Implica/ons ¡

  • NOC ¡simplifica/on: ¡

– No ¡need ¡to ¡talk ¡to ¡other ¡nodes, ¡only ¡to ¡LLC ¡ – Simple ¡topologies: ¡cores ¡“around” ¡the ¡LLC, ¡fat ¡trees ¡with ¡ the ¡LLC ¡at ¡the ¡root, ¡… ¡

  • Seamless ¡scaling ¡to ¡Mul/ple ¡Buses ¡ ¡
  • Simplifies ¡all ¡aspects ¡of ¡the ¡memory ¡hierarchy, ¡e.g., ¡

NoC ¡or ¡virtual ¡caches ¡

11/30/12 ¡ 30 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-31
SLIDE 31

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

31 ¡

Mul/ple ¡Buses ¡

11/30/12 ¡ 31 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

C ¡ L1 ¡ C ¡ L1 ¡ C ¡ L1 ¡ C ¡ L1 ¡ Bus ¡ LLC ¡

slide-32
SLIDE 32

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

32 ¡

Mul/ple ¡Buses ¡(cont.) ¡

11/30/12 ¡ 32 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

C ¡ L1 ¡ C ¡ L1 ¡ C ¡ L1 ¡ C ¡ L1 ¡ Bus ¡ LL0 ¡ LL1 ¡ LL2 ¡ LL3 ¡ Bus ¡ Bus ¡ Bus ¡ Snooping on 4 buses ? à 5 tag arrays or à 5-ported tags … VIPS does not have Snooping … à Multiple buses for free! BW Bottleneck à Snooping Bottleneck

slide-33
SLIDE 33

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

33 ¡

Summary ¡

  • Simplest, ¡cost-­‑less ¡protocols, ¡exceeding ¡MESI: ¡

– VIPS: ¡Simpler ¡than ¡MESI, ¡directory ¡protocol, ¡SC ¡ – VIPS-­‑M: ¡directory-­‑less ¡(broadcast-­‑less/snoop-­‑less) ¡DRF ¡ – Support ¡for ¡synchroniza/on ¡(DR) ¡without ¡invalida/ons ¡ – On ¡a ¡NoC: ¡Eliminates ¡directories, ¡ ¡(coherent) ¡write ¡misses, ¡ Read ¡indirec/on ¡(always ¡find ¡correct ¡data ¡in ¡the ¡LLC) ¡ – On ¡a ¡bus: ¡Eliminates ¡all ¡snooping ¡

  • Significant ¡implica/ons ¡on ¡NoC, ¡Bus ¡and ¡VM ¡
  • A ¡la ¡Carte ¡Coherence: ¡there ¡when ¡you ¡need ¡it ¡

(mul/threaded ¡workloads); ¡gone ¡when ¡you ¡don’t ¡ (mul/programmed ¡workloads ¡or ¡message ¡passing) ¡

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 33 ¡

slide-34
SLIDE 34

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

34 ¡

Thank ¡you! ¡

11/30/12 ¡ 34 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-35
SLIDE 35

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

35 ¡

Memory ¡Consistency ¡Models ¡

¡

¡

Programs ¡ ¡

¡

Non-­‑DRF ¡ (data ¡races) ¡ DRF-­‑word ¡(Non-­‑DRF ¡ cache ¡line) ¡ DRF-­‑cache-­‑line ¡ VIPS ¡ SC, ¡ Coherent ¡ SC, ¡Coherent ¡ SC, ¡Coherent ¡ VIPS-­‑SF ¡ Incoherent ¡ Incoherent ¡ SC ¡for ¡ DRF_cache-­‑line ¡ VIPS-­‑M ¡ Incoherent ¡ SC ¡for ¡DRF_word ¡ SC ¡for ¡ DRF_cache-­‑line ¡ Synchroniza/on ¡ protocol ¡ SC, ¡ Coherent ¡ SC, ¡ Coherent ¡ SC, ¡ Coherent ¡

11/30/12 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡ 35 ¡

slide-36
SLIDE 36

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

36 ¡

Selec/ve ¡Flush ¡

Barnes Cholesky FFT FMM LU Ocean Radiosity Raytrace Volrend Water-Nsq Water-Sp Em3d Tomcatv Canneal x264 Average 0.0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0 Percentage of blocks Invalid Private Shared-Read-Only Shared-Written

11/30/12 ¡ 36 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-37
SLIDE 37

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

37 ¡

Misses ¡

11/30/12 ¡ 37 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

Barnes Cholesky FFT FMM LU Ocean Radiosity Raytrace Volrend Water-Nsq Water-Sp Em3d Tomcatv Canneal x264 Average 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 Cache miss classification Cold-cap-conf Coherence Selective-flushing Write-through 5.2 1.7

  • 1. Directory
  • 2. VIPS-M
slide-38
SLIDE 38

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

38 ¡

In ¡directory-­‑based ¡coherence: ¡

  • WT ¡eliminates ¡the ¡need ¡to ¡track ¡the ¡writer ¡@ ¡the ¡

directory ¡

– Correct ¡data ¡are ¡always ¡@ ¡the ¡LLC ¡

  • SF ¡eliminates ¡the ¡need ¡to ¡track ¡readers ¡@ ¡the ¡

directory ¡

– No ¡need ¡to ¡invalidate ¡anyone ¡ ¡

è ¡The ¡directory ¡is ¡gone ¡

(Data ¡classifica/on ¡is ¡handled ¡by ¡the ¡Page ¡Table ¡& ¡TLBs ¡so ¡no ¡ directory ¡is ¡needed) ¡

11/30/12 ¡ 38 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡

slide-39
SLIDE 39

Complexity-­‑Effec/ve ¡Mul/core ¡Cache-­‑Coherence ¡

39 ¡

In ¡snooping-­‑based ¡coherence: ¡

  • Data ¡classifica/on ¡+ ¡WT ¡eliminate ¡snoops ¡on ¡reads: ¡

– No ¡need ¡to ¡see ¡who ¡else ¡is ¡reading ¡to ¡determine ¡the ¡ degree ¡of ¡sharing ¡(S ¡state, ¡from ¡M,E) ¡ – No ¡need ¡to ¡see ¡who ¡is ¡reading ¡to ¡supply ¡it ¡the ¡data ¡ à ¡no ¡need ¡to ¡snoop ¡on ¡reads ¡

  • SF ¡eliminates ¡invalida/ons ¡ ¡à ¡no ¡need ¡to ¡snoop ¡on ¡

writes ¡ è ¡ ¡Snooping ¡is ¡gone ¡

11/30/12 ¡ 39 ¡ Uppsala ¡University/Uppsala ¡Innova/on ¡