Re: [閒聊] 如何繞過matlab 弱化AMD CPU功能

作者: takahashikag (那來自某島的蘇州軍部長)   2019-11-29 14:08:00
: 推 a58524andy : 懶人包:if amd ignore avx2 sse3 sse4 11/28 11:35
: → windrain0317: 就matlab用了intel mkl啊 11/28 11:39
: → a58524andy : 裡面是說mkl開哪些指令是依據vendor而非指令列表 11/28 11:40
: → a58524andy : 所以用一些環境變數硬讓他開起來ryzen就扳回一城惹 11/28 11:41
: → a58524andy : 測試結果來說i+mkl還是有些優勢啦,像是矩陣乘法那 11/28 11:42
: → a58524andy : 項,18c36t的10980xe還是贏過24c48t的3960x 11/28 11:43
: → a58524andy : 3970x才贏過10980xe 11/28 11:43
: 推 ariadne : AMD也可以自己出MKL 這方面intel真的有下成本 11/28 11:47
: 推 doom3 : 對手CPU只用SSE1 也太針對了吧 11/28 13:34
: 推 twosheep0603: numpy系列好像也有MKL的問題 改參數會起飛XD 11/28 15:31
: → pig : 堆土機時代根本不會有人在乎這個啊 AVX1/2 有開跟沒 11/28 15:42
: → pig : 開差不了多少吧 XD 11/28 15:43
: → pig : 到了 zen 才開始有人注意,用的人多了自然就會改正 11/28 15:44
有玩機械學習寫 Python Code 的,如果換香香機應該也會想:
喵的怎麼有時候 3700x 跑不贏不知到多少年前的 E3-1230v2
對,我就是跑 SVM 跟 Naive Bayes 時越想越不對勁
然後我找到了 Reddit 討論串跟 GitHub 上的資源
http://bit.ly/2L3w5Fy , Reddit, Ryzen and Intel's Anti-competitive MKL
http://bit.ly/2R0sD2j , Ryzen 3900X vs Intel Xeon 2175W, Python numpy
重點就是這段,尤其開發環境是 Anaconda 的用戶應該連署去逼社群改寫這種垃圾奧步
Intel's MKL check the CPUID is GenuineIntel or not, if detected the non-intel cpu, MKL will choose the "maximum capability" code (i.e. SSE2 - slowset) Intel's "cripple AMD" function Anaconda's numpy use Intel TBB instead of OpenMP, Intel TBB use the intel's proprietary method to detect the CPU or NUMA topology, in this situation zen's SMT will be recognize to the real core, it hurt the ALU performance.
GitHub 上有改善方案,但我怕把 Anaconda 炸掉所以觀望
http://bit.ly/34vjvqr
但光是用 n_jobs 這個參數去強迫 sklearn 使用 Ryzen 的所有核心,都能把原來的運算時間壓縮到 20% 甚至更少
https://i.imgur.com/Dqfz9ta.png
https://i.imgur.com/XAua4cn.png
這招真的是 intel 效能輸人家的時候最愛在編譯器搞的爛招
我想應該最早可以追溯到 2000 前後的 3DMark,就是那個 Pentium4 被 Athlon 鎚爆的時代
對, AMD Ryzen 的 Python Performance 就是輸在 intel 把二十年前的爛招回鍋
作者: twosheep0603 (兩羊)   2019-11-29 15:11:00
一次釣出兩隻XDDD
作者: windrain0317 (你在大聲啥)   2019-11-29 19:28:00
文中測試numpy,intel就靠AVX512衝的

Links booklink

Contact Us: admin [ a t ] ucptt.com