30
Introduction to Multicore architecture Tao Zhang Oct. 21, 2010

Tao zhang

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Tao zhang

Introduction to Multicore architecture

Tao Zhang Oct. 21, 2010

Page 2: Tao zhang

Overview

Part1: General multicore architecture Part2: GPU architecture

Page 3: Tao zhang

Part1:General Multicore architecture

Page 4: Tao zhang

6

1

10

100

1000

10000

1978 1980 1982 1984 1986 1988 1990 1992 1994 1996 1998 2000 2002 2004 2006

Pe

rfo

rma

nce

(vs.

VA

X-1

1/7

80

)

25%/year

52%/year

??%/year

Uniprocessor Performance (SPECint)

• VAX : 25%/year 1978 to 1986

• RISC + x86: 52%/year 1986 to 2002

• RISC + x86: ??%/year 2002 to present

From Hennessy and Patterson, Computer Architecture: A Quantitative Approach, 4th edition, 2006

⇒ Sea change in chip

design: multiple “cores” or

processors per chip

3X

Page 5: Tao zhang

4

Old CW: Chips reliable internally, errors at pins New CW: ≤65 nm ⇒ high soft & hard error rates Old CW: Demonstrate new ideas by building chips New CW: Mask costs, ECAD costs, GHz clock rates ⇒ researchers can’t build believable prototypes

Old CW: Innovate via compiler optimizations + architecture

New: Takes > 10 years before new optimization at leading conference gets into production compilers

Old: Hardware is hard to change, SW is flexible New: Hardware is flexible, SW is hard to change

Conventional Wisdom (CW) in Computer Architecture

Page 6: Tao zhang

5

Old CW: Power is free, Transistors expensive New CW: “Power wall” Power expensive, Xtors free

(Can put more on chip than can afford to turn on) Old: Multiplies are slow, Memory access is fast New: “Memory wall” Memory slow, multiplies fast

(200 clocks to DRAM memory, 4 clocks for FP multiply) Old : Increasing Instruction Level Parallelism via compilers,

innovation (Out-of-order, speculation, VLIW, …) New CW: “ILP wall” diminishing returns on more ILP New: Power Wall + Memory Wall + ILP Wall = Brick Wall

Old CW: Uniprocessor performance 2X / 1.5 yrs New CW: Uniprocessor performance only 2X / 5 yrs?

Conventional Wisdom (CW) in Computer Architecture

Page 7: Tao zhang

ECE 4100/6100 (21)

The Memory WallThe Memory Wall

• On die caches are both area intensive and power intensive StrongArm dissipates more than 43% power in caches Caches incur huge area costs

ECE 4100/6100 (22)

The Power WallThe Power Wall

• Power per transistor scales with frequency but also scales with Vdd Lower Vdd can be compensated for with increased

pipelining to keep throughput constant Power per transistor is not same as power per

area power density is the problem! Multiple units can be run at lower frequencies to

keep throughput constant, while saving power

leakddstdddd IVIVfCVP 2

Page 8: Tao zhang

ECE 4100/6100 (23)

The Current Power TrendThe Current Power Trend

Source: Intel Corp.

400480088080

8085

8086

286 386486

Pentium®P6

1

10

100

1000

10000

1970 1980 1990 2000 2010Year

Pow

er D

ensi

ty (W

/cm

2 )

Hot Plate

NuclearReactor

RocketNozzle

Sun’sSurface

ECE 4100/6100 (24)

Improving Power/Improving Power/PerfomancePerfomance

• Consider constant die size and decreasing core area each generation = more cores/chip Effect of lowering voltage and frequency power

reduction Increasing cores/chip performance increase

Better power performance!

leakddstdddd IVIVfCVP 2

Page 9: Tao zhang

ECE 4100/6100 (19)

The Memory WallThe Memory Wall

µProc60%/yr.

DRAM7%/yr.

1

10

100

1000

DRAM

CPU

Processor-MemoryPerformance Gap:(grows 50% / year)

Time

“Moore’s Law”

ECE 4100/6100 (20)

The Memory WallThe Memory Wall

• Increasing the number of cores increases the demanded memory bandwidth

• What architectural techniques can meet this demand?

Average access

time

Year?

Page 10: Tao zhang

ECE 4100/6100 (19)

The Memory WallThe Memory Wall

µProc60%/yr.

DRAM7%/yr.

1

10

100

1000

DRAM

CPU

Processor-MemoryPerformance Gap:(grows 50% / year)

Time

“Moore’s Law”

ECE 4100/6100 (20)

The Memory WallThe Memory Wall

• Increasing the number of cores increases the demanded memory bandwidth

• What architectural techniques can meet this demand?

Average access

time

Year?

Page 11: Tao zhang

ECE 4100/6100 (21)

The Memory WallThe Memory Wall

• On die caches are both area intensive and power intensive StrongArm dissipates more than 43% power in caches Caches incur huge area costs

ECE 4100/6100 (22)

The Power WallThe Power Wall

• Power per transistor scales with frequency but also scales with Vdd Lower Vdd can be compensated for with increased

pipelining to keep throughput constant Power per transistor is not same as power per

area power density is the problem! Multiple units can be run at lower frequencies to

keep throughput constant, while saving power

leakddstdddd IVIVfCVP 2

Page 12: Tao zhang

ECE 4100/6100 (17)

The ILP WallThe ILP Wall

• Limiting phenomena for ILP extraction: Clock rate: at the wall each increase in clock rate has

a corresponding CPI increase (branches, other hazards)

Instruction fetch and decode: at the wall more instructions cannot be fetched and decoded per clock cycle

Cache hit rate: poor locality can limit ILP and it adversely affects memory bandwidth

ILP in applications: serial fraction on applications

• Reality: Limit studies cap IPC at 100-400 (using ideal

processor) Current processors have IPC of only 2-8/thread?

ECE 4100/6100 (18)

The ILP Wall: OptionsThe ILP Wall: Options

• Increase granularity of parallelism Simultaneous Multi-threading to exploit TLP

o TLP has to exist otherwise poor utilization results

Coarse grain multithreading Throughput computing

• New languages/applications Data intensive computing in the enterprise Media rich applications

Page 13: Tao zhang

Part2:GPU architecture

Page 14: Tao zhang

Beyond Programmable Shading: In Action

1999GeForce 256

22 Million

Transistors

2002GeForce4

63 Million

Transistors

2003GeForce FX

130 Million

Transistors

2004GeForce 6

222 Million

Transistors

1995NV1

1 Million

Transistors

2005GeForce 7

302 Million

Transistors

GPU Evolution - Hardware

2008GeForce GTX 200

1.4 Billion

Transistors

2008GeForce GTX 200

1.4 Billion

Transistors

2006-2007GeForce 8

754 Million

Transistors

Page 15: Tao zhang

© NVIDIA Corporation 2007

GPU Architectures: Past/Present/Future

1995: Z-Buffered TrianglesRiva 128: 1998: Textured TrisNV10: 1999: Fixed Function X-Formed Shaded TrianglesNV20: 2001: FFX Triangles with Combiners at PixelsNV30: 2002: Programmable Vertex and Pixel Shaders (!)NV50: 2006: Unified shaders, CUDA

GIobal Illumination, Physics, Ray tracing, AIfuture???: extrapolate trajectory

Trajectory == Extension + Unification

Page 16: Tao zhang

Copyright © NVIDIA Corporation 2006Unreal © Epic

Per-Vertex LightingNo Lighting Per-Pixel Lighting

Page 17: Tao zhang

The Classic Graphics Hardware

VertexShader

TriangleSetup

FragmentShader

FragmentBlender

Transform

Project

Combine vertices into triangle, convert to fragments

Texture map fragments

Light

GPU

programmable

configurable

fixed

TextureMaps

Z-cull

Alpha Blend

Frame-Buffer(s)

Page 18: Tao zhang

Modern Graphics Hardware

PipeliningNumber of stages

ParallelismNumber of parallel processes

Parallelism + pipeliningNumber of parallel pipelines

1 2 3

1 2 3

1 2 3

1 2 3

1

2

3

Page 19: Tao zhang

Modern Modern GPUsGPUs: Unified Design: Unified Design

Vertex shaders, pixel shaders, etc. become threadsrunning different programs on a flexible core

Page 20: Tao zhang

© NVIDIA Corporation 2007

Why unify?

Heavy GeometryWorkload Perf = 4

Vertex Shader

Pixel Shader

Idle hardware

Heavy PixelWorkload Perf = 8

Vertex Shader

Pixel Shader

Idle hardware

Page 21: Tao zhang

© NVIDIA Corporation 2007

Why unify?

Heavy GeometryWorkload Perf = 11

Unified Shader

Pixel

Vertex Workload

Heavy PixelWorkload Perf = 11

Unified Shader

Vertex

Pixel Workload

Page 22: Tao zhang

Beyond Programmable Shading: In Action

L2

Framebuffer

SP SP

L1

TF

Thre

ad P

roce

ssor

Vertex Thread Issue

Setup & Rasterize

Geom Thread Issue Pixel Thread Issue

Input Assembler

Host

SP SP

L1

TF

SP SP

L1

TF

SP SP

L1

TF

SP SP

L1

TF

SP SP

L1

TF

SP SP

L1

TF

SP SP

L1

TF

L2

Framebuffer

L2

Framebuffer

L2

Framebuffer

L2

Framebuffer

L2

Framebuffer

GeForceGeForce 8: Modern GPU Architecture8: Modern GPU Architecture

Page 23: Tao zhang

© NVIDIA Corporation 2007

Hardware Implementation:A Set of SIMD Multiprocessors

The device is a set of multiprocessorsEach multiprocessor is a set of 32-bit processors with a Single Instruction Multiple Data architectureAt each clock cycle, a multiprocessor executes the same instruction on a group of threads called a warpThe number of threads in a warp is the warp size

Device

Multiprocessor N

Multiprocessor 2

Multiprocessor 1

InstructionUnit

Processor 1 …Processor 2 Processor M

Page 24: Tao zhang

Beyond Programmable Shading: In Action

Goal: Performance per millimeterGoal: Performance per millimeter

• For GPUs, perfomance == throughput

• Strategy: hide latency with computation not cacheHeavy multithreading!

• Implication: need many threads to hide latency– Occupancy – typically prefer 128 or more threads/TPA– Multiple thread blocks/TPA help minimize effect of barriers

• Strategy: Single Instruction Multiple Thread (SIMT)– Support SPMD programming model – Balance performance with ease of programming

Page 25: Tao zhang

Beyond Programmable Shading: In Action

SIMT Thread ExecutionSIMT Thread Execution

• High-level description of SIMT:

– Launch zillions of threads

– When they do the same thing, hardware makes them go fast

– When they do different things, hardware handles it gracefully

Page 26: Tao zhang

Beyond Programmable Shading: In Action

SIMT Thread ExecutionSIMT Thread Execution• Groups of 32 threads formed into warps

– always executing same instruction– some become inactive when code path diverges– hardware automatically handles divergence

• Warps are the primitive unit of scheduling– pick 1 of 32 warps for each instruction slot– Note warps may be running different programs/shaders!

• SIMT execution is an implementation choice– sharing control logic leaves more space for ALUs– largely invisible to programmer– must understand for performance, not correctness

Page 27: Tao zhang

Beyond Programmable Shading: In Action

GPU Architecture: TrendsGPU Architecture: Trends• Long history of ever-increasing programmability

– Culminating today in CUDA: program GPU directly in C

• Graphics pipeline, APIs are abstractions– CUDA + graphics enable “replumbing” the pipeline

• Future: continue adding expressiveness, flexibility– CUDA, OpenCL, DX11 Compute Shader, ... – Lower barrier further between compute and graphics

Page 28: Tao zhang

© NVIDIA Corporation 2007

CPU/GPU Parallelism

Moore’s Law gives you more and more transistorsWhat do you want to do with them? CPU strategy: make the workload (one compute thread) run as fast as possible

Tactics: – Cache (area limiting)– Instruction/Data prefetch– Speculative execution

limited by “perimeter” – communication bandwidth…then add task parallelism…multi-core

GPU strategy: make the workload (as many threads as possible) run as fast as possible

Tactics:– Parallelism (1000s of threads)– Pipelining

limited by “area” – compute capability

Page 29: Tao zhang

© NVIDIA Corporation 2007

GPU ArchitectureMassively Parallel

1000s of processors (today)Power Efficient

Fixed Function Hardware = area & power efficientLack of speculation. More processing, less leaky cache

Latency Tolerant from Day 1Memory Bandwidth

Saturate 512 Bits of Exotic DRAMs All Day Long (140 GB/sec today)No end in sight for Effective Memory Bandwidth

Commercially Viable ParallelismLargest installed base of Massively Parallel (N>4) Processors

Using CUDA!!! Not just as graphicsNot dependent on large caches for performance

Computing power = Freq * TransistorsMoore’s law ^2

tao
删划线
Page 30: Tao zhang

Beyond Programmable Shading: In Action

GPU Architecture: SummaryGPU Architecture: Summary• From fixed function to configurable to programmable

architecture now centers on flexible processor core

• Goal: performance / mm2 (perf == throughput)architecture uses heavy multithreading

• Goal: balance performance with ease of useSIMT: hardware-managed parallel thread execution