MAGMA  1.7.0
Matrix Algebra for GPU and Multicore Architectures
 All Classes Files Functions Friends Groups Pages
run_tests.py File Reference

Detailed Description

Author
Mark Gates

Script to run testers with various matrix sizes. Small sizes are chosen around block sizes (e.g., 30...34 around 32) to detect bugs that occur at the block size, and the switch over from LAPACK to MAGMA code. Tall and wide sizes are chosen to exercise different aspect ratios, e.g., nearly square, 2:1, 10:1, 1:2, 1:10. The -h or –help option provides a summary of the options.

Non-interactive vs. interactive mode

When output is redirected to a file, it runs in non-interactive mode, printing a short summary to stderr on the console and all other output to the file. For example:

  ./run_tests.py --lu --precision s --small > lu.txt
  testing_sgesv_gpu -c                      ok
  testing_sgetrf_gpu -c2                    ok
  testing_sgetf2_gpu -c                     ok
  testing_sgetri_gpu -c                     ** 45 tests failed
  testing_sgetrf_mgpu -c2                   ok
  testing_sgesv -c                          ok
  testing_sgetrf -c2                        ok

  ****************************************************************************************************
  summary
  ****************************************************************************************************
    282 tests in 7 commands passed
     45 tests failed accuracy test
      0 errors detected (crashes, CUDA errors, etc.)
  routines with failures:
      testing_sgetri_gpu -c

When output is to console (tty), it runs in interactive mode, pausing after each test. At the pause, typing "M" re-makes and re-runs that tester, while typing enter goes to the next tester. For example (some output suppressed with ... for brevity):

  ./run_tests.py --lu --precision s --small
  ****************************************************************************************************
  ./testing_sgesv_gpu -c --range 1:20:1 ...
  ****************************************************************************************************
      N  NRHS   CPU GFlop/s (sec)   GPU GFlop/s (sec)   ||B - AX|| / N*||A||*||X||
  ================================================================================
      1     1     ---   (  ---  )      0.00 (   0.00)   9.26e-08   ok
      2     1     ---   (  ---  )      0.00 (   0.00)   1.32e-08   ok
      3     1     ---   (  ---  )      0.00 (   0.00)   8.99e-09   ok
  ...
    ok
  [enter to continue; M to make and re-run]

  ****************************************************************************************************
  ./testing_sgetri_gpu -c --range 1:20:1 ...
  ****************************************************************************************************
  % MAGMA 1.4.0 svn compiled for CUDA capability >= 3.0
  % CUDA runtime 6000, driver 6000. MAGMA not compiled with OpenMP.
  % device 0: GeForce GT 750M, 925.5 MHz clock, 2047.6 MB memory, capability 3.0
  Usage: ./testing_sgetri_gpu [options] [-h|--help]

      N   CPU GFlop/s (sec)   GPU GFlop/s (sec)   ||R||_F / (N*||A||_F)
  =================================================================
      1      0.00 (   0.00)      0.00 (   0.00)   6.87e+01   failed
      2      0.00 (   0.00)      0.00 (   0.00)   2.41e+00   failed
      3      0.01 (   0.00)      0.00 (   0.00)   1.12e+00   failed
  ...
    ** 45 tests failed
  [enter to continue; M to make and re-run]

  ...

  ****************************************************************************************************
  summary
  ****************************************************************************************************
    282 tests in 7 commands passed
     45 tests failed accuracy test
      0 errors detected (crashes, CUDA errors, etc.)
  routines with failures:
      testing_sgetri_gpu -c

What tests are run

The –blas, –aux, –chol, –hesv, –lu, –qr, –syev, –sygv, –geev, –svd, –batched options run particular sets of tests. By default, all tests are run. –mgpu runs only multi-GPU tests from the above sets.

The –start option skips all testers before the given one, then continues with testers from there. This is helpful to restart a non-interactive set of tests. For example:

  ./run_tests.py --start testing_spotrf > output.log

If specific testers are named on the command line, only those are run. For example:

  ./run_tests.py testing_spotrf testing_sgetrf

The -p/–precision option controls what precisions are tested, the default being "sdcz" for all four precisions. For example, to run single and double:

  ./run_tests.py -p sd

The -s/–small, -m/–medium, -l/–large options control what sizes are tested, the default being all three sets. -s/–small does small tests, N < 300. -m/–medium does medium tests, N < 1000. -l/–large does large tests, N > 1000. For example, running small and medium tests:

  ./run_tests.py -s -m

What is checked

The –memcheck option runs cuda-memcheck. This is very helpful for finding memory bugs (reading & writing outside allocated memory). It is, however, slow.

The –tol option sets the tolerance to verify accuracy. This is 30 by default, which may be too tight for some testers. Setting it somewhat higher (e.g., 50 or 100) filters out spurious accuracy failures.

The –dev option sets which GPU device to use.