How to tune MAGMA to get higher performance

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)
Post Reply
ning_an
Posts: 9
Joined: Mon Jul 27, 2015 11:56 am

How to tune MAGMA to get higher performance

Post by ning_an » Wed Aug 05, 2015 6:28 pm

Dear Developer,

I have a big memory computer, and install MAGMA 1.6.2. Its configuration is shown in the below.

Code: Select all

Computer Configuration:
=====================
     Processor:    Intel(R) Xeon CPU E5-2687W 0@3.10GHz (2 Processors)
	 Memory(RAM):  512GB
	 System Type:   64-bit OS, Windows 8.1Pro
	 Graphics Card:  2
	             GeForce GTX 980, 1215.5 MHz, 4096.0 MB , capability 5.2 (for computing)
			       GeForce GTX 750 Ti, 1254.5 MHz, 2048.0 MB, capability 5.0 (for display)
     CUDA:           CUDA 7.0 
     MKL:            Intel MKL 11.0.5
     Compiler:       Visual Studio 2013 Community version

I run testing example, testing_zpotri. The output of the test is shown in the below.

Code: Select all

D:\magma\build\testing\Release>testing_zpotri.exe --lapack --range 1088:15424:1024
MAGMA 1.6.2  compiled for CUDA capability >= 2.0
CUDA runtime 7000, driver 7050. OpenMP threads 32. MKL 11.0.5, MKL threads 16.
ndevices 2
device 0: GeForce GTX 980, 1215.5 MHz clock, 4096.0 MB memory, capability 5.2
device 1: GeForce GTX 750 Ti, 1254.5 MHz clock, 2048.0 MB memory, capability 5.0

Usage: testing_zpotri.exe [options] [-h|--help]

uplo = Lower
    N   CPU GFlop/s (sec)   GPU GFlop/s (sec)   ||R||_F / ||A||_F
=================================================================
 1088     27.52 (   0.13)     44.03 (   0.08)   1.92e-020   ok
 2112     39.25 (   0.64)     76.62 (   0.33)   9.49e-021   ok
 3136     52.14 (   1.58)     89.26 (   0.92)   4.69e-021   ok
 4160     52.30 (   3.67)     94.55 (   2.03)   3.95e-021   ok
 5184     58.43 (   6.36)     98.68 (   3.77)   2.77e-021   ok
 6208     58.93 (  10.83)    101.85 (   6.27)   2.13e-021   ok
 7232     64.89 (  15.55)    104.64 (   9.64)   1.79e-021   ok
 8256     72.33 (  20.75)    106.61 (  14.08)   1.76e-021   ok
 9280     64.65 (  32.97)    107.75 (  19.78)   1.43e-021   ok
10304     64.88 (  44.97)    108.56 (  26.88)   1.25e-021   ok
11328     68.54 (  56.57)    109.59 (  35.38)   1.10e-021   ok
12352     68.72 (  73.15)    109.89 (  45.74)   1.00e-021   ok
13376     67.50 (  94.55)    108.66 (  58.74)   9.21e-022   ok
14400     66.23 ( 120.24)    107.13 (  74.33)   8.76e-022   ok
15424     65.36 ( 149.73)    105.56 (  92.71)   8.32e-022   ok
The speed-up is not so high as I saw in MAGMA poster. It looks 3 ~ 4 times faster than LAPACK. Here the spped-up is less than 2 times.

The reason may be the some parameters are not set well. Please tell me how to tune the code and environment variables to achieve higher performance.

Thanks.

Ning

mgates3
Posts: 918
Joined: Fri Jan 06, 2012 2:13 pm

Re: How to tune MAGMA to get higher performance

Post by mgates3 » Fri Sep 11, 2015 3:29 am

Please run

testing_sgemm
testing_dgemm
testing_cgemm
testing_zgemm

You can try with --dev 0 and --dev 1 to get for each card. That will give you a good idea of the speed of your cards. What is the published single and double precision performance of those cards?

Also, you should set OMP_NUM_THREADS to 16, though it looks like MKL sets its number of threads correctly. Hyperthreading does not help dense linear algebra.

Per the README, you can tune the block sizes in control/get_nb.cpp. You might try smaller values that are multiples of 32, such as 64, 96, 128.

-mark

Post Reply