You are not logged in.

#26 2013-07-23 22:14:47

Nisstyre56
Member
From: Canada
Registered: 2010-03-25
Posts: 85

Re: Arch Linux vs Ubuntu 13.04 64-bit for Python-based simulation

darkmav wrote:
drcouzelis wrote:

Well, Ubuntu does offer OpenBLAS and ATLAS as dependencies of numpy. I'd say if you login to your Ubuntu installation and check which packages are installed then your original question in this thread will be pretty much as good as solved.

Did you have to disable CPU throttling somehow to get it to work? Ref: http://www.linuxquestions.org/questions … -a-806430/

Are you using cpu frequency scaling at all?

See: https://wiki.archlinux.org/index.php/CP … cy_Scaling

Last edited by Nisstyre56 (2013-07-23 22:17:36)


In Zen they say: If something is boring after two minutes, try it for four. If still boring, try it for eight, sixteen, thirty-two, and so on. Eventually one discovers that it's not boring at all but very interesting.
~ John Cage

Offline

#27 2013-07-24 02:13:40

darkmav
Member
Registered: 2012-01-21
Posts: 127

Re: Arch Linux vs Ubuntu 13.04 64-bit for Python-based simulation

Nisstyre56 wrote:
darkmav wrote:
drcouzelis wrote:

Well, Ubuntu does offer OpenBLAS and ATLAS as dependencies of numpy. I'd say if you login to your Ubuntu installation and check which packages are installed then your original question in this thread will be pretty much as good as solved.

Did you have to disable CPU throttling somehow to get it to work? Ref: http://www.linuxquestions.org/questions … -a-806430/

Are you using cpu frequency scaling at all?

See: https://wiki.archlinux.org/index.php/CP … cy_Scaling

Yes, apparently I am. The error message was from my system to be sure, but I checked the wiki page you linked to.

Offline

#28 2013-07-26 05:22:38

darkmav
Member
Registered: 2012-01-21
Posts: 127

Re: Arch Linux vs Ubuntu 13.04 64-bit for Python-based simulation

Radfahrer wrote:

If you make heavy use of Matrix operations in numpy the execution speed depends stronly on the underlying BLAS implementation used for the compilation of numpy.
I think the Archlinux numpy version is build against the reference BLAS version, which is extremely slow, while the Ubuntu version is build against the Atlas BLAS version and should be faster.
So I am pretty sure the difference in execution time comes from the different blas implementations.
You could try different numpy versions from the AUR build against faster blas implementations like the intel mkl or openblas.

So I now have the ATLAS implementation of numpy on Arch on my laptop, which also has  kernel version 3.10.2-1. The execution time for a matrix multiplication A*B*Adagger has gone down from ~24 minutes to 23.878 minutes. Hardly an improvement.

Also, when I installed python2-numpy-atlas, it explicitly removed python2-numpy which it was conflicting with. So I'm certain it is the ATLAS implementation that is being used.

Any ideas?

I need to run lots of different versions of this code on both my systems in parallel so bringing the execution time down from 23 minutes to 3.4 minutes (which is about the time it takes on my older desktop, with Ubuntu) would really help without having to switch to Ubuntu on the laptop.

Offline

#29 2013-07-26 10:12:38

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Arch Linux vs Ubuntu 13.04 64-bit for Python-based simulation

darkmav wrote:

Also, when I installed python2-numpy-atlas, it explicitly removed python2-numpy which it was conflicting with. So I'm certain it is the ATLAS implementation that is being used.

Any ideas?

Yeah... I thought you were using Python 3. tongue

Offline

#30 2013-07-26 11:12:07

darkmav
Member
Registered: 2012-01-21
Posts: 127

Re: Arch Linux vs Ubuntu 13.04 64-bit for Python-based simulation

Yeah sorry, I couldn't find anything for Python3 on the AUR (or maybe I missed it?) so I just started using Python2.7. Doesn't seem to make any difference though.

Offline

#31 2013-07-26 12:00:01

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Arch Linux vs Ubuntu 13.04 64-bit for Python-based simulation

darkmav wrote:

Yeah sorry, I couldn't find anything for Python3 on the AUR (or maybe I missed it?) so I just started using Python2.7. Doesn't seem to make any difference though.

python-numpy-atlas

I don't know if it'll make a difference either, but at least it should make for a more even comparison.

Offline

#32 2013-08-08 21:53:46

Brcher
Member
Registered: 2011-06-20
Posts: 36

Re: Arch Linux vs Ubuntu 13.04 64-bit for Python-based simulation

darkmav wrote:

Sorry if this is a dumb question, but how do I check to ensure they're not swapping?

Personally I would just do "sudo swapoff -a" and see if it crashes.

Does anyone have a benchmark that shows 10x speedup from ref. blas to atlas? That is pretty dramatic. I couldn't find any with googling. Also, perhaps you could time each section of your code and find which really has the big slowdown?
I don't know enough about python to know if it makes any difference, so sorry if this is a dumb comment, but the way you've done the multiply of C by Bd, it happens mostly in python. Perhaps there could be some dramatic optimization difference between python2 and python3? (I'm assuming dot calls blas, so the python versions shouldn't matter there...)

AlsoAlso, unrelated to the ubuntu/arch issue, in straight up blas you could probably skip the

C=copy(A)

and

Adag = conjugate(transpose(A))

by telling the zgemm (or whatever) function that you want the argument to be conjugate-transpose:
http://www.netlib.org/blas/zgemm.f
That'd save you a copy of your entire dataset, and the transposing. Unless python does some clever optimizations (in which case I guess the version of python becomes important again...).

Also^3, just to be sure, maybe you could use the python2 and python3 explicitly? (you can call python2 or python3 from bash)

Last edited by Brcher (2013-08-08 21:58:12)

Offline

#33 2013-08-14 11:46:46

windows_me
Member
From: England
Registered: 2013-08-14
Posts: 36
Website

Re: Arch Linux vs Ubuntu 13.04 64-bit for Python-based simulation

I haven't looked at your code yet, but given common causes of performance differences in scientific code:
As for Ubuntu vs. Arch, maybe try building Python/Numpy/etc from source on each distro so that both builds are using all the available CPU features (SSE/AVX/CMOV, etc).

You'd be surprised how much some small companies who are more "scientist" than "programmer" will pay for you to basically enable SSE in their compiler options and add a few prefetch instructions, provided all they see is the four-fold performance improvement!

Last edited by windows_me (2013-08-14 11:48:04)


[10:04:21] Time for weekly full server backup.
[10:04:25] Redirecting it to "/dev/null" to make it go faster.
[10:04:53] Backup done! Amazing how fast modern technology is!

Offline

Board footer

Powered by FluxBB