我“双启动”Ubuntu 11.04、Ubuntu 12.04 和 Windows XP SP3 均已更新至最新版本。PC 是相当旧的 Intel Celeron D CPU 3.06GHz 和 2GB RAM
在 Ubuntu 11.04 中,我使用 ATLAS 编译了 Numpy(ATLAS 从源代码编译)
在 Ubuntu 12.04 中,我使用最新可用的 MKL、icc、ifort 构建了 Numpy
在 Windows XP 中,我使用 MKL 构建了 Numpy(来自 Christoph Gohlke 提供的 Python 包)
更多详细信息在这里:http ://pastebin.com/raw.php?i=wxuFbyVg
我试过很简单:
%timeit np.dot(np.ones((1000,1000)), np.ones((1000,1000)))
并得到了这个结果:
Ubuntu ATLAS: 1 loops, best of 3: 457 ms per loop
Windows MKL: 1 loops, best of 3: 680 ms per loop
Ubuntu MKL: 1 loops, best of 3: 1.04 s per loop
我认为上面是一个不好的例子,我搜索了许多可用比较中的一个,即第一个谷歌点击:http ://dpinte.wordpress.com/2010/01/15/numpy-performance-improvement-with-the-mkl/
我测试了相同的功能:
%timeit test_eigenvalue()
Ubuntu Atlas: 1 loops, best of 3: 6.38 s per loop
Windows MKL: 1 loops, best of 3: 2.22 s per loop
Ubuntu MKL: 1 loops, best of 3: 3.58 s per loop
%timeit test_svd()
Ubuntu Atlas: 1 loops, best of 3: 2.13 s per loop
Windows MKL: 1 loops, best of 3: 2.06 s per loop
Ubuntu MKL: 1 loops, best of 3: 3.09 s per loop
%timeit test_inv()
Ubuntu Atlas: 1 loops, best of 3: 964 ms per loop
Windows MKL: 1 loops, best of 3: 1.02 s per loop
Ubuntu MKL: 1 loops, best of 3: 1.59 s per loop
%timeit test_det()
Ubuntu Atlas: 1 loops, best of 3: 308 ms per loop
Windows MKL: 1 loops, best of 3: 322 ms per loop
Ubuntu MKL: 1 loops, best of 3: 491 ms per loop
%timeit test_dot()
Ubuntu Atlas: 1 loops, best of 3: 1.5 s per loop
Windows MKL: 1 loops, best of 3: 1.77 s per loop
Ubuntu MKL: 1 loops, best of 3: 2.77 s per loop
所以 ATLAS 编译的 Numpy 出于某种原因有最好的结果。
有谁知道可能是什么问题?