Scripts/Simple AVX Benchmark

From J Wiki
Jump to navigation Jump to search

Download Avxbench.ijs

Notes

Running this benchmark is simple:

  • Select the system and J version you want to test.
  • Load the script.
  • Run make_data to create the file named 'data_avx' containing the test data.
  • Run run_tests 'description' to run the tests and save the results as a file named 'test_avx_',description.
  • Move the data file, if needed, to a different system to benchmark.
  • Run run_tests 'description' to run the tests and save the results as a file named 'test_avx_',description.
  • Gather the two test output files on one system.
  • Run test_avx_test1' show_tests 'test_avx_test2', where these file names match the test output file names created in the previous steps.

This will display an enclosed result using a similar format as used on the following jprogramming forum posting. This description was used as a basis for the code posted here.

Scripts/AVG Benchmark results Here are results from the posted benchmark.

2017 3 11 16 10
j806/j64avx/linux/beta-1/commercial/www.jsoftware.com/2017-
03-09T10:14:43
i7-7700Q

N in tables below indicate new avx JE runs N times faster than 805
b=: (<.-:#a)+ c ?. c [ a=: C ?. C                 NB. intsr
b=: (c?.#a){a [ a=: C ?@$ <:2^63                  NB. intbr
b=: (c?.#a){a [ a=: >,.~":each <"0 [C ?@$ <:2^63  NB. char
b=: 0.1+(c?.#a){a [ a=: 0.1+C ?@$ <:2^63          NB. float
intsr (small range) special code avoids hash - intbr (big range)
float0 tests use !.0 where appropriate

'C c'=: 10000000 1000
intsr intbr char  float float0 test
    1.3   2.0   4.1   1.0   3.5  a i. a
   12.8  10.4  25.5   2.1  20.2  a i. b
    3.4   7.3   8.6   5.1  10.7  b i. a
    5.2   8.0   9.0   5.3  12.9  a e. b
    6.4  10.4  25.3   2.1  20.2  b e. a
    5.3   8.8   9.5   5.1  13.1  a (+/@:e.) b
    4.4   6.4   9.4  38.2  12.9  a (e. i. 1:) b
    1.7   1.9   3.8   1.0   1.0  ~.a
    1.6   2.1   4.1   1.0   1.0  ~:a
    1.1   0.9   1.4   1.1   0.0  /:a
    1.2   0.6   1.3   1.0   0.0  /:~a

'C c'=: 100000 1000
intsr intbr char float float0 test
   1.5   3.5   5.3  1.1   4.6   a i. a
   3.4   4.7   9.3  3.1   7.1   a i. b
   3.9   8.1   8.7  5.0  12.1   b i. a
   4.4   7.5   9.1  5.3  12.6   a e. b
   2.6   4.8   9.2  3.1   6.8   b e. a
   4.4   8.4   9.5  5.2  12.9   a (+/@:e.) b
   1.5   4.3   7.8 20.7  12.7   a (e. i. 1:) b
   1.0   3.3   4.7  1.1   1.1   ~.a
   1.3   3.5   5.2  1.2   1.1   ~:a
   1.7   1.3   1.3  1.2   0.0   /:a
   1.6   1.4   1.3  1.2   0.0   /:~a

matrix multiply
   4.5   a +/ . * b