Message Boards Message Boards

GROUPS:

Performance degradation from 11.3,12.1.1,12.2.0 => 12.3.1 on Raspberry Pi

Posted 12 days ago
393 Views
|
6 Replies
|
17 Total Likes
|

I know that calculating the digits of Pi is something very specific and probably irrelevant to the real practical problems, but somehow it feels appropriate to quickly test the performance of Wolfram Mathematica, especially if the machine is actually called Raspberry Pi :)

So, here is the log of running AbsoluteTiming[N[Pi,10^6];] on a Raspberry Pi with different versions of Wolfram Mathematica, from which it is clear that 11.3, 12.1.1 and 12.2.0 give approximately the same timings, but 12.3.1 is substantially worse.

$ math11
Wolfram Language 11.3.0 Engine for Linux ARM (32-bit)
Copyright 1988-2018 Wolfram Research, Inc.

In[1]:= AbsoluteTiming[N[Pi,10^6];]
Out[1]= {2.03026, Null}

--------------------------------------------------------

$ math12.1
Mathematica 12.1.1 Kernel for Linux ARM (32-bit)
Copyright 1988-2020 Wolfram Research, Inc.

In[1]:= AbsoluteTiming[N[Pi,10^6];]           
Out[1]= {2.08772, Null}

--------------------------------------------------------
$ math12.2
Mathematica 12.2.0 Kernel for Linux ARM (32-bit)
Copyright 1988-2021 Wolfram Research, Inc.

In[1]:= AbsoluteTiming[N[Pi,10^6];]
Out[1]= {3.25156, Null}

--------------------------------------------------------
$ math
Mathematica 12.3.1 Kernel for Linux ARM (32-bit)
Copyright 1988-2021 Wolfram Research, Inc.

In[1]:= AbsoluteTiming[N[Pi,10^6];]
Out[1]= {7.66692, Null}
6 Replies

In the above I considered degradation of 12.2 (going from 2 to 3.25 seconds) negligible, but degradation of 12.3.1 (going from 2 to 7.67 seconds) substantial and deserving attention.

We'll take a look. Thanks for reporting this.

Thank you for reporting this issue, it should be corrected in our next release.

In the meantime, the following may be used as a workaround

$ sudo apt install libgmp10

$ sudo mv /opt/Wolfram/WolframEngine/12.3/SystemFiles/Libraries/Linux-ARM/libgmp.so.10 \
  /opt/Wolfram/WolframEngine/12.3/SystemFiles/Libraries/Linux-ARM/libgmp.so.10.bak

I noted that 11.3 is the fastest when computing the digits of the MRB constant too. I could add some benchmarks, if anyone wants them. (It would take about a day.)

Thank you. Strangely, on 12.2.0 it made things actually worse, see the log below. As you see from the log I have verified which library gets mapped into WolframKernel process' address space. I will test with the other versions as well and will let you know the result:

$ pwd
/opt/Wolfram/WolframEngine/12.2/SystemFiles/Libraries/Linux-ARM
$ sudo mv libgmp.so.10 libgmp.so.10.orig
$ apt list --installed | grep libgmp10

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libgmp10/oldstable,now 2:6.1.2+dfsg-4 armhf [installed]
$ wolfram
Mathematica 12.2.0 Kernel for Linux ARM (32-bit)
Copyright 1988-2021 Wolfram Research, Inc.

In[1]:= !grep libgmp /proc/$(pgrep WolframKernel)/maps
71522000-7158a000 r-xp 00000000 b3:02 271806     /usr/lib/arm-linux-gnueabihf/libgmp.so.10.3.2
7158a000-71599000 ---p 00068000 b3:02 271806     /usr/lib/arm-linux-gnueabihf/libgmp.so.10.3.2
71599000-7159a000 r--p 00067000 b3:02 271806     /usr/lib/arm-linux-gnueabihf/libgmp.so.10.3.2
7159a000-7159b000 rw-p 00068000 b3:02 271806     /usr/lib/arm-linux-gnueabihf/libgmp.so.10.3.2

In[2]:= AbsoluteTiming[N[Pi,10^6];]     

Out[2]= {4.58025, Null}

$ sudo mv libgmp.so.10.orig libgmp.so.10
$ wolfram
Mathematica 12.2.0 Kernel for Linux ARM (32-bit)
Copyright 1988-2021 Wolfram Research, Inc.

In[1]:= !grep libgmp /proc/$(pgrep WolframKernel)/maps      
71538000-71595000 r-xp 00000000 b3:02 394435     /opt/Wolfram/WolframEngine/12.2/SystemFiles/Libraries/Linux-ARM/libgmp.so.10
71595000-715a4000 ---p 0005d000 b3:02 394435     /opt/Wolfram/WolframEngine/12.2/SystemFiles/Libraries/Linux-ARM/libgmp.so.10
715a4000-715a5000 r--p 0005c000 b3:02 394435     /opt/Wolfram/WolframEngine/12.2/SystemFiles/Libraries/Linux-ARM/libgmp.so.10
715a5000-715a6000 rw-p 0005d000 b3:02 394435     /opt/Wolfram/WolframEngine/12.2/SystemFiles/Libraries/Linux-ARM/libgmp.so.10

In[2]:= AbsoluteTiming[N[Pi,10^6];]                

Out[2]= {3.28563, Null}

Oh yes, on 12.3.1 it made a HUGE improvement! The time went down from 7.67 to just 3.21 seconds, which is practically the same as 12.2, though still not as good as 11.3. Thank you very much for the workaround. Actually, I should have guessed it myself, as I use sympy which makes use of gmpy which relies on libgmp, as I always test a python installation with from sympy import * followed by %time a=pi.evalf(10**6) -- and, btw, it is always slower than Mathematica! And this is true also for Maple, Maxima and Reduce -- none of them even come close to Mathematica.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract