!Qulacs/M1 Mac M1(メモリ 8GB)なMac miniでQulacs動かしてみた. ::インストール * [Python3.9をHomebrewでM1 Macにインストールする(2021年3月16日時点)|https://as-chapa.hatenablog.com/entry/m1-python-install-20210316]を参考にPython 3.9をインストール * brewでgccとcmakeをインストール * /opt/homebrew/bin/{gcc-10,g++-10}を,それぞれ/opt/homebrew/bin/{gcc,g++}にシンボリックリンク * git clone https://github.com/qulacs/qulacs.git * cd qulacs * touch include/x86intrin.h # ごまかすため * CMakeLists.txtのDEFAULT_OPT_FLAGSの-mfpmath=bothを削除 * python setup.py install ::ベンチマーク動かす コミットしてあるベンチマーク(Xeon CPU E5-2687W v4 @ 3.00GHz x 2での実行)と M1での実行を比較する. sudo /opt/homebrew/bin/pip3 install pytest sudo /opt/homebrew/bin/pip3 install pytest-benchmark sudo /opt/homebrew/bin/pip3 install numpy sudo /opt/homebrew/bin/pip3 install matplotlib git clone https://github.com/qulacs/benchmark-qulacs cd benchmark-qulacs rm -rf `find . -name \*.json -print` cd benchmark/multithread cp -r qulacs qulacs_m1; cd qulacs_m1 rm -rf .benchmarks pytest ./benchmarks.py --benchmark-save="data" --benchmark-sort=name --benchmark-min-rounds=5 cd ../../../ cd benchmark/singlethread cp -r qulacs qulacs_m1; cd qulacs_m1 rm -rf .benchmarks # benchmarks.pyのmkl関連をコメントアウト pytest ./benchmarks.py --benchmark-save="data" --benchmark-sort=name --benchmark-min-rounds=5 cd ../../../ rm -f image/* で,plot.pyをqulacsとqulacs_m1のsinglethreadとmultithreadだけを 描画するようによう変更して,実行. :: fig_both_multithread.png {{ref_image fig_both_multithread.png}} :: fig_both_singlethread.png {{ref_image fig_both_singlethread.png}} !打合せ 午前1件,午後2件.