GPU support in MATLAB R2010b

Discussion of ArrayFire using CUDA or OpenCL.

Moderator: pavanky

GPU support in MATLAB R2010b

Postby Lars1 » Thu Sep 09, 2010 12:23 pm

Hi.

As is probably well known to most, MATLAB R2010b includes support to use GPUs. I have tried to run my SGeMM and DGeMM benchmarks (see http://wiki.accelereyes.com/wiki/index.php/Jacket_Floating_Point_Performance_(GFlops)) on MATLAB-GPU (as I will name the MATLAB GPU facilitated method in the following). The test with a Tesla C2050 gives the following result when I take the ratio of Jacket GFlops relative to MATLAB-GPU GFlops.

plot_JvsMGPU_01.jpg
plot_JvsMGPU_01.jpg (176.57 KiB) Viewed 5509 times


As seen from the measurement, Jacket is superior to MATLABs implementation for the GPU - even for large matrices. The matrix size where the GPU breaks even with the CPU is around size 180 x 180 for Jacket and size 450 x 450 for MATLAB-GPU. This also says that Jacket is way faster than MATLAB-GPU.

I will do some more tests with other GPUs and publish these on Torben's Corner (see http://wiki.accelereyes.com/wiki/index.php/Torben%27s_Corner). I have used MATLAB-GPU and it annoys me that the GPU needs at least 1.3 in CUDA capability - it is annoying as I usually use my laptop for development of the raw code. Also there is no support for lazy execution, and the function support is very limited.

I have not yet tried to map a full application to MATLAB-GPU. If someone has tried that it would be very interesting to have some info on that.

BR Torben

PS: I add the raw data below where you can see the individual performance. The title says GTX465 - I made a typo here. It really is the C2050. I'll change that later. The first figure is single precision and the second is double precision.

flopsSGeMM_Colfax_C2050sp_01.jpg
flopsSGeMM_Colfax_C2050sp_01.jpg (180.53 KiB) Viewed 5495 times


flopsDGeMM_Colfax_C2050dp_01.jpg
flopsDGeMM_Colfax_C2050dp_01.jpg (182.64 KiB) Viewed 5495 times
Last edited by Lars1 on Thu Sep 09, 2010 2:10 pm, edited 1 time in total.
--
Editor of "Torben's Corner" - http://wiki.accelereyes.com/wiki/index.php/Torben's_Corner
Cluster: 2 x X5670 + 20 x X5570 | 18 x C2070 & 15 x GTX580
Colfax CXT2000i: GTX465 & GTX580 | FX3800 & 4000 | C1060 & C2050
Lars1
 
Posts: 140
Joined: Thu Jul 23, 2009 7:28 am

Re: GPU support in MATLAB R2010b

Postby grubin698 » Thu Sep 09, 2010 12:28 pm

Great (and quick) work!
The shape of the curve indicates to me that Accelereyes has done a much better job minimizing overhead than did the Mathworks. Kudos to Accelereyes for that!

And I agree with you about the 1.3 compute capability. I just had my company buy me a new gaming laptop with a GTS 360M so that I can use it for GPU work. I'm quite disappointed that I won't be able to play with the Matlab GPU capabilities with it.
Gary
Jacket v1.5.0 (build 8250)
Core i7-920
Matlab 2010b
CUDA driver 258.96, CUDA toolkit 3.1
GPU0 GeForce GTX 465, 810 MHz, 994 MB VRAM, Compute 2.0 (single,double)
GPU1 Tesla C1060, 1296 MHz, 4059 MB VRAM, Compute 1.3 (single,double)
grubin698
 
Posts: 140
Joined: Mon Dec 08, 2008 2:23 pm

Re: GPU support in MATLAB R2010b

Postby pavanky » Thu Sep 09, 2010 1:06 pm

Dr. Larsen,

Thank you for providing the benchmark so quickly :-)

@grubin

on an off topic, is it (your laptop) an ASUS by any chance :D
Pavan Yalamanchili,
ArrayFire
--
~ If it is not broken, you have not tried hard enough ~
User avatar
pavanky
Site Admin
 
Posts: 1123
Joined: Mon Mar 15, 2010 7:39 pm
Location: Atlanta, GA

Re: GPU support in MATLAB R2010b

Postby grubin698 » Thu Sep 09, 2010 1:08 pm

Yep, that's the one.
Jacket v1.5.0 (build 8250)
Core i7-920
Matlab 2010b
CUDA driver 258.96, CUDA toolkit 3.1
GPU0 GeForce GTX 465, 810 MHz, 994 MB VRAM, Compute 2.0 (single,double)
GPU1 Tesla C1060, 1296 MHz, 4059 MB VRAM, Compute 1.3 (single,double)
grubin698
 
Posts: 140
Joined: Mon Dec 08, 2008 2:23 pm

Re: GPU support in MATLAB R2010b

Postby mli » Fri Sep 10, 2010 4:43 am

matlab 2010b doesn't support for qr and svd; for me, it's a big drawback.
2x Xeon x5560, 32G
4x Tesla C1060

GPU vs. CPU, generally 16x on speed
mli
 
Posts: 8
Joined: Tue Aug 24, 2010 5:04 am

Re: GPU support in MATLAB R2010b

Postby Lars1 » Sat Sep 18, 2010 10:16 am

Hi again.

I have updated the benchmarks using Jacket 1.5.0 - and to be more favorable to MATLAB I completely separate all Jacket and MATLAB-GPU computations. When using the GPU it seems as if Jacket and MATLAB-GPU fight for resources. So when using MATLAB-GPU it is best not to even include the path to Jacket - or at least be very careful that you don't even use as much as a ginfo before using MATLAB-GPU.

With these things being obeyed the result for double precision floating point performance is as shown below (red = MATLAB using the CPU; blue = MATLAB using the GPU; green = Jacket):

i7x975_C2050_flopsDGeMMplt_01a.jpg
i7x975_C2050_flopsDGeMMplt_01a.jpg (181.61 KiB) Viewed 5405 times


The result seems to be pretty much the same as I did with Jacket 1.4.1.

More information and figures can be found at: http://wiki.accelereyes.com/wiki/index.php/GPU_Support_In_MATLAB_R2010b_Versus_Jacket.

Torben
--
Editor of "Torben's Corner" - http://wiki.accelereyes.com/wiki/index.php/Torben's_Corner
Cluster: 2 x X5670 + 20 x X5570 | 18 x C2070 & 15 x GTX580
Colfax CXT2000i: GTX465 & GTX580 | FX3800 & 4000 | C1060 & C2050
Lars1
 
Posts: 140
Joined: Thu Jul 23, 2009 7:28 am

Re: GPU support in MATLAB R2010b

Postby shanevic7 » Mon Jul 30, 2012 5:05 pm

pavanky wrote:Dr. Larsen,

Thank you for providing the benchmark so quickly :-)

@grubin

on an off topic, is it (your laptop) an ASUS by any chance :D



lol i guess he hasnt tried hard enough :D




____________________________________________

Caroline County Music.com
shanevic7
 
Posts: 1
Joined: Fri Jul 27, 2012 4:31 pm


Return to Programming & Development with ArrayFire