Transcript ppt
Improving Multiple-CMP Systems with Token Coherence Mike Marty1, Jesse Bingham2, Mark Hill1, Alan Hu2, Milo Martin3, and David Wood1 1University of Wisconsin-Madison 2University of British Columbia 3University of Pennsylvania Thanks to Intel, NSERC, NSF, and Sun (C) 2005 Multifacet Project Summary • Microprocessor Chip Multiprocessor (CMP) • Symmetric Multiprocessor (SMP) Multiple CMPs • Problem: Coherence with Multiple CMPs • Old Solution: Hierarchical Protocol Complex & Slow • New Solution: Apply Token Coherence – Developed for glueless multiprocessor [ISCA 2003] – Keep: Flat for Correctness – Exploit: Hierarchical for performance • Less Complex & Faster than Hierarchical Directory Slide 2 Improving Multiple-CMP Systems using Token Coherence Outline • Motivation and Background – Coherence in Multiple-CMP Systems – Example: DirectoryCMP • Token Coherence: Flat for Correctness • Token Coherence: Hierarchical for Performance • Evaluation Slide 3 Improving Multiple-CMP Systems using Token Coherence Coherence in Multiple-CMP Systems • Chip Multiprocessors (CMPs) emerging • Larger systems will be built with Multiple CMPs P I P D I D P P I D I D interconnect L2 1 CMP L2 L2 CMP 2 L2 interconnect CMP 3 Slide 4 CMP 4 Improving Multiple-CMP Systems using Token Coherence Problem: Hierarchical Coherence • Intra-CMP protocol for coherence within CMP • Inter-CMP protocol for coherence between CMPs • Interactions between protocols increase complexity – explodes state space CMP 2 CMP 1 Inter-CMP Coherence interconnect Intra-CMP Coherence CMP 3 Slide 5 CMP 4 Improving Multiple-CMP Systems using Token Coherence Improving Multiple CMP Systems with Token Coherence • Token Coherence allows Multiple-CMP systems to be... – Flat for correctness, but – Hierarchical for performance Low Complexity Fast Correctness Substrate CMP 2 CMP 1 Performance Protocol interconnect CMP 3 Slide 6 CMP 4 Improving Multiple-CMP Systems using Token Coherence Example: DirectoryCMP 2-level MOESI Directory RACE CONDITIONS! CMP 0 CMP 1 Store B P0 P1 P2 P3 P4 P5 P6 P7 L1 I&D L1 I&D L1 I&D L1 I&D L1 I&D L1 I&D L1 I&D L1 I&D data/ fwd ack inv ack getx getx data/ ack S inv S WB ack inv ack Shared L2 / directory S getx data/ ack O S Shared L2 / directory WB fwd B: [M [S O] I] Memory/Directory Slide 7 getx Memory/Directory Improving Multiple-CMP Systems using Token Coherence Outline • Motivation and Background • Token Coherence: Flat for Correctness – Safety – Starvation Avoidance • Token Coherence: Hierarchical for Performance • Evaluation Slide 8 Improving Multiple-CMP Systems using Token Coherence Example: Token Coherence [ISCA 2003] Load B Store B P0 P1 L1 I&D L2 mem 0 • • • • Slide 9 L1 I&D L2 P2 L1 I&D L2 interconnect P3 L1 I&D L2 mem 3 Each memory block initialized with T tokens Tokens stored in memory, caches, & messages At least one token to read a block All tokens to write a block Improving Multiple-CMP Systems using Token Coherence Extending to Multiple-CMP System CMP 0 P0 L1 I&D CMP 1 P1 L1 I&D L2 L2 P2 L1 I&D L1 I&D L2 L2 interconnect interconnect Shared L2 mem 0 Slide 10 P3 Shared L2 interconnect mem 1 Improving Multiple-CMP Systems using Token Coherence Extending to Multiple-CMP System CMP 0 CMP 1 Store B P0 L1 I&D P1 P2 L1 I&D L1 I&D interconnect P3 L1 I&D interconnect Shared L2 Shared L2 mem 0 mem 1 interconnect • Token counting remains flat • Tokens to caches – Handles shared caches and other complex hierarchies Slide 11 Improving Multiple-CMP Systems using Token Coherence Starvation Avoidance CMP 0 GETX CMP 1 Store B Store B P0 P1 L1 I&D L1 I&D Store B GETX GETX P2 L1 I&D interconnect P3 L1 I&D interconnect Shared L2 Shared L2 mem 0 mem 1 interconnect • Tokens move freely in the system – Transient requests can miss in-flight tokens – Incorrect speculation, filters, prediction, etc Slide 12 Improving Multiple-CMP Systems using Token Coherence Starvation Avoidance CMP 0 CMP 1 Store B Store B Store B P0 P1 P2 L1 I&D L1 I&D L1 I&D interconnect P3 L1 I&D interconnect Shared L2 Shared L2 mem 0 mem 1 interconnect • Solution: issue Persistent Request – Heavyweight request guaranteed to succeed – Methods: Centralized [2003] and Distributed (New) Slide 13 Improving Multiple-CMP Systems using Token Coherence Old Scheme: Central Arbiter [2003] CMP 0 Store B CMP 1 timeout Store B P0 L1 I&D Store B timeout timeout P1 P2 L1 I&D L1 I&D interconnect L1 I&D interconnect Shared L2 arbiter 0 Shared L2 mem 0 B: P0 B: P2 B: P1 P3 mem 1 interconnect arbiter 0 – Processors issue persistent requests Slide 14 Improving Multiple-CMP Systems using Token Coherence Old Scheme: Central Arbiter [2003] CMP 0 CMP 1 Store B Store B Store B P0 P1 P2 B: P0 L1 I&D L1 I&D B: P0 B: P0 L1 I&D interconnect P3 L1 I&D B: P0 interconnect B: P0 Shared L2 Shared L2 B: P0 arbiter 0 mem 0 B: P0 B: P2 B: P1 mem 1 interconnect arbiter 0 – Processors issue persistent requests – Arbiter orders and broadcasts activate Slide 15 Improving Multiple-CMP Systems using Token Coherence Old Scheme: Central Arbiter [2003] CMP 0 CMP 1 Store B Store B P1 P2 P0 B: P2 P0 L1 I&D L1 I&D interconnect B: P2 P0 L1 I&D B: P0 P2 3 arbiter 0 L1 I&D Shared L2 B: P2 P0 2 mem 0 B: P0 B: P2 B: P1 B: P2 P0 interconnect B: P2 P0 Shared L2 1 P3 mem 1 interconnect arbiter 0 – Processor sends deactivate to arbiter – Arbiter broadcasts deactivate (and next activate) – Bottom Line: handoff is 3 message latencies Slide 16 Improving Multiple-CMP Systems using Token Coherence Improved Scheme: Distributed Arbitration [NEW] CMP 0 CMP 1 Store B Store B P0 P1 P0: B P1: B P2: B L1 I&D L1 I&D Store B P0: B P1: B P2: B P2 P0: B P1: B P2: B L1 I&D interconnect P3 L1 I&D interconnect P0: B Shared L2 P1: B P2: B P0: B P1: B P2: B Shared L2 mem 0 P0: B P1: B P2: B P0: B P1: B P2: B mem 1 interconnect – Processors broadcast persistent requests Slide 17 Improving Multiple-CMP Systems using Token Coherence Improved Scheme: Distributed Arbitration [NEW] CMP 0 CMP 1 Store B Store B P0 P1 P0: B P1: B P2: B L1 I&D L1 I&D Store B P0: B P1: B P2: B P2 P0: B P1: B P2: B L1 I&D interconnect P3 L1 I&D interconnect P0: B Shared L2 P1: B P2: B P0: B P1: B P2: B Shared L2 mem 0 P0: B P1: B P2: B P0: B P1: B P2: B mem 1 interconnect – Processors broadcast persistent requests – Fixed priority (processor number) Slide 18 Improving Multiple-CMP Systems using Token Coherence Improved Scheme: Distributed Arbitration [NEW] CMP 0 CMP 1 Store B P0 P0: B P1: B P2: B L1 I&D 1 P1 L1 I&D Store B P0: B P1: B P2: B P2 P0: B P1: B P2: B L1 I&D interconnect P3 L1 I&D interconnect P0: B Shared L2 P1: B P2: B P0: B P1: B P2: B Shared L2 mem 0 P0: B P1: B P2: B P0: B P1: B P2: B mem 1 interconnect – Processors broadcast persistent requests – Fixed priority (processor number) – Processors broadcast deactivate Slide 19 Improving Multiple-CMP Systems using Token Coherence Improved Scheme: Distributed Arbitration [NEW] CMP 0 P0 P1: B P2: B L1 I&D 1 CMP 1 P1 L1 I&D P1: B P2: B P2 P1: B P2: B L1 I&D interconnect P3 L1 I&D interconnect Shared L2 Shared L2 P1: B P2: B P1: B P2: B mem 0 P1: B P2: B P1: B P2: B mem 1 interconnect – Bottom line: Handoff is a single message latency • Subtle point: P0 and P1 must wait until next “wave” Slide 20 Improving Multiple-CMP Systems using Token Coherence Outline • Motivation and Background • Token Coherence: Flat for Correctness • Token Coherence: Hierarchical for Performance • Evaluation Slide 21 Improving Multiple-CMP Systems using Token Coherence Hierarchical for Performance: TokenCMP • Target System: – 2-8 CMPs – Private L1s, shared L2 per CMP – Any interconnect, but high-bandwidth • Performance Policy Goals: – – – – Slide 22 Aggressively acquire tokens Exploit on-chip locality and bandwidth Respect cache hierarchy Detecting and handling missed tokens Improving Multiple-CMP Systems using Token Coherence Hierarchical for Performance: TokenCMP • Approach: – On L1 miss, broadcast within own CMP • Local cache responds if possible – On L2 miss, broadcast to other CMPs – Appropriate L2 bank responds or broadcasts within its CMP • Optionally filter – Responses between CMPs carry extra tokens for future locality • Handling missed tokens: – Timeout after average memory latency – Invoke persistent request (no retries) • Slide 23 Larger systems can use filters, multicast, soft-state directories Improving Multiple-CMP Systems using Token Coherence Outline • Motivation and Background • Token Coherence: Flat for Correctness • Token Coherence: Hierarchical for Performance • Evaluation – Model checking – Performance w/ commercial workloads – Robustness Slide 24 Improving Multiple-CMP Systems using Token Coherence TokenCMP Evaluation • Simple? – Model checking • Fast? – Full-system simulation w/ commercial workloads • Robust? – Micro-benchmarks to simulate high contention Slide 25 Improving Multiple-CMP Systems using Token Coherence Complexity Evaluation with Model Checking • Methods: – TLA+ and TLC – DirectoryCMP omits all intra-CMP details – TokenCMP’s correctness substrate modeled • Result: – Complexity similar between TokenCMP and non-hierarchical DirectoryCMP – Correctness Substrate verified to be correct and deadlock-free • Small configuration, varied parameters – All possible performance protocols correct Slide 26 Improving Multiple-CMP Systems using Token Coherence Performance Evaluation • Target System: – 4 CMPs, 4 procs/cmp – 2GHz OoO SPARC, 8MB shared L2 per chip – Directly connected interconnect • Methods: Multifacet GEMS simulator – Simics augmented with timing models – Released soon: http://www.cs.wisc.edu/gems – ISCA 2005 Tutorial! • Benchmarks: – Performance: Apache, Spec, OLTP – Robustness: Locking uBenchmark Slide 27 Improving Multiple-CMP Systems using Token Coherence Full-system Simulation: Runtime – TokenCMP performs 9-50% faster than DirectoryCMP Slide 28 Improving Multiple-CMP Systems using Token Coherence Full-system Simulation: Runtime – TokenCMP performs 9-50% faster than DirectoryCMP DRAM Directory Perfect L2 Slide 29 Improving Multiple-CMP Systems using Token Coherence Full-system Simulation: Traffic – TokenCMP traffic is reasonable (or better) • DirectoryCMP control overhead greater than broadcast for small system Slide 30 Improving Multiple-CMP Systems using Token Coherence Performance Robustness Locking micro-benchmark (correctness substrate only) more contention Slide 31 less contention Improving Multiple-CMP Systems using Token Coherence Performance Robustness Locking micro-benchmark (correctness substrate only) more contention Slide 32 less contention Improving Multiple-CMP Systems using Token Coherence Performance Robustness Locking micro-benchmark more contention Slide 33 less contention Improving Multiple-CMP Systems using Token Coherence Summary • Microprocessor Chip Multiprocessor (CMP) • Symmetric Multiprocessor (SMP) Multiple CMPs • Problem: Coherence with Multiple CMPs • Old Solution: Hierarchical Protocol Complex & Slow • New Solution: Apply Token Coherence – Developed for glueless multiprocessor [2003] – Keep: Flat for Correctness – Exploit: Hierarchical for performance • Less Complex & Faster than Hierarchical Directory Slide 34 Improving Multiple-CMP Systems using Token Coherence Slide 35 Improving Multiple-CMP Systems using Token Coherence Full-system Simulation: Traffic Slide 36 Improving Multiple-CMP Systems using Token Coherence Full-system Simulation: Intra-CMP Traffic Slide 37 Improving Multiple-CMP Systems using Token Coherence