gpu compu*ng with matlab - uabgrid documentation · 2017-11-07 · matlab and gpu compu*ng •...

14
GPU Compu*ng with MATLAB Thomas Anthony Scien0st | Director – Big Data Research and Analy0cs Lab Research Compu0ng, UAB IT | Dept. Of Electrical and Computer Engineering Research Compu0ng Day 2017

Upload: others

Post on 13-Jun-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

GPUCompu*ngwithMATLAB

ThomasAnthonyScien0st|Director–BigDataResearchandAnaly0csLabResearchCompu0ng,UABIT|Dept.OfElectricalandComputerEngineering

ResearchCompu0ngDay2017

Page 2: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

Agenda

•  MATLABonTheCPU(PCT&DCS)•  WhycomputeonaGPU?•  MATLABandGPUCompu0ng•  SomeBenchmarks•  Demo(If0mepermits)

Page 3: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

Introduc*on

•  MATLAB(matrixlaboratory)isahigh-leveltechnicalcompu0nglanguagewithaninterac0venumericalcompu0ngenvironment.DevelopedbyMathworks,MATLABallowsmatrixmanipula0ons,ploWngoffunc0onsanddata,implementa0onofalgorithms,crea0onofuserinterfaces,andinterfacingwithprogramswriXeninotherlanguages,includingC,C++,andFortran.

•  BuiltaroundtheMATLABscrip0nglanguage

•  Commandwindowusedasaninterac0veshellforexecu0ngMATLABcode

•  Over2millionusersworldwide(2017)

•  Widelyusedinanumberoffields

Page 4: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

MATLAB@UAB

•  Over2000individualusersontheUABTAHlicense.

Page 5: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

MATLABontheCPU(PCT&DCS)

Page 6: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

WhycomputeonaGPU?

Courtesy:NVIDIA&LLNL

Page 7: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

SmallChanges->BigSpeedUP

Courtesy:NVIDIA&LLNL

Page 8: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

Advantages

•  FasterPerformanceonScien0ficApplica0ons•  Applica0onshaveseenbetween3x-20xperformance

improvement

•  Costofcompu0ngisreduced•  Perf/WaXespeciallyifyouscaleupcompu0ngis

prohibi0vewiththeCPU

Page 9: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

MATLABandGPUCompu*ng

•  MATLABmakesGPUcompu0ngeasy•  Manyfunc0onssupportgpuArrays

•  Alargenumberofbuilt-infunc0onsarealreadyop0mizedfortheNVIDIAGPU•  ~275(atlastcount)

•  Singleprecision/Doubleprecisionsupport•  WorkswellwithPCTandtheDCS

Page 10: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

MATLABGPUsupportedfunc*ons

Page 11: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

MATLABandGPUCompu*ng

>> A = rand (1000,1000);

>> G = gpuArray(A); % push function to GPU

>> F_cpu = fft (A); % run fft on CPU

>> F_gpu = fft(G); % run fft on GPU

>> z = gather(F_gpu); % Bring output back from GPU

Page 12: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

SomeBenchmarks

CPU–[email protected]–Total24coresGPU–NVIDIA–K80

Page 13: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

Demo

•  RunasimplepieceofcodeonCPU&0meit•  ConvertittorunontheGPU&0meit•  DiscussSpeed-up,pikalls,limita0ons•  PCT/DCS+GPU•  MATLABGPUcoder•  Conclusion

Page 14: GPU Compu*ng with MATLAB - UABgrid Documentation · 2017-11-07 · MATLAB and GPU Compu*ng • MATLAB makes GPU compu0ng easy • Many func0ons support gpuArrays • A large number

SpecialThanks!

•  Mathworks•  Dell•  Nvidia•  UABIT•  ResearchCompu0ngTeam