Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10012

Speed of Mathematica on AMD machines

From einschlag@gmail.com
Newsgroups comp.soft-sys.math.mathematica
Subject Speed of Mathematica on AMD machines
Date 2012-05-10 08:59 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jog00v$g1d$1@smc.vnet.net> (permalink)

Show all headers | View raw


We have recently bought an iBuyPower gaming PC for our research group:

AMD FX 8 core, 3.6 GHz, 16 GB RAM

MathematicaMark8 Benchmark 0.86 is not bad, considering the price ~$800 of this PC but I was expecting much more.

Apparently Intel's MKL library used by Mathematica is not optimized for AMD processors.

A test program calculating exponentials of large matrices takes 13 s on the AMD PC and only 8 s on my Mac Pro (Mathematica benchmark 0.7) that has 8 Intel Xeon cores at 2.4 GHz. And on my Lenovo laptop the program runs 9 s. I blame it on the MKL inadequacy for AMD.

TestProgram := Module[{},
  NN = 1000;
  AMatr = Table[RandomReal[], {i, 1, NN}, {j, 1, NN}];
  NExec = 10;
  For[i = 1, i < NExec, i++,
   MatrixExp[AMatr];
   ];
  ]

Execution by iBuyPower PC (AMD FX 8 core, Linux Ubuntu 64 bit)

TestProgram // AbsoluteTiming

{13.230105, Null}

Execution by Mac Pro (Intel Xeon 2 x 4 core)

TestProgram // AbsoluteTiming

{8.126944, Null}

Execution by Lenovo laptop (Intel i7-QM2060, Windows 7 64 bit)

TestProgram // AbsoluteTiming

{9.4275392, Null}


On the other hand, a program compiling in C from Mathematica's help runs very fast on the AMD PC:

TestProgram2 := Module[{},
  c = Compile[ {{x, _Real}, {n, _Integer}},
    	Module[ {sum, inc}, sum = 1.0; inc = 1.0;
     Do[inc = inc*x/i; sum = sum + inc, {i, n}]; sum],
    CompilationTarget -> "C"];
  c[1.6, 10000000];
  ]

Execution by iBuyPower PC (AMD FX 8 core, Linux Ubuntu 64 bit, GCC compiler)

TestProgram2 // AbsoluteTiming

{0.114427, Null}

Execution by Mac Pro (Intel Xeon 2 x 4 core, GCC compiler)

TestProgram2 // AbsoluteTiming

{0.212875, Null}

Execution by Lenovo laptop (Intel i7-QM2060, Windows 7 64 bit, Microsoft Visual C++)

TestProgram2 // AbsoluteTiming

{0.3540203, Null}

It seems the second test program is not using MKL and thus AMD becomes very efficient.

I will continue testing.

Is there any way to improve Mathematica's performance on AMD machines?

Dmitry

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Speed of Mathematica on AMD machines einschlag@gmail.com - 2012-05-10 08:59 +0000
  Re: Speed of Mathematica on AMD machines "Oleksandr Rasputinov" <oleksandr_rasputinov@ymail.com> - 2012-05-11 04:13 +0000
    Re: Speed of Mathematica on AMD machines A Retey <awnl@gmx-topmail.de> - 2012-05-12 08:51 +0000
    Re: Speed of Mathematica on AMD machines "Oleksandr Rasputinov" <oleksandr_rasputinov@ymail.com> - 2012-05-13 07:05 +0000
    Re: Speed of Mathematica on AMD machines einschlag@gmail.com - 2012-05-16 08:24 +0000

csiph-web