37
HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun, Kevin Kai-Wei Chang, Lavanya Subramanian, Gabriel H. Loh, Onur Mutlu Proceedings of the 39th annual international symposium on Computer architecture (ISCA ’12), June 2012

HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

Embed Size (px)

Citation preview

Page 1: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

HIgh Performance Computing & Systems LAB

Staged Memory Scheduling: Achieving High Perfor-

mance and Scalability in Heterogeneous Systems

Rachata Ausavarungnirun, Kevin Kai-Wei Chang,

Lavanya Subramanian, Gabriel H. Loh, Onur Mutlu

Proceedings of the 39th annual international symposium

on Computer architecture (ISCA ’12), June 2012

Page 2: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 2

Outline

Motivation: CPU-GPU Systems Goal Observations Staged Memory Scheduling

1) Batch Formation2) Batch Scheduler3) DRAM Command Scheduler

Results Conclusion

Page 3: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 3

Memory Scheduling for CPU-GPU Systems Current and future systems integrate a GPU

along with multiple cores

GPU shares the main memory with the CPU cores

GPU is much more (4x-20x) memory-intensive than CPU

Page 4: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 4

Main Memory is a Bottleneck

All cores contend for limited off-chip bandwidth Inter-application interference degrades system performance The memory scheduler can help mitigate the problem

Memory Scheduler

Core 1

Core 2 Core 3 Core 4

To DRAM

Mem

ory

Request

Buf-

fer

ReqReq Req ReqReq Req

Req

DataData

Req Req

Page 5: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 5

Introducing the GPU into the System

GPU occupies a significant portion of the re-quest buffers Limits the MC’s visibility of the CPU applications’ differing

memory behavior can lead to a poor scheduling decision

Memory Scheduler

Core 1 Core 2 Core 3 Core 4

To DRAM

Req Req

GPU

Req Req Req Req Req ReqReq

Req ReqReqReq Req Req Req

Req ReqReq Req ReqReq Req

Req

Req

Page 6: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 6

Naïve Solution: Large Monolithic Buffer

Memory Scheduler

To DRAM

Core 1

Core 2

Core 3 Core 4

Req ReqReq Req Req Req Req Req

Req Req ReqReq Req ReqReqReq

Req ReqReqReq Req Req Req Req

Req Req ReqReq ReqReq Req Req

Req ReqReqReqReq Req Req Req

Req Req

GPU

Page 7: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 7

Problems with Large Monolithic Buffer

A large buffer requires more complicated logic to: Analyze memory requests (e.g., determine row buffer hits) Analyze application characteristics Assign and enforce priorities

This leads to high complexity, high power, large die area

Memory Scheduler

Req

Req

Req

Req

Req

Req Req

Req Req Req

Req

Req

Req

Req Req

Req Req

Req Req Req

Req

Req Req

Req

Req

Req

Req

Req

ReqReq

Req

Req

Req

Req

ReqReq ReqReq

Req Req

Req Req

More Complex Memory Scheduler

Page 8: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 8

Goal

Design a new memory scheduler that is: Scalable to accommodate a large number of requests Easy to implement Application-aware Able to provide high performance and fairness, especially in

heterogeneous CPU-GPU systems

Page 9: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 9

Outline

Motivation: CPU-GPU Systems Goal Observations Staged Memory Scheduling

1) Batch Formation2) Batch Scheduler3) DRAM Command Scheduler

Results Conclusion

Page 10: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 10

Key Functions of a Memory Con-troller Memory controller must consider three differ-

ent things concurrently when choosing the next request:

1) Maximize row buffer hits Maximize memory bandwidth

2) Manage contention between applications Maximize system throughput and fairness

3) Satisfy DRAM timing constraints

Current systems use a centralized memory con-troller design to accomplish these functions Complex, especially with large request buffers

Page 11: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 11

Key Idea: Decouple Tasks into Stages Idea: Decouple the functional tasks of the

memory controller Partition tasks across several simpler HW structures (stages)

1) Maximize row buffer hits Stage 1: Batch formation Within each application, groups requests to the same row

into batches

2) Manage contention between applications Stage 2: Batch scheduler Schedules batches from different applications

3) Satisfy DRAM timing constraints Stage 3: DRAM command scheduler Issues requests from the already-scheduled order to each

bank

Page 12: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 12

Outline

Motivation: CPU-GPU Systems Goal Observations Staged Memory Scheduling

1) Batch Formation2) Batch Scheduler3) DRAM Command Scheduler

Results Conclusion

Page 13: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 13

SMS: Staged Memory Scheduling

Memory Scheduler

Core 1 Core 2

Core 3

Core 4

To DRAM

GPU

Req

Req

Req

Req

Req

Req Req

Req Req Req

ReqReqReq

Req Req

Req Req

Req Req Req

Req

Req Req

Req

Req

Req

Req

Req Req

Req Req Req

ReqReqReqReq Req Req

Req

Req

Req ReqBatch Scheduler

Stage 1

Stage 2

Stage 3

Req

Monolit

hic

Sch

ed

ule

r

Batch Forma-tion

DRAM Com-mand Sched-uler

Bank 1 Bank 2 Bank 3 Bank 4

Page 14: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 14

SMS: Staged Memory Scheduling

Stage 1

Stage 2

Core 1

Core 2

Core 3

Core 4

To DRAM

GPU

Req ReqBatch Scheduler

Batch Forma-tion

Stage 3DRAM Com-mand Sched-uler

Bank 1 Bank 2 Bank 3 Bank 4

Page 15: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 15

Stage 1: Batch Formation

Goal: Maximize row buffer hits

At each core, we want to batch requests that access the same row within a limited time win-dow

A batch is ready to be scheduled under two conditions1) When the next request accesses a different row 2) When the time window for batch formation expires

Keep this stage simple by using per-core FIFOs

Page 16: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 16

Stage 1: Batch Formation Exam-ple

Core 1 Core 2 Core 3 Core 4

Row A Row BRow BRow C

Row DRow DRow ERow F

Row E

Batch Boundary

To Stage 2 (Batch Scheduling)

Row A

Time window expires

Next request goes to a different rowStage

1Batch Forma-tion

Page 17: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 17

SMS: Staged Memory Scheduling

Stage 1

Stage 2

Core 1

Core 2

Core 3

Core 4

To DRAM

GPU

Req ReqBatch Scheduler

Batch Forma-tion

Stage 3DRAM Com-mand Sched-uler

Bank 1 Bank 2 Bank 3 Bank 4

Page 18: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 18

Stage 2: Batch Scheduler

Goal: Minimize interference between applica-tions

Stage 1 forms batches within each application Stage 2 schedules batches from different ap-

plications Schedules the oldest batch from each application

Question: Which application’s batch should be scheduled next?

Goal: Maximize system performance and fair-ness To achieve this goal, the batch scheduler chooses between

two different policies

Page 19: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 19

Stage 2: Two Batch Scheduling Algo-rithms Shortest Job First (SJF)

Prioritize the applications with the fewest outstanding mem-ory requests because they make fast forward progress

Pro: Good system performance and fairness Con: GPU and memory-intensive applications get depriori-

tized

Round-Robin (RR) Prioritize the applications in a round-robin manner to ensure

that memory-intensive applications can make progress Pro: GPU and memory-intensive applications are treated

fairly Con: GPU and memory-intensive applications significantly

slow down others

Page 20: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 20

Stage 2: Batch Scheduling Policy

The importance of the GPU varies between sys-tems and over time Scheduling policy needs to adapt to this

Solution: Hybrid Policy At every cycle:

With probability p : Shortest Job First Benefits the CPU With probability 1-p : Round-Robin Benefits the GPU

System software can configure p based on the importance/weight of the GPU Higher GPU importance Lower p value

Page 21: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 21

SMS: Staged Memory Scheduling

Stage 1

Stage 2

Core 1

Core 2

Core 3

Core 4

To DRAM

GPU

Req ReqBatch Scheduler

Batch Forma-tion

Stage 3DRAM Com-mand Sched-uler

Bank 1 Bank 2 Bank 3 Bank 4

Page 22: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 22

Stage 3: DRAM Command Sched-uler High level policy decisions have already been

made by: Stage 1: Maintains row buffer locality Stage 2: Minimizes inter-application interference

Stage 3: No need for further scheduling Only goal: service requests while satisfying

DRAM timing constraints

Implemented as simple per-bank FIFO queues

Page 23: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 23

Putting Everything Together

Current BatchScheduling Pol-

icy

SJF

Current BatchScheduling Pol-

icy

RR

Batch Scheduler

Bank 1

Bank 2

Bank 3

Bank 4

Core 1 Core 2 Core 3 Core 4

Stage 1:Batch Formation

Stage 3: DRAM Command Scheduler

GPU

Stage 2:

Page 24: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 24

Complexity

Compared to a row hit first scheduler, SMS consumes* 66% less area 46% less static power

Reduction comes from: Monolithic scheduler stages of simpler schedulers Each stage has a simpler scheduler (considers fewer proper-

ties at a time to make the scheduling decision) Each stage has simpler buffers (FIFO instead of out-of-order) Each stage has a portion of the total buffer size (buffering is

distributed across stages)

* Based on a Verilog model using 180nm library

Page 25: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 25

Outline

Motivation: CPU-GPU Systems Goal Observations Staged Memory Scheduling

1) Batch Formation2) Batch Scheduler3) DRAM Command Scheduler

Results Conclusion

Page 26: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 26

Methodology

Simulation parameters 16 OoO CPU cores, 1 GPU modeling AMD Radeon™ 5870 DDR3-1600 DRAM 4 channels, 1 rank/channel, 8 banks/

channel

Workloads CPU: SPEC CPU 2006 GPU: Recent games and GPU benchmarks 7 workload categories based on the memory-intensity of CPU

applications Low memory-intensity (L) Medium memory-intensity (M) High memory-intensity (H)

Page 27: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 27

Comparison to Previous Scheduling Al-gorithms FR-FCFS

Prioritizes row buffer hits Maximizes DRAM throughput Low multi-core performance Application unaware

ATLAS Prioritizes latency-sensitive applications Good multi-core performance Low fairness Deprioritizes memory-intensive applications

TCM Clusters low and high-intensity applications and treats each

separately Good multi-core performance and fairness Not robust Misclassifies latency-sensitive applications

Page 28: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 28

Evaluation Metrics

CPU performance metric: Weighted speedup

GPU performance metric: Frame rate speedup

CPU-GPU system performance: CPU-GPU weighted speedup

Page 29: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 29

Evaluated System Scenarios

CPU-focused system

GPU-focused system

Page 30: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 30

Evaluated System Scenario: CPU Focused GPU has low weight (weight = 1)

Configure SMS such that p, SJF probability, is set to 0.9 Mostly uses SJF batch scheduling prioritizes latency-sensi-

tive applications (mainly CPU)

1

Page 31: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 31

Performance: CPU-Focused Sys-tem

SJF batch scheduling policy allows latency-sen-sitive applications to get serviced as fast as possible

L ML M HL HML HM H Avg0

2

4

6

8

10

12

FR-FCFSATLASTCMSMS_0.9

CG

WS

p=0.9

Workload Categories

Page 32: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 32

Evaluated System Scenario: GPU Fo-cused GPU has high weight (weight = 1000)

Configure SMS such that p, SJF probability, is set to 0 Always uses round-robin batch scheduling prioritizes mem-

ory-intensive applications (GPU)

1000

Page 33: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 33

Performance: GPU-Focused Sys-tem

Round-robin batch scheduling policy schedules GPU requests more frequently

L ML M HL HML HM H Avg0

200

400

600

800

1000

FR-FCFSATLASTCMSMS_0

CG

WS

p=0

Workload Categories

Page 34: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 34

Additional Results in the Paper

Fairness evaluation 47.6% improvement over the best previous algorithms

Individual CPU and GPU performance break-downs

CPU-only scenarios Competitive performance with previous algorithms

Scalability results SMS’ performance and fairness scales better than previous

algorithms as the number of cores and memory channels in-creases

Analysis of SMS design parameters

Page 35: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 35

Outline

Motivation: CPU-GPU Systems Goal Observations Staged Memory Scheduling

1) Batch Formation2) Batch Scheduler3) DRAM Command Scheduler

Results Conclusion

Page 36: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab 36

Conclusion

Observation: Heterogeneous CPU-GPU systems re-quire memory schedulers with large request buffers

Problem: Existing monolithic application-aware memory scheduler designs are hard to scale to large request buffer size

Solution: Staged Memory Scheduling (SMS) decomposes the memory controller into three simple stages:1) Batch formation: maintains row buffer locality2) Batch scheduler: reduces interference between applications3) DRAM command scheduler: issues requests to DRAM

Compared to state-of-the-art memory sched-ulers: SMS is significantly simpler and more scalable SMS provides higher performance and fairness

Page 37: HIgh Performance Computing & Systems LAB Staged Memory Scheduling: Achieving High Performance and Scalability in Heterogeneous Systems Rachata Ausavarungnirun,

High Performance Computing & Systems Lab

Thank you