Top Banner
1 Accelerating MATLAB using CUDA- Enabled GPUs February 2009 John Melonakos AccelerEyes [email protected] Sumit Gupta NVIDIA Tesla GPU Computing [email protected]
28

Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

Jun 17, 2018

Download

Documents

lengoc
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

1

Accelerating MATLAB using CUDA-

Enabled GPUs

February 2009

John Melonakos

AccelerEyes

[email protected]

Sumit Gupta

NVIDIA Tesla GPU Computing

[email protected]

Page 2: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

2

4 cores

What is GPU Computing?

Computing with CPU + GPU

Heterogeneous Computing

Page 3: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

3

GPUs: Turning Point in Supercomputing

Tesla Personal

Supercomputer$10,000

CalcUA$5 Million

Source: University of Antwerp, Belgium

Desktop beats Cluster

Page 4: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

4

146X

Medical Imaging

U of Utah

36X

Molecular Dynamics

U of Illinois, Urbana

18X

Video Transcoding

Elemental Tech

50X

MATLAB Computing

AccelerEyes

100X

Astrophysics

RIKEN

149X

Financial simulation

Oxford

47X

Linear Algebra

Universidad Jaime

20X

3D Ultrasound

Techniscan

130X

Quantum Chemistry

U of Illinois, Urbana

30X

Gene Sequencing

U of Maryland

Not 2x or 3x : Speedups are 20x to 150x

Page 5: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

5

CUDA Parallel Computing Architecture

ATI’s Compute “Solution”

Parallel computing architecture

and programming model

Includes a C compiler plus

support for OpenCL and

DX11 Compute

Architected to natively support

all computational interfaces

(standard languages and APIs)

Page 6: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

6

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Processor core has Floating point / Integer unit

Move, compare, logic, branch unit

IEEE 754 floating pointSingle and Double

102 GB/s high-speed interface

to memory

Thread Processor (TP)

FP / Integer

Multi-banked

Register File

SpecialOps

Thread Processor Array (TPA)

30 TPAs = 240 Processors

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Double Precision

Special Function Unit (SFU)

TP Array Shared Memory

Tesla T10 GPU: 240 Processor Cores

Main

Mem

oryGDDR3

102 GB/sec

512 bit

Thread Manager

Page 7: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

7

L1 L1 L1 L1 L1 L1 L1 L1 L1 L1 L1 L1 L1 L1 L1

L1 L1 L1 L1 L1 L1 L1 L1 L1 L1 L1 L1 L1 L1 L1

NVIDIA Tesla 10-Series GPU

Massively parallel, many core architecture

Page 8: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

8

CUDA Facts

750+ Research Papers

85+ universities teaching CUDA

100 Million CUDA-Enabled GPUs

25K Active Developers

www.NVIDIA.com/CUDA

Page 9: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

Background

• Who is AccelerEyes?– AccelerEyes is a MathWorks partner

– Simple software for visual computing

Page 10: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

Background

• Who is AccelerEyes?– AccelerEyes is a MathWorks partner

– Simple software for visual computing

• What is Jacket?– GPU engine for MATLAB

– CUDA powered language extension

Page 11: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

• Why Jacket?– Challenges in technical computing

– Low-cost speed, high-value graphics

– Increased productivity

Background

• Who is AccelerEyes?– AccelerEyes is a MathWorks partner

– Simple software for visual computing

• What is Jacket?– GPU engine for MATLAB

– CUDA powered language extension

Page 12: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

MATLAB Options

• CPU Solutions (blue arrows)– MATLAB and the Parallel

Computing toolbox enable PC and clustered MATLAB computing

• GPU Solutions (green arrows)– Jacket enables CUDA MATLAB

computing

Page 13: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

Jacket Benefits

Jacket combines the speed of CUDA and the graphics of the GPU with the user friendliness of MATLAB.

Page 14: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

Jacket at Work

CPU GPU

This Neural Net only required 3 changes (in red).

Page 15: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

Functionality

Generators: geye, gones, gzeros

Element-wise: +, *, -, /

Reductions: sum, min, max …

Indexing: subscripted referencing / subscripted assignment

Linear Algebra: matrix multiply, …

FFT: fft, ifft, fftn, ifftn

Filtering: filter, filter2, convn

Interpolation: interp2

Parallel for-loops: gfor

Page 16: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

Graphics Toolbox

True visual computing

OpenGL API in MATLAB

Interactive OpenGL

Key functions: gsurf, gimage, gscatter3, gplot, …

Visualization scripts are open and modifiable.

Jacket includes the Graphics Toolbox

Page 17: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

Kernel Benchmarks

0.91 secs

3.6 secs

17.7 secs

0.28 secs

0.43 secs

1.1 secs

256x256

512x512

1024x1024

Time (log scale)

Vector Length

FFT Kernel

Tesla C1060 Intel Core 2 Duo (2.0 GHz)

54x Speedup 16x Speedup

Page 18: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

Application Benchmarks

Page 19: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

Custom CUDA FunctionsIntegration using MEX

mymex.cu

Page 20: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

Some Jacket Customers

Page 21: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

Roadmap for New Features

– more gfor

– gdouble

– multi-GPU support (for clusters of GPUs)

– LAPACK (eig, inv, etc.)

– signal processing

– image processing (and computer vision)

– Simulink® on the GPU

– statistical functions

– handle graphics

– lots of other MATLAB functions (finance, biology, etc.)

Page 22: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

22

Tesla GPU Computing Products

Tesla S1070 1U SystemTesla C1060

Computing Board

Tesla Personal

Supercomputer (4 Tesla C1060s)

GPUs 4 Tesla GPUs 1 Tesla GPU 4 Tesla GPUs

Single Precision Perf 4.14 Teraflops 933 Gigaflops 3.7 Teraflops

Double Precision Perf 346 Gigaflops 78 Gigaflops 312 Gigaflops

Memory 4 GB / GPU 4 GB 4 GB / GPU

Page 23: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

23

Introducing the Tesla Personal Supercomputer

Supercomputing PerformanceMassively parallel CUDA Architecture

960 cores. 4 TeraFlops

250x the performance of a desktop

Personal One researcher, one supercomputer

Plugs into standard power strip

AccessibleProgram in C for Windows, Linux

Available now worldwide under $10,000

Page 24: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

24

A $5 Million Datacenter

CPU 1U Server CPU 1U Server

Tesla 1U System

6x more perf

2 Quad-core Xeon

CPUs: 8 cores

0.17 Teraflop (single)

0.08 Teraflop (double)

$ 3,000

700 W

1819 CPU servers

310 Teraflops (single)

155 Teraflops (double)

Total area 16K sq feet

Total 1273 KW

8 CPU Cores +

4 GPUs = 968 cores

4.14 Teraflops (single)

0.346 Teraflop (double)

$ 11,000

1500 W

455 CPU servers

455 Tesla systems

1961 Teraflops (single)

196 Teraflops (double)

Total area 9K sq feet

Total 682 KW

40% smaller

½ the power

Page 25: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

25

Tesla S1070: Green Supercomputing

20X Better

Performance / Watt

Hess

Chevron

Petrobras

NCSA

CEA

Tokyo Tech

JFCOM

SAIC

Federal

Motorola

Kodak

University of Heidelberg

University of Illinois

University of North Carolina

Max Planck Institute

Rice University

University of Maryland

Eotvas University

University of Wuppertal

Chinese Academy of Sciences

National Taiwan University

Page 26: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

26

Life Sciences &

Medical Equipment

Productivity

/ Misc

Oil and

Gas EDA Finance

CAE /

Mathematical

Communi

cation

Max Planck

FDA

Robarts Research

Medtronic

AGC

Evolved machines

Smith-Waterman

DNA sequencing

AutoDock

NAMD/VMD

Folding@Home

Howard Hughes

Medical

CRIBI Genomics

GE Healthcare

Siemens

Techniscan

Boston Scientific

Eli Lilly

Silicon Informatics

Stockholm

Research

Harvard

Delaware

Pittsburg

ETH Zurich

Institute Atomic

Physics

CEA

NCSA

WRF Weather

Modeling

OptiTex

Tech-X

Elemental Technologies

Dimensional Imaging

Manifold

Digisens

General Mills

Rapidmind

Rhythm & Hues

xNormal

Elcomsoft

LINZIK

Hess

TOTAL

CGG/Veritas

Chevron

Headwave

Acceleware

Seismic City

P-Wave

Seismic

Imaging

Mercury

Computer

ffA

Synopsys

Nascentric

Gauda

CST

Agilent

Symcor

Level 3

SciComp

Hanweck

Quant

Catalyst

RogueWave

BNP Paribas

AccelerEyes

MathWorks

Wolfram

National

Instruments

Ansys

Access Analytics

Tech-x

RIKEN

SOFA

Renault

Boeing

Nokia

RIM

Philips

Samsung

LG

Sony

Ericsson

NTT DoCoMo

Mitsubishi

Hitachi

Radio

Research

Laboratory

US Air Force

More Than 250 Customers / ISVs

Page 27: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

27

More Information

Tesla main page

http://www.nvidia.com/tesla

Industry Solutions

CUDA Zone

http://www.nvidia.com/cuda

CUDA Tutorials, Applications

Hear from Developershttp://www.youtube.com/nvidiatesla

Download Jacket Now

http://www.accelereyes.com/

Further Jacket Questionshttp://www.accelereyes.com/forums

http://www.accelereyes.com/blog

John Melonakos

[email protected]

Sumit Gupta

[email protected]

Page 28: Accelerating MATLAB using CUDA- Enabled GPUs · Accelerating MATLAB using CUDA-Enabled GPUs ... –lots of other MATLAB functions (finance, biology, ... Supercomputing Performance

28

100s of Apps on CUDA Zone

CUDA 1.0

CUDA 1.1

CUDA 2.0

Duke

Erlangen

ETH Zurich

Georgia Tech

Grove City College

Harvard

IISc Bangalore

IIIT Hyderabad

IIT

Illinois

INRIA

Iowa

ITESM

Johns Hopkins

Kent State

Kyoto

Lund

Maryland

McGill

MIT

North Carolina

Northeastern

Oregon State

Pennsylvania

Polimi

Purdue

Santa Clara

Stanford

Stuttgart

Suny

Tokyo

TU-Vienna

USC

Utah

Virginia

Washington

Waterloo

Western Australia

Williams College

Wisconsin

Yonsei

50+ Universities Teaching CUDA

750+ research papers

100 M CUDA enabled GPUs

25,000+ active developers

NVIDIA: Leadership in GPU computing

30+ CUDA GPU clusters

150K CUDA compiler downloads