gpu compu*ng with matlab - uabgrid documentation · 2017-11-07 · matlab and gpu compu*ng •...
TRANSCRIPT
GPUCompu*ngwithMATLAB
ThomasAnthonyScien0st|Director–BigDataResearchandAnaly0csLabResearchCompu0ng,UABIT|Dept.OfElectricalandComputerEngineering
ResearchCompu0ngDay2017
Agenda
• MATLABonTheCPU(PCT&DCS)• WhycomputeonaGPU?• MATLABandGPUCompu0ng• SomeBenchmarks• Demo(If0mepermits)
Introduc*on
• MATLAB(matrixlaboratory)isahigh-leveltechnicalcompu0nglanguagewithaninterac0venumericalcompu0ngenvironment.DevelopedbyMathworks,MATLABallowsmatrixmanipula0ons,ploWngoffunc0onsanddata,implementa0onofalgorithms,crea0onofuserinterfaces,andinterfacingwithprogramswriXeninotherlanguages,includingC,C++,andFortran.
• BuiltaroundtheMATLABscrip0nglanguage
• Commandwindowusedasaninterac0veshellforexecu0ngMATLABcode
• Over2millionusersworldwide(2017)
• Widelyusedinanumberoffields
MATLAB@UAB
• Over2000individualusersontheUABTAHlicense.
MATLABontheCPU(PCT&DCS)
WhycomputeonaGPU?
Courtesy:NVIDIA&LLNL
SmallChanges->BigSpeedUP
Courtesy:NVIDIA&LLNL
Advantages
• FasterPerformanceonScien0ficApplica0ons• Applica0onshaveseenbetween3x-20xperformance
improvement
• Costofcompu0ngisreduced• Perf/WaXespeciallyifyouscaleupcompu0ngis
prohibi0vewiththeCPU
MATLABandGPUCompu*ng
• MATLABmakesGPUcompu0ngeasy• Manyfunc0onssupportgpuArrays
• Alargenumberofbuilt-infunc0onsarealreadyop0mizedfortheNVIDIAGPU• ~275(atlastcount)
• Singleprecision/Doubleprecisionsupport• WorkswellwithPCTandtheDCS
MATLABGPUsupportedfunc*ons
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
SomeBenchmarks
CPU–[email protected]–Total24coresGPU–NVIDIA–K80
Demo
• RunasimplepieceofcodeonCPU&0meit• ConvertittorunontheGPU&0meit• DiscussSpeed-up,pikalls,limita0ons• PCT/DCS+GPU• MATLABGPUcoder• Conclusion
SpecialThanks!
• Mathworks• Dell• Nvidia• UABIT• ResearchCompu0ngTeam