software-defined memory hierarchies scalability and qos in

27
SOFTWARE-DEFINED MEMORY HIERARCHIES: SCALABILITY AND QOS IN THOUSAND-CORE SYSTEMS D ANIEL SANCHEZ MIT CSAIL IAP MEETING MAY 21, 2013

Upload: others

Post on 03-Feb-2022

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

SOFTWARE-DEFINED MEMORY HIERARCHIES:

SCALABILITY AND QOS IN THOUSAND-CORE SYSTEMS

DANIEL SANCHEZ

MIT CSAIL

IAP MEETING

MAY 21, 2013

Page 2: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Research Agenda 2

Lack of technology progress

Moore’s Law still alive

Power & frequency walls

Focus: General-purpose 1000-core heterogeneous systems

HW hard to scale, shared resources cause interference, no QoS

SW hard to scale, need pervasive parallelism

Approach:

Consider full SW-HW stack – Most crucial issues span the SW/HW boundary

Combine analytical models and experimentation to design analyzable components that provide performance guarantees

Architecture renaissance

Parallelism multicore

Specialization heterogeneity

Page 3: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Outline 3

Introduction

Software-Defined Memory Hierarchies

Jigsaw: Software-Defined Caches

Ubik: Strict QoS in Shared Datacenter Servers (brief)

Page 4: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Motivation

Current memory systems already limit system

performance and energy efficiency

64-bit FP op: ~1ns latency, ~20pJ energy

Shared cache access: ~10ns latency, ~1nJ energy

Off-chip DRAM access: ~100ns latency, ~30nJ energy

Heterogeneous/simple cores improve compute

performance & efficiency by 10-100x

Need similar improvement in the memory hierarchy!

Some promise: Emerging memory technologies (e.g., PCM)

~100x latency

~1000x energy

4

Page 5: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Conventional Memory Hierarchies

Cache-based hierarchies combine multiple memory technologies with different tradeoffs to emulate a large, fast, cheap, energy-efficient memory

L3 Cache

20MB

Main Memory

32GB

Core

L1I

32KB

L1D

32KB

L2

256KB

Fast SRAM, 4 cycles,

72GB/s, 40 pJ

Fast SRAM, 8 cycles,

48GB/s, 120 pJ

On-chip, dense SRAM,

distributed, 26-34 cycles,

192GB/s (24GB/s/core), 1 nJ

Core

L1I

32KB

L1D

32KB

L2

256KB

Off-chip, DRAM

150 cycles, 36GB/s, 30 nJ

8 OOO cores @ 2.6 GHz

Slow, high energy, low BW

Dense, cheap

Fast, low energy, high BW

Small, expensive

Few levels

Simple tradeoffs

5

Page 6: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Future: Deeper Hierarchies?

Deep, rigid hierarchies do not scale

L3 Cache

20MB

Main Memory

32GB

Core

L1I

32KB

L1D

32KB

L2

256KB

Core

L1I

32KB

L1D

32KB

L2

256KB

L3 cache

256MB

Main Memory

2TB

Core

L1I

32KB

L1D

32KB

L2

128KB

Fast SRAM, 3 cycles, 72GB/s

Fast SRAM, 6 cycles, 48GB/s

Off-chip, PCM

500 cycles, 100GB/s

L4 cache

1GB

L5 cache

32GB

Off-chip, DRAM, page cache

130 cycles, 200GB/s

Die-stacked, eDRAM

50 cycles, 500GB/s

On-chip, dense SRAM, distrib,

20-96 cycles, 2.4TB/s

Core

L1I

32KB

L1D

32KB

L2

128KB

… 1024 simple/heterogeneous

cores @ 2 GHz

Complex tradeoffs (lat, BW,

energy, reads vs writes)

Distributed caches blur the

notion of a level

Adding levels often hurts

performance and efficiency

Uncontrolled interference in

shared levels No QoS

2012

32nm

2020

11nm

?

6

Page 7: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Future: Deeper Hierarchies? 7

Deep, rigid hierarchies do not scale

Can we fix this in HW?

L3 cache

256MB

Main Memory

2TB

Core

L1I

32KB

L1D

32KB

L2

128KB

Fast SRAM, 3 cycles, 72GB/s

Fast SRAM, 6 cycles, 48GB/s

Off-chip, PCM

500 cycles, 100GB/s

L4 cache

1GB

L5 cache

32GB

Off-chip, DRAM, page cache

130 cycles, 200GB/s

Die-stacked, eDRAM

50 cycles, 500GB/s

On-chip, dense SRAM, distrib,

20-96 cycles, 2.4TB/s

Core

L1I

32KB

L1D

32KB

L2

128KB

… 1024 simple/heterogeneous

cores @ 2 GHz

Speculative next-level accesses

Non-Uniform Cache Access techniques

Hit/miss prediction

Complex, trade energy &

bandwidth for latency

Often require prediction,

pred state ~ O(size)

Best-effort, unpredictable

Must put SW

in the loop

Page 8: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Future: Back to Scratchpads? 8

We’ve tried this before…

Excessive programmer complexity

Hard to virtualize

Similar performance to (shallow)

cache-based hierarchies

[Leverich et al, ISCA07] Distributed SRAM mem,

64 banks, 4MB/bank

Main Memory

2TB

Core

L1I

32KB

L1D

32KB

L2

128KB

3D-stacked eDRAM mem,

32 banks, 32MB/bank

DRAM mem

8 banks, 4GB/bank

Core

L1I

32KB

L1D

32KB

L2

128KB

Page 9: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Outline 9

Introduction

Software-Defined Memory Hierarchies

Jigsaw: Software-Defined Caches

Ubik: Strict QoS in Shared Datacenter Servers

Page 10: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Software-Defined Memory Hierarchies

Goal: 10-100x memory system performance & efficiency

Insight: Software has much more semantic information

about how it uses memory than hardware

Approach: Instead of hiding performance and energy

tradeoffs, expose them to software efficiently

Idea: Expose a flat collection of on-chip and off-chip

caches and memories, and allow software to define

multiple logical cache and memory hierarchies over them

Explicit tradeoffs (latency, energy, bandwidth, capacity)

Implicit data placement and movement no programmer

burden

10

Page 11: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Software-Defined Hierarchy Example 11

Core

Core

Core

Core

Core

Core

Core

Core

Core

Core

Core

Core

Core

Core

Core

SDH SRAM

Bank

TSVs

Router

Dir

Bank

Core

16-core + 4MB L3 tile

64-tile die

(1024 cores)

3D-stacked

1GB eDRAM SDH banks

Off-chip

DRAM

Off-chip

PCM

8-core app

64-core app (thput)

OS code/data (global)

Page 12: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

SDH: Necessary Components

HW: Efficient memory components

Efficient caches (as close to scratchpads as possible)

Efficient cache virtualization

Scalable cache coherence (flat cannot leverage hierarchy!)

HW/SW: Efficient monitoring and reconfiguration

Converge to optimal configuration quickly, no trial-and-error

SW: Efficient runtimes

Scalable management algorithms

OS-level runtime: Global arbitration, no user-level changes

Application-level runtimes (e.g., Cilk, StreamIt, GRAMPS): Leverage high-level semantic information (e.g., producer-consumer) to provide further gains

12

Page 13: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Efficient Caches: ZCache

Conventional set-associative caches are far from ideal:

Reducing conflicts (higher associativity) more ways

High energy, latency, area overheads

Conflicts depend on workload’s access patterns

ZCache: A highly-associative cache with a small number of ways

Hits take a single lookup

In a miss, replacement process provides many replacement candidates

Provides cheap high associativity (e.g., associativity equivalent to 64 ways with a 4-way cache)

Achieves analytical guarantees on associativity

[MICRO 2010] “The ZCache: Decoupling Ways and Associativity”

Indexes

H0

H1

H2

Line

address

Way0 Way1 Way2

13

Page 14: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Efficient Cache Virtualization: Vantage

Leverage statistical guarantees of ZCache to design scalable partitioning

Hundreds of partitions per cache, defined at fine granularity (cache lines)

Strict guarantees on partition sizes and isolation

Extremely fast reconfigurations

Minimal overheads: 1.5% state for 64 partitions, negligible additional logic

[ISCA 2011] “Vantage: Scalable and Efficient Fine-Grain Cache Partitioning”

[Top Picks 2012] “Scalable and Efficient Fine-Grained Cache Partitioning with Vantage”

Worse than

unpartitioned

Better than

unpartitioned

Conventional techniques

hurt throughput, require

inefficient (64-way) caches

Vantage improves

throughput, uses an

efficient 4-way cache

14

Page 15: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Scalable Coherence: SCD

Scaling conventional directories is hard:

Excessive latency, energy, area overheads, or too complex

Introduce invalidations Interference

Insights:

Flexible sharer set encoding: Lines with few sharers use one entry, widely shared lines use multiple entries Scalability

Use ZCache Efficient high associativity, analytical models

Negligible invalidations with minimal overprovisioning (~10%)

SCD achieves scalability and performance guarantees

Area, energy grow with log(cores), constant latency

Simple: No modifications to coherence protocol

At 1024 cores, SCD is 13x smaller than a sparse directory, 2x smaller, faster and simpler than a hierarchical directory

[HPCA 2012] “SCD: A Scalable Coherence Directory with Flexible Sharer Set Encoding”

15

Page 16: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Outline 16

Introduction

Software-Defined Memory Hierarchies

Jigsaw: Software-Defined Caches

Ubik: Strict QoS in Shared Datacenter Servers

Page 17: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

First Prototype: Jigsaw

Apply basic SDH concepts to manage a last-level cache

16/64 1MB LLC banks, 64 partitions/bank

Software combines individual partitions to form shares (virtual caches)

e.g., a 512KB share for private data taking 50% of the local bank

e.g., a 2MB share for shared data spanning 25% of 8 banks

Latency vs capacity tradeoff fully exposed to SW

Tile Organization 16/64-tile CMP

Mem

/ IO

Mem / IO

Mem

/ I

O

Mem / IO

NoC (Mesh)

Tile

Jigsaw L3 Bank

NoC Router

Bank partitioning HW (Vantage)

Reconfig HW Monitoring HW

Core

STB

TLBs

L1I L1D

L2

17

[PACT 2013] “Jigsaw: Scalable Software-Defined Caches”, Beckmann and Sanchez (to appear)

Page 18: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Jigsaw Runtime

Can software manage distributed shared caches better than state-of-the-art HW schemes?

Prototype OS-level runtime:

Maps data (pages) to shares: Per-thread, per-process, global

Places & sizes shares across physical banks to co-optimize latency and miss rate

Monitors & reconfigures periodically (with HW support)

Required HW support:

Monitoring (based on distributed utility monitors)

Fast reconfiguration: Bulk page/selective bank invalidations

18

Page 19: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Jigsaw Example 19

2 8-thread apps

9 shares/app:

8 per-thread shares

1 per-process share

1 global share

19 shares total

App 1 App 2

Page 20: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Jigsaw Performance 20

140 16-app mixes on 16-

core CMP

Jigsaw outperforms:

LRU by 17% (max 2.1x)

R-NUCA by 12% (max 2.5x)

Vantage by 8% (max 42%)

Larger benefits with more

cores

Jigsaw

R-NUCA

Vantage

Page 21: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Jigsaw Performance Analysis 21

Runtime successfully co-optimizes latency and MPKI

Runtime overheads: 0.2% of system cycles

Required algorithmic innovation (non-convex opt, prior techniques 150x slower)

Large energy savings: Network traffic, off-chip accesses

L V R J L V R J L V R J L V R J L V R J L V R J

Page 22: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Jigsaw Summary & Future Work

Jigsaw: Preliminary small-scale prototype

Single-level software-define caches over distributed LLC

HW+OS-level runtime shows:

Can achieve large gains by exploiting SW information

Can achieve small overheads if HW&SW correctly co-designed

Now exploring:

Multi-level virtual hierarchies to exploit heterogeneous technologies & scale to1K-core systems

Application-level parallel runtimes that exploit SDH

HW and SW support for strict quality of service and isolation (e.g., co-schedule best-effort + hard real-time apps)

22

Page 23: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Outline 23

Introduction

Software-Defined Memory Hierarchies

Jigsaw: Software-Defined Caches

Ubik: Strict QoS in Shared Datacenter Servers

Page 24: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Motivation: QoS in Shared Multicores

Fundamental disconnect in systems community:

Apps increasingly interactive, with soft real-time reqs

Systems still designed using long-term average metrics

(IPC, QPS, fairness)

Utilization wall in cloud computing

IT: Semi-interactive (e.g., DSS) 14% avg

Server utilization histogram

[Meisner et al, ASPLOS 09 / anon HP client’s traces]

Web: Interactive (e.g., search) 7% avg

Conventional wisdom

Low utilization in multicores

is a fact of life, design

servers for 10% utilization

Current “solution”

Use a single app and one or

few cores per server to avoid

interference, or ignore QoS

Cloud apps need QoS

Page 25: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Ubik: Efficient Strict QoS In Shared Systems 25

Goal: High utilization under a mixed workload:

Latency-critical request-driven apps with probabilistic latency

bounds (e.g., 99th pct latency < 10ms)

Best-effort batch apps that need good average performance

Ubik: Rely on HW components with analytical guarantees

to allow safe fine-grained sharing between latency-

critical and best-effort apps

Tight lower bounds on performance degradation

Coordinated capacity and bandwidth management

Page 26: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

Conclusions

Need 10-100x mem performance and efficiency gains

Hiding tradeoffs from SW has run out of steam

Software-Defined Memory Hierarchies: Integrated

hardware-software memory management

Efficiently expose complex memory system tradeoffs to SW

Develop the right HW mechanisms and SW runtimes to

manage memory efficiently

Enable strict QoS in shared systems

Key enabling components developed, promising preliminary

results

26

Page 27: SOFTWARE-DEFINED MEMORY HIERARCHIES SCALABILITY AND QOS IN

THANKS FOR YOUR ATTENTION!

QUESTIONS?