introduction to parallel computing€¦ · introduction to parallel computing elwin chan. 2 flight...

19
1 © 2015 The MathWorks, Inc. Introduction to Parallel Computing Elwin Chan

Upload: others

Post on 24-Jul-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

1© 2015 The MathWorks, Inc.

Introduction to Parallel Computing

Elwin Chan

Page 3: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

3

Demo: Getting Data from a Web API

Page 4: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

4

Demo: Getting Data from a Web API using parfor

Page 5: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

5

Demo: Getting Data from a Web API using parfeval

Page 6: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

6

Going Parallel: Multicore

Multicore Desktop

MATLAB client

MATLAB workers

Page 7: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

7

Going Parallel: Clusters

Computer Cluster

MATLAB client

Page 8: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

8

Going Parallel: Cloud

MATLAB client

Cloud Cluster

Page 9: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

9

Going Parallel: GPUs

NVIDIA GPUs

Device Memory

GPU Cores

MATLAB client

Page 10: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

10

Explicit Parallelism: Independent Tasks or Iterationsparfor, parfeval, jobs and tasks

Examples: parameter sweeps, Monte Carlo simulations

No dependencies or communications between tasks

MATLAB client

MATLAB workers

Time Time

Page 11: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

11

Speed-up using NVIDIA GPUs

Ideal Problems

• Massively Parallel and/or Vectorized operations

• Computationally Intensive

• Algorithm consists of supported functions

300+ GPU-enabled MATLAB functions

Additional GPU-enabled Toolboxes

• Neural Networks

• Image Processing

• Communications

• Signal Processing

..... Learn More

Device Memory

GPU Cores

Page 12: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

12

Too Much Data for One Machine?Use Distributed Memory

Using More Computers (RAM)

MATLAB client RAM RAM

Page 13: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

13

Distributed Arrays

Distributed Arrays hold data remotely on workers running on a cluster

Manipulate directly from client MATLAB (desktop)

200+ MATLAB functions overloaded for distributed arrays

Supported functions for Distributed Arrays

Page 14: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

14

Too Much Data for Your Cluster?Use Datastore

Datastore

HDFS

Node Data

Node Data

Node Data

Hadoop

Datastore access data stored in

HDFS from MATLAB

Page 15: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

15

Too Much Data for Your Cluster?Use Datastore, MapReduce and tall

Datastore

map.m

reduce.m

HDFS

Node Data

Node Data

Node Data

Map Reduce

Map Reduce

Map Reduce

Hadoop

MATLAB

Distributed Computing

Server

Page 16: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

16

Offload and Scale Computations with batch

MATLAB

Desktop (Client)

Result

Work

Worker

Worker

Worker

Worker

batch(…)

Page 17: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

17

Going Parallel: Other MATLAB® ToolboxesEnable parallel computing support by setting a flag or preference

Optimization

Parallel estimation of

gradients

Statistics and Machine Learning

Resampling Methods, k-Means

clustering, GPU-enabled functions

Neural Networks

Deep Learning, Neural Network

training and simulation

Image Processing

Batch Image Processor, Block

Processing, GPU-enabled functions

Computer Vision

Parallel-enabled functions

in bag-of-words workflow

Signal Processing and

Communications

GPU-enabled FFT filtering,

cross correlation, BER

simulations

Other Parallel-enabled Toolboxes

Page 18: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

18

Going Parallel: Simulink®Enable parallel computing support by setting a flag or preference

Simulink Control Design

Frequency response estimation

Simulink/Embedded Coder

Generating and building code

Simulink Design Optimization

Response optimization, sensitivity

analysis, parameter estimation

Communication Systems Toolbox

GPU-based System objects for

Simulation Acceleration

Other Parallel-enabled Toolboxes

Page 19: Introduction to Parallel Computing€¦ · Introduction to Parallel Computing Elwin Chan. 2 Flight Test Data Analysis 16x Faster Heart Transplant Studies ... Using More Computers

19

Why use Parallel Computing Toolbox?

Reduce computation time by

– Using more cores

– Accessing Graphical Processing Units

Overcome memory limitations by

– Distributing data to available hardware

– Using datastore and mapreduce

Offload computations to a cluster and

– Free up your desktop

– Access better computer hardware

Device Memory

GPU Cores

RAM RAM