51
27-Apr-2016 Frédéric Parienté, Business Development Manager ADVANCES IN GPU COMPUTING #GTC16

Advances in GPU Computing

Embed Size (px)

Citation preview

Page 1: Advances in GPU Computing

27-Apr-2016

Frédéric Parienté, Business Development Manager

ADVANCES IN GPU COMPUTING #GTC16

Page 2: Advances in GPU Computing

AGENDA

NVGRAPH

CUDA 8 & UNIFIED MEMORYNVIDIA DGX-1

NVIDIA SDK

TESLA P100

Page 3: Advances in GPU Computing

OUR CRAFT

GPU-ACCELERATED COMPUTING

HIGH PERFORMANCE COMPUTING

GRAPHICS

Page 4: Advances in GPU Computing

AUTOMOTIVE (EMBEDDED)

SELECT MARKETS

GAMING PRO-VIZ HPC & AI (DATACENTER)

Page 5: Advances in GPU Computing

TESLA ACCELERATED COMPUTING PLATFORMFocused on Co-Design from Top to Bottom

ProductiveProgrammingModel & Tools

Expert Co-Design

Accessibility

APPLICATION

MIDDLEWARE

SYS SW

LARGE SYSTEMS

PROCESSOR

Fast GPUEngineered for High Throughput

0,0

0,5

1,0

1,5

2,0

2,5

3,0

2008 2009 2010 2011 2012 2013 2014

NVIDIA GPU x86 CPUTFLOPS

M2090

M1060

K20

K80

K40

Fast GPU+

Strong CPU

Page 6: Advances in GPU Computing

DATA CENTER TODAYWell-suited For Transactional

Workloads Running on Lots of Nodes

THE DREAM

Commodity Computers Interconnected with Vast Network Overhead

For Important Workloads with Infinite Need for Computing

Few Lightning-Fast Nodes with Performance of Thousands of Commodity Computers

Network Fabric

Server Racks

Page 7: Advances in GPU Computing

INTRODUCING TESLA P100New GPU Architecture to Enable the World’s Fastest Compute Node

Pascal Architecture NVLinkCoWoS HBM2 Page Migration Engine

PCIe

Switch

PCIe

Switch

CPU CPU

Highest Compute Performance GPU Interconnect for Maximum Scalability

Unifying Compute & Memory in Single Package

Simple Parallel Programming with Virtually Unlimited Memory

Unified Memory

CPU

Tesla P100

Page 8: Advances in GPU Computing

GIANT LEAPS

IN EVERYTHING

NVLINK

PAGE MIGRATION ENGINE

PASCAL ARCHITECTURE

CoWoS HBM2 Stacked Mem

K40Tera

flops

(FP32/FP16)

5

10

15

20

P100

(FP32)

P100

(FP16)

M40

K40

Bi-

dir

ecti

onal BW

(G

B/Sec)

40

80

120

160P100

M40

K40Bandw

idth

(G

B/s)

200

400

600

P100

M40 K40

Addre

ssable

Mem

ory

(G

B)

10

100

1000

P100

M40

21 Teraflops of FP16 for Deep Learning 5x GPU-GPU Bandwidth

3x Higher for Massive Data Workloads Virtually Unlimited Memory Space

10000800

Page 9: Advances in GPU Computing

BIG PROBLEMS NEED FAST COMPUTERS2.5x Faster than the Largest CPU Data Center

0

5

10

15

20

25

30

35

40

45

50

0 20 40 60 80 100

ns/

day

# of Processors (CPUs and GPUs)

AMBER Simulation of CRISPR, Nature’s Tool for Genome Editing

1 Node with 4 P100 GPUs

48 CPU Nodes Comet Supercomputer

AMBER 16 Pre-release, CRSPR based on PDB ID 5f9r, 336,898 atomsCPU: Dual Socket Intel E5-2680v3 12 cores, 128 GB DDR4 per node, FDR IB

“Biotech discovery of the century”-MIT Technology Review 12/2014

Page 10: Advances in GPU Computing

HIGHEST ABSOLUTE PERFORMANCE DELIVEREDNVLink for Max Scalability, More than 45x Faster with 8x P100

0x

5x

10x

15x

20x

25x

30x

35x

40x

45x

50x

Caffe/Alexnet VASP HOOMD-Blue COSMO MILC Amber HACC

2x K80 (M40 for Alexnet) 2x P100 4x P100 8x P100

Speed-u

p v

sD

ual Socket

Hasw

ell

2x Haswell CPU

Page 11: Advances in GPU Computing

DATACENTER IN A RACK1 Rack of Tesla P100 Delivers Performance of 6,000 CPUs

QUANTUM PHYSICSMILC

WEATHERCOSMO

DEEP LEARNINGCAFFE/ALEXNET

12 NODES in RACK8 P100s per Node

MOLECULAR DYNAMICSAMBER

# of Racks1 108642 . . .40 84

638 CPUs / 186 kW

650 CPUs / 190 kW

6,000 CPUs / 1.8 MW

2,900 CPUs / 850 kW

96 P100s / 38 kW

36 NODES in RACKDUAL CPUs Per Node

. . .

Page 12: Advances in GPU Computing

TESLA P100 ACCELERATOR

Compute 5.3 TF DP ∙ 10.6 TF SP ∙ 21.2 TF HP

Memory HBM2: 720 GB/s ∙ 16 GB

Interconnect NVLink (up to 8 way) + PCIe Gen3

ProgrammabilityPage Migration Engine

Unified Memory

AvailabilityDGX-1: Order Now

Atos, Cray, Dell, HP, IBM: Q1 2017

Page 13: Advances in GPU Computing

NVIDIA DGX-1WORLD’S FIRST DEEP LEARNING SUPERCOMPUTER

170 TFLOPS FP16

8x Tesla P100 16GB

NVLink Hybrid Cube Mesh

Accelerates Major AI Frameworks

Dual Xeon

7 TB SSD Deep Learning Cache

Dual 10GbE, Quad IB 100Gb

3RU – 3200W

Page 14: Advances in GPU Computing

NVIDIA DGX-1 SOFTWARE STACKOptimized for Deep Learning Performance

Accelerated Deep Learning

cuDNN NCCL

cuSPARSE cuBLAS cuFFT

Container Based Applications

NVIDIA Cloud Management

Digits DL Frameworks GPU Apps

Page 15: Advances in GPU Computing

END-TO-END PRODUCT FAMILY

HYPERSCALE HPC

Tesla M4, M40

MIXED-APPS HPC

Tesla K80

STRONG-SCALING HPC

Tesla P100

FULLY INTEGRATED DLSUPERCOMPUTER

DGX-1

For customers who need to get going now with fully

integrated solution

Hyperscale & HPC data centers running apps that

scale to multiple GPUs

HPC data centers running mix of CPU and GPU workloads

Hyperscale deployment for DL training, inference, video &

image processing

Page 16: Advances in GPU Computing
Page 17: Advances in GPU Computing

NVIDIA SDK: COMPUTEWORKS

Page 18: Advances in GPU Computing

INTRODUCING CUDA 8

New Architecture, Stacked Memory, NVLINK

Pascal SupportSimple Parallel Programming with large virtual memory

Unified Memory

nvGRAPH – library for accelerating graph analytics apps

FP16 computation to boost Deep Learning workloads

LibrariesCritical Path Analysis to speed overall app tuning

OpenACC profiling to optimize directive performance

Single GPU debugging on Pascal

Developer Tools

Page 19: Advances in GPU Computing

OUT-OF-THE-BOX PERFORMANCE ON PASCALP100/CUDA8 speedup over K80/CUDA7.5

developer.nvidia.com/cuda-toolkit

19x

HPGMG with AMR

Larger Simulations &

More Accurate Results

3.5 x

VASP

1.5 x

MILC

Page 20: Advances in GPU Computing

UNIFIED MEMORY

Page 21: Advances in GPU Computing

UNIFIED MEMORYDramatically Lower Developer Effort

Performance

Through

Data Locality

Migrate data to accessing processor

Guarantee global coherence

Still allows explicit hand tuning

Simpler

Programming &

Memory Model

Single allocation, single pointer,

accessible anywhere

Eliminate need for explicit copy

Greatly simplifies code porting

Allocate Up To GPU Memory Size

Kepler

GPUCPU

Unified Memory

CUDA 6+

Page 22: Advances in GPU Computing

SIMPLIFIED MEMORY MANAGEMENT CODE

void sortfile(FILE *fp, int N) {char *data;data = (char *)malloc(N);

fread(data, 1, N, fp);

qsort(data, N, 1, compare);

use_data(data);

free(data);}

void sortfile(FILE *fp, int N) {char *data;cudaMallocManaged(&data, N);

fread(data, 1, N, fp);

qsort<<<...>>>(data,N,1,compare);cudaDeviceSynchronize();

use_data(data);

cudaFree(data);}

CPU Code CUDA 6 Code with Unified Memory

Page 23: Advances in GPU Computing

GREAT PERFORMANCE WITH UNIFIED MEMORYRAJA: Portable C++ Framework for parallel-for style programming

RAJA uses Unified Memory for heterogeneous array allocations

Parallel forall loops run on device

“Excellent performance considering this is a "generic”

version of LULESH with no architecture-specific tuning.”

-Jeff Keasler, LLNL

1.5x

1.9x 2.0x

0

2

4

6

8

10

12

14

16

18

20

45^3 100^3 150^3

CPU: 10-core Haswell

GPU: Tesla K40

Million e

lem

ents

per

second

Mesh sizeGPU: NVIDIA Tesla K40, CPU: Intel Haswell E5-2650 v3 @ 2.30GHz, single socket 10-core

LULESH Throughput

Page 24: Advances in GPU Computing

CUDA 8: UNIFIED MEMORYLarge datasets, simple programming, High Performance

Allocate Beyond GPU Memory Size

Unified Memory

Pascal

GPUCPU

CUDA 8

Enable Large

Data Models

Oversubscribe GPU memory

Allocate up to system memory size

Tune

Unified Memory

Performance

Usage hints via cudaMemAdvise API

Explicit prefetching API

Simpler

Data Accesss

CPU/GPU Data coherence

Unified memory atomic operations

Page 25: Advances in GPU Computing

UNIFIED MEMORY EXAMPLEOn-Demand Paging

__global__void setValue(int *ptr, int index, int val) {ptr[index] = val;

}

void foo(int size) {char *data;cudaMallocManaged(&data, size);

memset(data, 0, size);

setValue<<<...>>>(data, size/2, 5);cudaDeviceSynchronize();

useData(data);

cudaFree(data);}

Unified Memory allocation

Access all values on CPU

Access one value on GPU

Page 26: Advances in GPU Computing

HOW UNIFIED MEMORY WORKS IN CUDA 6Servicing CPU page faults

GPU Memory Mapping CPU Memory Mapping

Interconnect

Page Fault

cudaMallocManaged(&array, size);

memset(array, size);

array array

__global__void setValue(char *ptr, int index, char val) {ptr[index] = val;

}setValue<<<...>>>(array, size/2, 5);

GPU Code CPU Code

Page 27: Advances in GPU Computing

HOW UNIFIED MEMORY WORKS ON PASCALServicing CPU and GPU Page Faults

GPU Memory Mapping CPU Memory Mapping

Interconnect

Page Fault

Page Fault

cudaMallocManaged(&array, size);

memset(array, size);

array array

__global__Void setValue(char *ptr, int index, char val) {ptr[index] = val;

}setValue<<<...>>>(array, size/2, 5);

GPU Code CPU Code

Page 28: Advances in GPU Computing

USE CASE: ON-DEMAND PAGINGGraph Algorithms

Large Data Set

Performance over GPU directly accessing host memory (zero-copy)

Baseline: migrate on first touchOptimized: best placement in memory

Page 29: Advances in GPU Computing

UNIFIED MEMORY ON PASCALGPU memory oversubscription

void foo() {// Assume GPU has 16 GB memory// Allocate 32 GBchar *data;size_t size = 32*1024*1024*1024;cudaMallocManaged(&data, size);

}

32 GB allocation

Pascal supports allocations where only a subset of pages reside on GPU.

Pages can be migrated to the GPU when “hot”.

Fails on Kepler/Maxwell

Page 30: Advances in GPU Computing

GPU OVERSUBSCRIPTIONNow possible with Pascal

Many domains would benefit from GPU memory oversubscription:

Combustion – many species to solve for

Quantum chemistry – larger systems

Ray tracing - larger scenes to render

4/29/2

016

Page 31: Advances in GPU Computing

GPU OVERSUBSCRIPTIONHPGMG: high-performance multi-grid

4/29/2

016

Tesla K40 (12 GB)

Tesla P100 (16 GB)

*Tesla P100 performance is very early modelling results

Page 32: Advances in GPU Computing

UNIFIED MEMORY ON PASCALConcurrent CPU/GPU access to managed memory

__global__ void mykernel(char *data) {data[1] = ‘g’;

}

void foo() {char *data;cudaMallocManaged(&data, 2);

mykernel<<<...>>>(data);// no synchronize heredata[0] = ‘c’;

cudaFree(data);}

OK on Pascal: just a page fault

Concurrent CPU access to ‘data’ on previous GPUs caused a fatal segmentation fault

Page 33: Advances in GPU Computing

UNIFIED MEMORY ON PASCALSystem-Wide Atomics

__global__ void mykernel(int *addr) {atomicAdd(addr, 10);

}

void foo() {int *addr;cudaMallocManaged(addr, 4);*addr = 0;

mykernel<<<...>>>(addr);__sync_fetch_and_add(addr, 10);

}

System-wide atomics not available on Kepler / Maxwell

Pascal enables system-wide atomics• Direct support of atomics over NVLink • Software-assisted over PCIe

Page 34: Advances in GPU Computing

PERFORMANCE TUNING ON PASCALExplicit Memory Hints and Prefetching

Advise runtime on known memory access behaviors with cudaMemAdvise()

cudaMemAdviseSetReadMostly: Specify read duplicationcudaMemAdviseSetPreferredLocation: suggest best locationcudaMemAdviseSetAccessedBy: initialize a mapping

Explicit prefetching with cudaMemPrefetchAsync(ptr, length, destDevice, stream)

Unified Memory alternative to cudaMemcpyAsync

Asynchronous operation that follows CUDA stream semantics

To Learn More:S6216 “The Future of Unified Memory” by Nikolay Sakharnykh

at http://on-demand.gputechconf.com/

Page 35: Advances in GPU Computing

FUTURE: UNIFIED SYSTEM ALLOCATORAllocate unified memory using standard malloc

Removes CUDA specific allocator restrictions

Data movement is transparently handled

Requires operating system support

void sortfile(FILE *fp, int N) {char *data;

// Allocate memory using any standard allocatordata = (char *) malloc(N * sizeof(char));

fread(data, 1, N, fp);

qsort<<<...>>>(data,N,1,compare);

use_data(data);

// Free the allocated memoryfree(data);

}

CUDA 8 Code with System Allocator

Page 36: Advances in GPU Computing

GRAPH ANALYTICS

Page 37: Advances in GPU Computing

GRAPH ANALYTICSInsight from Connections in Big Data

Social Network Analysis

Cyber Security / Network Analytics

Genomics

… and much more: Parallel Computing, Recommender Systems, Fraud Detection, Voice Recognition, Text Understanding, Search

Wik

imedia

Com

mons

Circ

os.c

a

Page 38: Advances in GPU Computing

nvGRAPHAccelerated Graph Analytics

Process graphs with up to 2.5 Billion edges on a single GPU (24GB M40)

Accelerate a wide range of applications:

0

5

10

15

20

25

Itera

tions/

s

nvGRAPH: 4x Speedup

48 Core Xeon E5

nvGRAPH on K40

PageRank on Wikipedia 84 M link dataset

developer.nvidia.com/nvgraph

PageRankSingle Source

Shortest Path

Single Source

Widest Path

Search Robotic Path Planning IP Routing

Recommendation

Engines

Power Network

PlanningChip Design / EDA

Social Ad PlacementLogistics & Supply

Chain Planning

Traffic sensitive

routing

Page 39: Advances in GPU Computing

ENHANCED PROFILING

Page 40: Advances in GPU Computing

DEPENDENCY ANALYSIS

Easily Find the Critical Kernel To Optimize

The longest running kernel is not always the most critical optimization target

A wait

B wait

Kernel X Kernel Y

5% 40%

TimelineOptimize Here

CPU

GPU

Page 41: Advances in GPU Computing

DEPENDENCY ANALYSISVisual Profiler

Unguided Analysis Generating critical path

Dependency AnalysisFunctions on critical path

Page 42: Advances in GPU Computing

DEPENDENCY ANALYSISVisual Profiler

APIs, GPU activities not in critical path are greyed out

Page 43: Advances in GPU Computing

MORE CUDA 8 PROFILER FEATURES

NVLink Topology and Bandwidth profiling

Unified Memory Profiling CPU Profiling

OpenACC Profiling

Page 44: Advances in GPU Computing

COMPILER IMPROVEMENTS

Page 45: Advances in GPU Computing

2X FASTER COMPILE TIME ON CUDA 8NVCC Speedups on CUDA 8

Performance may vary based on OS and software

versions, and motherboard configuration

• Average total compile times (per translation unit)

• Intel Core i7-3930K (6-cores) @ 3.2GHz

• CentOS x86_64 Linux release 7.1.1503 (Core) with GCC 4.8.3 20140911

• GPU target architecture sm_52

Speedup o

ver

CU

DA 7

.5

0,0x

0,5x

1,0x

1,5x

2,0x

2,5x

SHOC ThrustExamples

Rodinia cuDNN cuSparse cuFFT cuBLAS cuRand math

Open Source Benchmarks Internal Benchmarks

QUDA increase 1.54x

Page 46: Advances in GPU Computing

HETEROGENEOUS C++ LAMBDACombined CPU/GPU lambda functions

Experimental feature in CUDA 8. `nvcc --expt-extended-lambda`

__global__ template <typename F, typename T>void apply(F function, T *ptr) {

*ptr = function(ptr);}

int main(void) {float *x;cudaMallocManaged(&x, 2);

auto square = [=] __host__ __device__ (float x) { return x*x; };

apply<<<1, 1>>>(square, &x[0]);

ptr[1] = square(&x[1]);

cudaFree(x);}

__host__ __device__ lambda

Pass lambda to CUDA kernel

… or call it from host code

Call lambda from device code

Page 47: Advances in GPU Computing

HETEROGENEOUS C++ LAMBDAUsage with Thrust

Experimental feature in CUDA 8. `nvcc --expt-extended-lambda`

void saxpy(float *x, float *y, float a, int N) {using namespace thrust;auto r = counting_iterator(0);

auto lambda = [=] __host__ __device__ (int i) {y[i] = a * x[i] + y[i];

};

if(N > gpuThreshold)for_each(device, r, r+N, lambda);

elsefor_each(host, r, r+N, lambda);

}

__host__ __device__ lambda

Use lambda in thrust::for_eachon host or device

Page 48: Advances in GPU Computing

OPENACCMore Science, Less Programming

SIMPLE

POWERFUL

PORTABLE

Minimum effortsSmall code modifications

Up to 10x faster application performance

Optimize once,

run on GPUs and CPUs

main() {

<serial code>#pragma acc kernels//automatically runs on

GPU

{ <parallel code>

}}

FREE FOR ACADEMIA

SIMPLE

Page 49: Advances in GPU Computing

PERFORMANCE PORTABILITY FOR EXASCALEOptimize Once, Run Everywhere with OpenACC

20162015 2017

NVIDIA GPU NVIDIA GPU NVIDIA GPU

AMD GPU AMD GPU AMD GPU

x86 CPU x86 CPU x86 CPU

x86 Xeon Phi x86 Xeon Phi

OpenPOWER CPU OpenPOWER CPU

ARM CPU

PGI Roadmaps are subject to change without notice.

Page 50: Advances in GPU Computing

SUMMARY

NVGRAPH

CUDA 8 & UNIFIED MEMORYNVIDIA DGX-1

NVIDIA SDK

TESLA P100

Page 51: Advances in GPU Computing

DEEP LEARNING &

ARTIFICIAL INTELLIGENCE

Sep 28-29, 2016 | Amsterdam

www.gputechconf.eu #GTC16

SELF-DRIVING CARS VIRTUAL REALITY &

AUGMENTED REALITY

SUPERCOMPUTING & HPC

GTC Europe is a two-day conference designed to expose the innovative ways developers, businesses and academics are

using parallel computing to transform our world.

EUROPE’S BRIGHTEST MINDS & BEST IDEAS

2 Days | 800 Attendees | 50+ Exhibitors | 50+ Speakers | 15+ Tracks | 15+ Workshops | 1-to-1 Meetings