the graphite multicore simulator - mit...

36
Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller, George Kurian http://graphite.csail.mit.edu/

Upload: others

Post on 15-Mar-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Welcome to the Graphite Simulator Tutorial

Today’s presenters:

Jason E Miller, George Kurian

http://graphite.csail.mit.edu/

Page 2: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

What is Graphite?

• Fast, scalable multicore/manycore simulator and framework – Designed for 100’s to 1000’s of cores – Modular with swappable models for major components – Parallel, distributed simulation

• Works with standard pthread applications – 13 SPLASH-2 benchmarks (tested up to 1024 cores) – 6 Parsec 2.0 benchmarks – UHPC Challenge Apps: Dynamic Graph, Streaming Sensor – OpenMP apps OK (e.g., freqmine from Parsec)

• Widespread interest and adoption – Other groups at MIT, Univ. of New Mexico, Ghent Univ., Freescale

Semiconductor, Intel-MIPT Lab (Moscow), Intel PAR group

2

Page 3: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Today’s Schedule

• 11:00 Intro/Overview • 12:00 Lunch/Discussion • 1:00 Graphite Internals • 2:00 Model Details • 2:30 Power Modeling • 2:40 Miscellaneous

– Known Issues – Work-in-progress – List of web resources (where to get more info)

• 3:00 Questions and open discussion • 4:30 Adjourn

3

Page 4: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Graphite Introduction and Overview

Goals, Architecture, and Performance

4

Page 5: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

The Future of Multicore

• Computing has moved aggressively to multicore

• Up to 100 cores available this year

• 1000-core chips by 2016, if trends continue

Time

#Cores

1

2010

2

4

64

2016

?

2008

1000 cores

2006 2004 2002

8

16

32

128

MIT Raw

Sun UltraSparc T2

IBM PowerXCell 8i

Intel SSC

5

Page 6: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Simulation in Multicore Research

• Simulation is vital for exploring future architectures – Experiment with new designs/technologies – Abstract away details and focus on key elements – Rapid exploration of design space – Early software development for upcoming architectures

• The future of multicore simulation: – Need to simulate 100’s to 1000’s of cores – Massive quantities of computation – High-level architecture is becoming more important than

microarchitecture • On-chip networks, Memory hierarchies, DRAM access, Cache

coherence

6

Page 7: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Graphite At-a-Glance • A fast, high-level simulator for large-

scale multicores

• Application-level simulation where threads are mapped to target cores

• Runs in parallel on multicore host machines

• Multi-machine distribution – Leverage add’l compute and memory – Invisible to application – Runs off-the-shelf pthread apps

• Relaxed synchronization scheme – Trades some timing accuracy for

performance – Guarantees functional correctness

Host Machines

core core core core core core

core core core core core core

Target Multicore

Application

7

Page 8: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Graphite Performance

• Typical slowdown for existing sequential simulators: 10,000x – 100,000x

• Results from SPLASH2 benchmarks on a 32-core target processor

Min 41x

Max 3930x

Median 616x

8

Graphite slowdown on 8 host machines (64 cores total) versus native execution on one 8-core machine

Page 9: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Graphite Trades Accuracy for Performance

• Simulator performance is a major limiting factor – Limits depth and breath of studies, size of benchmarks – Too much detail slows simulation – Cannot simulate 1000’s of cores – Most simulators are sequential, Graphite is parallel – Typical performance: 10,000x – 100,000x slowdown – Our target performance: 100x

• Performance vs. accuracy – Cycle-accurate: very accurate but slow – High-level: trade some accuracy for performance – For next year’s chips, you need cycle-accuracy – For chips 5-10 years out, you need performance

9

Page 10: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Outline

• Introduction

• Graphite Architecture

– Overview

– Multi-machine distribution

– Clock Synchronization

• Results

• Conclusions

10

Page 11: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Graphite Overview

• Application-level simulator based on dynamic binary translation – Uses Intel’s Pin – App runs natively except for new features and modeled events – On trap, model functionality and timing

• Simulation consists of running an application on a target architecture – Target specified by swappable models and runtime parameters

• Different architectures • Accuracy vs. Performance

– Result: • Application output • Simulated time to completion • Statistics about processor events

11

Page 12: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Graphite Architecture

• Application threads mapped to target cores – On trap, use correct

target core’s models

• Target cores are

distributed among host processes

• Processes can be distributed to multiple host machines

Target Architecture

Target

Core

Target

Core

Target

Core

Target

Core

Target

Core

Target

Core

Target

Core

Target

Core

Target

Core

Graphite

Host Threads

Application Threads

Application

Host

Core

Host

Core

Host

Core

Host

Core

Host

Core

Host

Core

Host

Process

Host OS Host OS

Host

Process Host

Process

Host

Machines

12

Page 13: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Simulated Target Architecture

• Swappable models for processor, network, and memory hierarchy components – Explore different architectures – Trade accuracy for performance

• Cores may be homogeneous or heterogeneous

Target

Core

Interconnection Network

DRAM

Target

Core

Target

Core

Processor

Core

Network

Switch

Cache

Hierarchy

DRAM

Controller

13

Page 14: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Key Simulator Components

Physical Transport

Host Machine

MCP LCP

Target

Core

Target

Core

Target

Core

Target

Core

Host Machine

LCP

Target

Core

Target

Core

Target

Core

Target

Core

Host Machine

LCP

Target

Core

Target

Core

Target

Core

Target

Core

14

Application Thread

Messaging API

Memory System

Target Network Model

Transport Layer

Page 15: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Communication Stack

15

Application Thread

Messaging API

Memory System

Target Network Model

Transport Layer

Target Core • Graphite implements a layered

communication stack. • The application thread

communicates with other threads via messages. – Graphite messaging API – Simulated shared memory

• Messages are routed and timed by target architecture network model.

• Transport layer delivers messages to destination target core. – Host shared memory (same host

process) – TCP/IP (different host processes)

Page 16: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Outline

• Introduction

• Graphite Architecture

– Overview

– Multi-machine distribution

– Clock Synchronization

• Results

• Conclusions

16

Page 17: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Parallel Distribution Challenges

• Wanted support for standard pthreads model

– Allows use of off-the-shelf apps

– Simulate coherent-shared-memory architectures

• Must provide the illusion that all threads are running in a single process on a single machine

– Single shared address space

– Thread spawning

– System calls

17

Page 18: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Single Shared Address Space

• All application threads run in a single simulated address space

• Memory subsystem provides modeling as well as functionality

• Functionality implemented as part of the target memory models

– Eliminate redundant work

– Test correctness of memory models

Host Address Space

Host Address Space

Host Address Space

Simulated Address Space

Application

18

Page 19: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Thread Distribution

• Graphite runs application threads across several host machines

• Must initialize each host process correctly

• Threads are automatically distributed by trapping threading calls

Host Machines

core core core core core core

core core core core core core

Target Multicore

Application

19

Page 20: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

System Calls

• Three kinds of system calls need to be handled specially

– System calls that pass memory operands to the kernel

– System calls that implement synchronization/communication between threads

– System calls that deal with allocating and deallocating dynamic memory

• Other system calls can simply be allowed to fall through

20

Page 21: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Outline

• Introduction

• Graphite Architecture

– Overview

– Multi-machine distribution

– Clock Synchronization

• Results

• Conclusions

21

Page 22: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Clock Synchronization

• Cores only interact through messages

• Clocks are updated with message timestamps

Core 1 Core 2

Message Message

22

Page 23: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Clock Synchronization

• Threads may run at different speeds, causing clocks to deviate – Clocks are only used for timing, functional correctness is

always preserved – Must be synchronized on explicit interaction – Clocks may differ on implicit interaction timing inaccuracy

• Define synchronization as managing the skew of different target core clocks. – This is not application synchronization!

• Graphite supports three synchronization schemes with different accuracy and performance tradeoffs

23

Page 24: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Synchronization Schemes

• Lax – Relies exclusively on application synchronization events to

synchronize tiles’ local clocks – Functionally, events may occur out-of-order w.r.t. simulated time – Best performance; worst accuracy

• LaxP2P – Observation: Timing inaccuracy is due to a few outliers – Every N cycles, each target core randomly pairs with another – If cycles differ by too much, ‘future core’ goes to sleep – Good performance; good accuracy

• LaxBar – Every N cycles, all target cores wait on a barrier – Keeps cores tightly synchronized, imitates cycle-accuracy – Worst performance; best accuracy

24

Page 25: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Example Simulation (Lax)

Real time

Sim

ula

ted

tim

e

Lax

Application Synchronization Point

App Exit

Core 1

Core 2

Core 3

25

Page 26: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Example Simulation (LaxP2P)

Application Synchronization Point

LaxP2P Lax

P2P Check

P2P Check

P2P Check

Real time

Sim

ula

ted

tim

e

App Exit

Zzzz Zzzz

Zzzz

26

Page 27: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Example Simulation (LaxBar)

Application Synchronization Point

LaxBar Lax LaxP2P

Barrier

Barrier

Barrier

Real time

Sim

ula

ted

tim

e

App Exit

27

Page 28: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Clock Skew Measurements

• Graphs show clock skew for each scheme using the fmm benchmark – Clock skew is the spread between minimum and maximum clocks at any given point

– Note: Spikes on graphs due to errors in measurement method

• Lax has largest skew (~2,000,000 cycles) – Application synchronization events are clearly visible

– Fine-grain thread interactions can be missed or misrepresented

• Lax P2P has much lower skew (~30,000 cycles) – Application synchronization events slightly visible

• LaxBar has low, constant skew (~4000 cycles)

Lax LaxP2P LaxBar

Loca

l clo

ck v

alu

e

28

Page 29: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Outline

• Introduction

• Graphite Architecture

• Results

– Experimental methodology

– Simulator performance and scaling

– Synchronization scheme comparison

• Conclusions

29

Page 30: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

1024-Core Simulation

• Matrix-multiply kernel running on 1024-core target • Simulator speed-up almost linear

– 3.85x going from 1 to 10 host machines 30

Page 31: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Experimental Methodology

• Target Architecture:

• SPLASH-2 benchmark suite

• All experimental results collected on 8-core Xeon host machines running Linux

Feature Value

Number of cores 32

L1 caches Private, 32 kB per tile

L2 caches Private, 3 MB per tile

Cache coherence scheme Full-map directory based

Interconnection Network 2-D mesh

31

Page 32: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Performance Scaling

sin

gle

m

ach

ine

m

ult

i-m

ach

ine

• Graphite scales if the application scales • Even non-ideal speedup still reduces latency and design

iteration time 32

Page 33: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Performance Summary

• Sequential simulator slowdown is unacceptable • Slowdown versus native execution as low as 41x

– Would continue to drop with larger targets and more hosts

• Simulator overhead depends heavily on application characteristics

• Still more room for optimization

Slowdown over native execution on 8 cores

Sequential (1 core) 1 host* (8 cores) 8 hosts* (64 cores)

Min 580x 94x 41x

Max 17,459x 4007x 3930x

Mean 8,027x 1751x 1213x

Median 6,940x 1307x 616x

* Host machines are 8-core servers

33

Page 34: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Lax Synchronization Results

LaxBar on 1 host machine

Mean

- Benchmark

Std

. Dev

.

Performance

Dev

iati

on

(%

)

34

Page 35: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

LaxP2P vs Cycle-Level

-20

-15

-10

-5

0

5

10

15D

evi

atio

n (

%)

• Cycle-Level mode simulates all architectural models on a cycle-by-cycle basis – Models exact contention delay

• LaxP2P is only 6.4% off from cycle-level

Page 36: The Graphite Multicore Simulator - MIT CSAILgroups.csail.mit.edu/carbon/.../07/...and_overview.pdf · Welcome to the Graphite Simulator Tutorial Today’s presenters: Jason E Miller,

Summary

• Graphite accelerates multicore simulation using multi-machine parallel distribution – Enables simulation of 1000’s of cores – Invisible to application, runs off-the-shelf pthread apps

• Graphite provides fast, scalable performance – As little as 41x slowdown vs. native execution – Up to 20x speedup on 64 host cores (across 8 machines)

• LaxP2P synchronization provides a good balance

between performance and accuracy

36