拿到新款 mbp 的 v 友,有兴趣的话能测一下 numpy scipy 的 benchmark 嘛

2021 年 11 月 5 日
 astrophys

测试脚本: https://gist.github.com/markus-beuckelmann/8bc25531b11158431a5b09a45abd6276

很好奇这一代 M1 Pro Max 在 Python 科学计算上的提升有多大,之前 v 友测的上一代 M1 的算力在不谈功耗的情况下大概和 i5 互有胜负: https://v2ex.com/t/733777

4881 次点击
所在节点    MacBook Pro
33 条回复
rpman
2021 年 11 月 5 日
apple silicon 的支持还在修修补补阶段, 要用可以自己找 commit 去编译
thedrwu
2021 年 11 月 6 日
本地们调试能画图就行,运算丢给服务器和超算了
astrophys
2021 年 11 月 6 日
@thedrwu 就是因为只在本地画图我才只关心 python ,有时候画点复杂的图还是需要点算力的😂
yangbin9317
2021 年 11 月 6 日
Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz

Dotted two 4096x4096 matrices in 0.34 s.
Dotted two vectors of length 524288 in 0.02 ms.
SVD of a 2048x1024 matrix in 1.03 s.
Cholesky decomposition of a 2048x2048 matrix in 0.61 s.
Eigendecomposition of a 2048x2048 matrix in 9.66 s.
20015jjw
2021 年 11 月 6 日
16c mac pro / 96g

Dotted two 4096x4096 matrices in 0.28 s.
Dotted two vectors of length 524288 in 0.02 ms.
SVD of a 2048x1024 matrix in 0.56 s.
Cholesky decomposition of a 2048x2048 matrix in 0.07 s.
Eigendecomposition of a 2048x2048 matrix in 4.00 s.

我比较好奇的是,这么小规模的测试,误差很大吧...
20015jjw
2021 年 11 月 6 日
@20015jjw 再跑了一次

Dotted two 4096x4096 matrices in 0.26 s.
Dotted two vectors of length 524288 in 0.02 ms.
SVD of a 2048x1024 matrix in 0.50 s.
Cholesky decomposition of a 2048x2048 matrix in 0.07 s.
Eigendecomposition of a 2048x2048 matrix in 3.77 s.

第三个相差都 10%了...
两次前后跑的,该跑的东西啥都没关
astrophys
2021 年 11 月 6 日
@20015jjw 差个 10%无所谓,主要是看有没有大于 10%的明显差距
MongkeMary
2021 年 11 月 6 日
16 寸低配 MBP M1 Pro 10 核

Dotted two 4096x4096 matrices in 0.56 s.
Dotted two vectors of length 524288 in 0.25 ms.
SVD of a 2048x1024 matrix in 0.67 s.
Cholesky decomposition of a 2048x2048 matrix in 0.08 s.
Eigendecomposition of a 2048x2048 matrix in 6.88 s.
MongkeMary
2021 年 11 月 6 日
@astrophys 有没有 MKL 还是很关键的,这种运输 openblas 的性能和 MKL 还是有差距的
astrophys
2021 年 11 月 6 日
@MongkeMary 是的呀,m1 的话就看有没有用 accelerate framework 了
Aspector
2021 年 11 月 8 日
shinecurve
2021 年 11 月 12 日
暗影精灵 7
i7-11800H

Dotted two 4096x4096 matrices in 0.39 s.
Dotted two vectors of length 524288 in 0.05 ms.
SVD of a 2048x1024 matrix in 0.26 s.
Cholesky decomposition of a 2048x2048 matrix in 0.08 s.
Eigendecomposition of a 2048x2048 matrix in 2.57 s.

给大家做一个参考
lqcc
2021 年 12 月 4 日
M1 macbook air ,用的 accelerate 库编译的 numpy ,速度还可以。


Dotted two 4096x4096 matrices in 0.60 s.
Dotted two vectors of length 524288 in 0.11 ms.
SVD of a 2048x1024 matrix in 0.52 s.
Cholesky decomposition of a 2048x2048 matrix in 0.06 s.
Eigendecomposition of a 2048x2048 matrix in 5.98 s.

This was obtained using the following Numpy configuration:
blas_mkl_info:
NOT AVAILABLE
blis_info:
NOT AVAILABLE
openblas_info:
NOT AVAILABLE
accelerate_info:
extra_compile_args = ['-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
blas_opt_info:
extra_compile_args = ['-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
lapack_mkl_info:
NOT AVAILABLE
openblas_lapack_info:
NOT AVAILABLE
openblas_clapack_info:
NOT AVAILABLE
flame_info:
NOT AVAILABLE
lapack_opt_info:
extra_compile_args = ['-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
Supported SIMD extensions in this NumPy install:
baseline = NEON,NEON_FP16,NEON_VFPV4,ASIMD
found = ASIMDHP,ASIMDDP,ASIMDFHM
not found =

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://study.congcong.us/t/813232

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX