28
Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

Embed Size (px)

Citation preview

Page 1: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

Cooperative Caching forChip Multiprocessors

Jichuan Chang

Guri Sohi

University of Wisconsin-Madison

ISCA-33, June 2006

Page 2: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 2

Motivation

• Chip multiprocessors (CMPs) both require and enable innovative on-chip cache designs

• Two important demands for CMP caching– Capacity: reduce off-chip accesses

– Latency: reduce remote on-chip references

• Need to combine the strength of both private and shared cache designs

Page 3: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 3

Yet Another Hybrid CMP Cache - Why?

• Private cache based design– Lower latency and per-cache associativity– Lower cross-chip bandwidth requirement– Self-contained for resource management– Easier to support QoS, fairness, and priority

• Need a unified framework– Manage the aggregate on-chip cache resources

– Can be adopted by different coherence protocols

Page 4: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 4

CMP Cooperative Caching

• Form an aggregate global cache via cooperative private caches

– Use private caches to attract data for fast reuse– Share capacity through cooperative policies– Throttle cooperation to find an optimal sharing point

• Inspired by cooperative file/web caches– Similar latency tradeoff– Similar algorithms

P

L2

L1I L1DP

L2

L1I L1D

P

L2

L1I L1DP

L2

L1I L1D

Network

Page 5: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 5

Outline

• Introduction

• CMP Cooperative Caching

• Hardware Implementation

• Performance Evaluation

• Conclusion

Page 6: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 6

Policies to Reduce Off-chip Accesses

• Cooperation policies for capacity sharing– (1) Cache-to-cache transfers of clean data

– (2) Replication-aware replacement

– (3) Global replacement of inactive data

• Implemented by two unified techniques– Policies enforced by cache replacement/placement

– Information/data exchange supported by modifying the coherence protocol

Page 7: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 7

Policy (1) - Make use of all on-chip data

• Don’t go off-chip if on-chip (clean) data exist

• Beneficial and practical for CMPs– Peer cache is much closer than next-level storage

– Affordable implementations of “clean ownership”

• Important for all workloads– Multi-threaded: (mostly) read-only shared data

– Single-threaded: spill into peer caches for later reuse

Page 8: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 8

Policy (2) – Control replication

• Intuition – increase # of unique on-chip data

• Latency/capacity tradeoff– Evict singlets only when no replications exist

– Modify the default cache replacement policy

• “Spill” an evicted singlet into a peer cache– Can further reduce on-chip replication

– Randomly choose a recipient cache for spilling

“singlets”

Page 9: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 9

Policy (3) - Global cache management

• Approximate global-LRU replacement– Combine global spill/reuse history with local LRU

• Identify and replace globally inactive data– First become the LRU entry in the local cache– Set as MRU if spilled into a peer cache– Later become LRU entry again: evict globally

• 1-chance forwarding (1-Fwd)– Blocks can only be spilled once if not reused

Page 10: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 10

Cooperation Throttling

• Why throttling?– Further tradeoff between capacity/latency

• Two probabilities to help make decisions– Cooperation probability: control replication– Spill probability: throttle spilling

Shared Private

Cooperative CachingCC 100%

Policy (1)

CC 0%

Page 11: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 11

Outline

• Introduction

• CMP Cooperative Caching

• Hardware Implementation

• Performance Evaluation

• Conclusion

Page 12: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 12

Hardware Implementation

• Requirements– Information: singlet, spill/reuse history– Cache replacement policy– Coherence protocol: clean owner and spilling

• Can modify an existing implementation• Proposed implementation

– Central Coherence Engine (CCE)– On-chip directory by duplicating tag arrays

Page 13: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 13

Information and Data Exchange

• Singlet information– Directory detects and notifies the block owner

• Sharing of clean data– PUTS: notify directory of clean data replacement– Directory sends forward request to the first sharer

• Spilling– Currently implemented as a 2-step data transfer– Can be implemented as recipient-issued prefetch

Page 14: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 14

Outline

• Introduction

• CMP Cooperative Caching

• Hardware Implementation

• Performance Evaluation

• Conclusion

Page 15: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 15

Performance Evaluation

• Full system simulator– Modified GEMS Ruby to simulate memory hierarchy

– Simics MAI-based OoO processor simulator

• Workloads– Multithreaded commercial benchmarks (8-core)

• OLTP, Apache, JBB, Zeus

– Multiprogrammed SPEC2000 benchmarks (4-core)• 4 heterogeneous, 2 homogeneous

• Private / shared / cooperative schemes– Same total capacity/associativity

Page 16: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 16

Multithreaded Workloads - Throughput

• CC throttling - 0%, 30%, 70% and 100% • Ideal – Shared cache with local bank latency

70%

80%

90%

100%

110%

120%

130%

OLTP Apache JBB Zeus

No

rmal

ized

Per

form

ance

Private Shared CC 0% CC 30% CC 70% CC 100% Ideal

Page 17: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 17

Multithreaded Workloads - Avg. Latency

• Low off-chip miss rate• High hit ratio to local L2• Lower bandwidth needed than a shared cache

0%

20%

40%

60%

80%

100%

120%

140%

P S 0 3 7 C P S 0 3 7 C P S 0 3 7 C P S 0 3 7 C

OLTP Apache JBB Zeus

Me

mo

ry C

yc

le B

rea

kd

ow

n Off-chipRemote L2Local L2L1

Page 18: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 18

Multiprogrammed Workloads

0%

20%

40%

60%

80%

100%

120%

P S C

Mem

ory

Cyc

le B

reak

do

wn

L1Local L2Remote L2Off-chip

L1Local L2Remote L2Off-chip

0%

20%

40%

60%

80%

100%

120%

P S C

Mem

ory

Cyc

le B

reak

do

wn

80%

90%

100%

110%

120%

130%

Mix1 Mix2 Mix3 Mix4 Rate1 Rate2No

rmal

ized

Per

form

ance Private Shared CC Ideal

Page 19: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 19

Sensitivity - Varied Configurations

• In-order processor with blocking caches

Performance Normalized to Shared Cache

60%

70%

80%

90%

100%

110%

4H 41 42 8H 81 82

Hmean

CC-300CC-600Private-300Private-600

Page 20: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 20

Comparison with Victim Replication

SPECOMPSingle-

threaded

60%

80%

100%

120%

140%

160%

am

mp

ap

plu

ap

si

art

eq

ua

ke

fma

3d

mg

rid

sw

im

wu

pw

ise

gc

c

mc

f

pe

rlbm

k

vp

r

Hm

ea

n

Private Shared CC VR

60%

80%

100%

120%

OL

TP

Ap

ac

he

JB

B

Ze

us

Mix

1

Mix

2

Mix

3

Mix

4

Ra

te1

Ra

te2

Hm

ea

n

Private Shared CC VR

Page 21: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 21

•Speight et al. ISCA’05- Private caches- Writeback into peer caches

A Spectrum of Related Research

SharedCaches

PrivateCaches

Configurable/malleable Caches(Liu et al. HPCA’04, Huh et al. ICS’05, cache

partitioning proposals, etc)

Cooperative Caching

Best capacity Best latency

Hybrid Schemes(CMP-NUCA proposals, Victim replication,

Speight et al. ISCA’05, CMP-NuRAPID, Fast & Fair, synergistic caching, etc)

… …

Page 22: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 22

Conclusion

• CMP cooperative caching

– Exploit benefits of private cache based design

– Capacity sharing through explicit cooperation

– Cache replacement/placement policies

for replication control and global management

– Robust performance improvement

Thank you!

Page 23: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

Backup Slides

Page 24: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 24

Shared vs. Private Caches for CMP

• Shared cache – best capacity– No replication, dynamic capacity sharing

Shared Private

• Private cache – best latency– High local hit ratio, no interference from other cores

Duplication

Desired

• Need to combine the strengths of both

Page 25: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 25

CMP Caching Challenges/Opportunities

• Future hardware– More cores, limited on-chip cache capacity– On-chip wire-delay, costly off-chip accesses

• Future software– Diverse sharing patterns, working set sizes– Interference due to capacity sharing

• Opportunities– Freedom in designing on-chip structures/interfaces– High-bandwidth, low-latency on-chip communication

Page 26: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 26

Multi-cluster CMPs (Scalability)

PL1I L1D

L2

PL1IL1D

L2

L2 L2

L1 L1D L1L1DP P

CCE

PL1I L1D

L2

PL1IL1D

L2

L2 L2

L1 L1D L1L1DP P

CCE

PL1 L1D

L2

PL1L1D

L2

L2 L2

L1 L1D L1L1DP P

CCE

PL1 L1D

L2

PL1L1D

L2

L2 L2

L1 L1D L1L1DP P

CCE

Page 27: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 27

L1 TagArray

L2 TagArray

P1 P8

4-to-1mux

State vector gather

4-to-1mux

State vector

… …

… …

Central Coherence Engine (CCE)S

pilli

ngbu

ffer

Output queue

Input queue

Network

Network

DirectoryMemory

... ...

... ...

Page 28: Cooperative Caching for Chip Multiprocessors Jichuan Chang Guri Sohi University of Wisconsin-Madison ISCA-33, June 2006

CMP Cooperative Caching / ISCA 2006 28

Cache/Network Configurations

• Parameters– 128-byte block size; 300-cycle memory latency

– L1 I/D split caches: 32KB, 2-way, 2-cycle

– L2 caches: Sequential tag/data access, 15-cycle

– On-chip network: 5-cycle per-hop

• Configurations– 4-core: 2X2 mesh network

– 8-core: 3X3 or 4X2 mesh network

– Same total capacity/associativity for private/shared/cooperative caching schemes