MatlabGPUOnStheno

From NJIT-ARCS HPC Wiki
Jump to: navigation, search

Matlab GPU/CPU benchmark on Stheno. Matlab completely abstracts all of the CUDA programming.

Here is the submit script  :

#!/bin/sh
#$ -N MatlabCudaTest
#$ -m be
#$ -cwd
#$ -r y
#$ -S /bin/bash
#$ -q gpu
#$ -l gpu=1
/afs/cad/sw.common/matlab-2013a/bin/matlab -nodisplay -nosplash < par.m > par.out

par.m contains a single line to run the benchmark --

paralleldemo_gpu_backslash(.75);

And the output, par.out: <poem>

                      Copyright 1984-2013 The MathWorks, Inc.
                         R2013a (8.1.0.604) 64-bit (glnxa64)
                                 February 15, 2013

To get started, type one of these: helpwin, helpdesk, or demo. For product information, visit www.mathworks.com.

>> Starting benchmarks with 13 different single-precision matrices of sizes ranging from 1024-by-1024 to 13312-by-13312. Creating a matrix of size 1024-by-1024. Gigaflops on CPU: 16.845929 Gigaflops on GPU: 53.585356 Creating a matrix of size 2048-by-2048. Gigaflops on CPU: 60.954733 Gigaflops on GPU: 177.429189 Creating a matrix of size 3072-by-3072. Gigaflops on CPU: 68.522518 Gigaflops on GPU: 316.259931 Creating a matrix of size 4096-by-4096. Gigaflops on CPU: 83.908704 Gigaflops on GPU: 421.171042 Creating a matrix of size 5120-by-5120. Gigaflops on CPU: 98.830398 Gigaflops on GPU: 526.903875 Creating a matrix of size 6144-by-6144. Gigaflops on CPU: 93.423921 Gigaflops on GPU: 625.897096 Creating a matrix of size 7168-by-7168. Gigaflops on CPU: 105.997166 Gigaflops on GPU: 698.977554 Creating a matrix of size 8192-by-8192. Gigaflops on CPU: 111.420164 Gigaflops on GPU: 764.041197 Creating a matrix of size 9216-by-9216. Gigaflops on CPU: 94.480876 Gigaflops on GPU: 798.531842 Creating a matrix of size 10240-by-10240. Gigaflops on CPU: 122.948224 Gigaflops on GPU: 811.839000 Creating a matrix of size 11264-by-11264. Gigaflops on CPU: 124.101765 Gigaflops on GPU: 878.004609 Creating a matrix of size 12288-by-12288. Gigaflops on CPU: 145.603363 Gigaflops on GPU: 889.438601 Creating a matrix of size 13312-by-13312. Gigaflops on CPU: 130.250488 Gigaflops on GPU: 927.771801 Starting benchmarks with 9 different double-precision matrices of sizes ranging from 1024-by-1024 to 9216-by-9216. Creating a matrix of size 1024-by-1024. Gigaflops on CPU: 22.351022 Gigaflops on GPU: 37.265635 Creating a matrix of size 2048-by-2048. Gigaflops on CPU: 33.862460 Gigaflops on GPU: 105.625221 Creating a matrix of size 3072-by-3072. Gigaflops on CPU: 41.713053 Gigaflops on GPU: 198.270736 Creating a matrix of size 4096-by-4096. Gigaflops on CPU: 48.845312 Gigaflops on GPU: 269.020596 Creating a matrix of size 5120-by-5120. Gigaflops on CPU: 57.916974 Gigaflops on GPU: 343.498641 Creating a matrix of size 6144-by-6144. Gigaflops on CPU: 56.732443 Gigaflops on GPU: 397.953688 Creating a matrix of size 7168-by-7168. Gigaflops on CPU: 56.117345 Gigaflops on GPU: 445.957221 Creating a matrix of size 8192-by-8192. Gigaflops on CPU: 59.685426 Gigaflops on GPU: 480.363818 Creating a matrix of size 9216-by-9216. Gigaflops on CPU: 61.639674 Gigaflops on GPU: 511.641013 </poem>

The data is plotted below :

File:Matlab gpu single.jpg

File:Matlab gpu double.jpg


Information on Matlab GPU programming