predic ng coherence communica on
play

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


  1. Predic'ng ¡Coherence ¡Communica'on ¡ ¡ by ¡Tracking ¡Synchroniza'on ¡Points ¡at ¡Run ¡Time � Socrates ¡Demetriades ¡ ¡ and ¡Sangyeun ¡Cho ¡ 45 th ¡Interna+onal ¡Symposium ¡in ¡Microarchitecture, ¡December ¡2012 ¡

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

  3. Coherence ¡Communica+on ¡ • Block ¡A ¡exclusive ¡to ¡T0 ¡ A • T13: ¡Request ¡to ¡share ¡A ¡ • T13 ¡“communicates” ¡ ¡ with ¡T0. ¡ • Block ¡A ¡is ¡copied ¡to ¡T13. ¡ ¡ A Miss [Shared ¡Memory ¡Model ¡/ ¡Write-­‑Invalidate ¡Coherence ¡Protocol] ¡

  4. Coherence ¡Communica+on ¡ • Block ¡A ¡is ¡shared. ¡ ¡ A • T13: ¡Request ¡for ¡ exclusive ¡ownership. ¡ ¡ A • T13 ¡“communicates” ¡ ¡ with ¡T0 ¡& ¡T6. ¡ • Invalidate ¡copies. ¡ ¡ ¡ A Upgrade Communica6ng ¡Misses : ¡all ¡request ¡that ¡must ¡communicate ¡with ¡ at ¡least ¡one ¡other ¡core. ¡ ¡ [Shared ¡Memory ¡Model ¡/ ¡Write-­‑Invalidate ¡Coherence ¡Protocol] ¡

  5. Communica+on ¡Overheads ¡ Directory-­‑based ¡ ¡ Snoop-­‑based ¡ ¡ Coherence ¡Protocol ¡ Coherence ¡Protocol ¡ A A A: T0 A A Miss Miss Indirect ¡Miss ¡to ¡the ¡Directory ¡ Broadcast ¡to ¡all ¡ => ¡Increase ¡Miss ¡Latency ¡ => ¡Increase ¡traffic ¡ 5

  6. Communica+on ¡Predic+on ¡ A A: T0 A Miss Predict

  7. Tradi+onal ¡Predic+on ¡Approaches ¡ 1. Simple ¡temporal-­‑based ¡predic+on. ¡ -­‑ ¡Locality ¡between ¡consecu+ve ¡misses. ¡ ¡ ¡ ¡ 2. ADDRESS-­‑based ¡predic+on. ¡ A -­‑ ¡Locality ¡based ¡on ¡the ¡address ¡of ¡the ¡request. ¡ ¡ 3. INSTRUCTION-­‑based ¡predic+on. ¡ -­‑ ¡Locality ¡based ¡on ¡the ¡sta+c ¡store/load ¡instr. ¡ ¡ ADDR ¡ PREDICTOR ¡ ¡# ¡access ¡addresses ¡ ¡ Miss INST ¡ PREDICTOR ¡ A ¡ ¡ ¡ ¡ ¡ ¡[T0, ¡… ¡ ¡ ¡] ¡ # ¡sta6c ¡LD/SRs ¡ {LD} ¡ ¡ ¡ ¡ ¡ ¡[T0, ¡…] ¡ PREDICTOR ¡ ¡ ¡ ¡ ¡[T0, ¡…] ¡

  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. ¡ ¡

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

  10. Why ¡Synchroniza+on ¡Points? ¡ UNLOCK BARRIER SIGNAL BARRIER LOCK Core 1 Core 2 Core 3 WAIT Core 4 shared ¡data ¡ ¡ communica+on ¡direc+on ¡ ¡[Pthread ¡nota+on] ¡

  11. Synchroniza+on ¡Epochs ¡ SYNC-POINT A SYNC-POINT B SYNC-POINT C SYNC-POINT D SYNC-POINT E Core 0 Sync-epoch Sync-epoch Sync-epoch Sync-epoch A B C D Communica+on ¡Distribu+on ¡of ¡Core ¡0 ¡ Communica+on ¡Distribu+on ¡of ¡Core ¡0 ¡ ¡(full ¡interval) ¡ (different ¡sync-­‑epochs) ¡ 400 ¡ 500 ¡ 450 ¡ 350 ¡ 400 ¡ 300 ¡ # ¡contacts ¡ 350 ¡ 300 ¡ 250 ¡ 250 ¡ 200 ¡ 200 ¡ 150 ¡ 150 ¡ 100 ¡ 100 ¡ 50 ¡ 50 ¡ 0 ¡ 0 ¡ 0 ¡ 1 ¡ 2 ¡ 3 ¡ 4 ¡ 0 ¡ 5 ¡ 1 ¡ 6 ¡ 2 ¡ 7 ¡ 3 ¡ 8 ¡ 4 ¡ 9 ¡ 10 ¡ 11 ¡ 12 ¡ 13 ¡ 14 ¡ 15 ¡ 5 ¡ 6 ¡ 7 ¡ 8 ¡ 9 ¡ 10 ¡ 11 ¡ 12 ¡ 13 ¡ Des'na'on ¡Core ¡ID ¡ 14 ¡ Des'na'on ¡Core ¡ID ¡ 15 ¡ ¡[Benchmark: ¡Bodytrack ¡/ ¡16-­‑threads] ¡

  12. Sync-­‑Epoch ¡Dynamic ¡Instances ¡ SYNC-POINT A SYNC-POINT B SYNC-POINT C SYNC-POINT D SYNC-POINT E Core 0 Communica+on ¡Distribu+on ¡of ¡Core ¡0 ¡ ¡(same ¡sync-­‑epoch ¡in ¡different ¡dynamic ¡instances) ¡ 150 ¡ # ¡contacts ¡ 100 ¡ 50 ¡ 0 ¡ 0 ¡ 1 ¡ 2 ¡ 3 ¡ 4 ¡ 5 ¡ 6 ¡ 7 ¡ 8 ¡ 9 ¡ A B A B A B A B 10 ¡ 11 ¡ 12 ¡ 13 ¡ 14 ¡ 15 ¡ Core 0 ¡[Benchmark: ¡Bodytrack ¡/ ¡16-­‑threads] ¡

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

  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. ¡ ¡

  15. SP-­‑predic+on: ¡History-­‑based ¡ ¡ SYNC-POINT A SYNC-POINT B SYNC-POINT A SYNC-POINT B CORE 0 Miss Track Communication [hot comm. set ] A C0 ¡ C1 ¡ C2 ¡ C3 ¡ Extract Hot Retrieve hot Commun.Set core set A [hot comm. set ] Store to SP-­‑TABLE ¡ SP-­‑TABLE ¡ SP-table Sync-­‑Point ¡PC ¡ PREDICTOR ¡ A [hot comm. set ]

  16. SP-­‑predic+on: ¡History-­‑based ¡(for ¡Locks) ¡ LOCK A UNLOCK B CORE 0 LOCK A UNLOCK B CORE 2 [C0] Lock Release: Store Core Id Lock Acquire: [C0] Retrieve Predictor SP-­‑TABLE ¡ LOCK ¡ADDR ¡ PREDICTOR ¡ A ¡ ¡[C0] ¡

  17. SP-­‑predic+on: ¡First ¡Sync-­‑Epoch ¡Instances ¡ SYNC-POINT A SYNC-POINT B CORE 0 SP-­‑TABLE ¡ 1 st Instance Sync-­‑Point ¡PC ¡ PREDICTOR ¡ Early Hot Set • 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. ¡ ¡

  18. SP-­‑predic+on: ¡Adap+ve ¡Recovery ¡ SYNC-POINT A SYNC-POINT B CORE 0 Miss Miss SP-­‑TABLE ¡ Retrieved Hot Set New hot set Sync-­‑Point ¡PC ¡ PREDICTOR ¡ A ¡ ¡[hot ¡comm. ¡set ¡] ¡ • 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. ¡ ¡ ¡

  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. ¡ ¡

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

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend