【折腾】Jittor在ARM Mac下的安装

Apple Silicon Jittor安装

前置要求,homebrew

按GitHub的quickstart

brew install onednn libomp

注意这里没必要装python3.7了,这玩意也不支持arm

brew install python@3.8

然后试了一下,出错了,原因是之前换的源

根本没必要折腾换源,正确上网以后brew飞快

brew doctor

把warning里的提示复制出来跑

折腾了半天,还是不行,提示找不到python3.8-config,看了一下issue,好像是conda的问题

退回去base,又提示没有numpy

conda install numpy

然后再次安装

python3 -m pip install jittor

终于可以了

-m jittor.test.test_example
[i 0429 00:30:24.156270 00 compiler.py:951] Jittor(1.3.3.14) src: /Users/caiziqi/mambaforge/lib/python3.9/site-packages/jittor
[i 0429 00:30:24.180594 00 compiler.py:952] g++ at /usr/bin/g++(13.1.6)
[i 0429 00:30:24.180656 00 compiler.py:953] cache_path: /Users/caiziqi/.cache/jittor/jt1.3.3/g++13.1.6/py3.9.10/macOS-12.3.1-axa5/AppleM1Pro/default
[i 0429 00:30:24.322291 00 __init__.py:227] Total mem: 16.00GB, using 5 procs for compiling.
Compiling jittor_core(147/147) used: 22.011s eta: 0.000s
[i 0429 00:30:46.837270 00 jit_compiler.cc:28] Load cc_path: /usr/bin/g++
[i 0429 00:30:52.698847 00 compile_extern.py:516] mpicc not found, distribution disabled.
[i 0429 00:30:52.701137 00 compiler.py:34] Create cache dir: /Users/caiziqi/.cache/jittor/jt1.3.3/g++13.1.6/py3.9.10/macOS-12.3.1-axa5/AppleM1Pro/default/custom_ops

Compiling Operators(3/3) used: 2.34s eta:    0s 

Compiling Operators(4/4) used: 3.38s eta:    0s  
step 0, loss = 0.9048624038696289 {'hold_vars': 13, 'lived_vars': 62, 'lived_ops': 56}

Compiling Operators(9/9) used: 4.37s eta:    0s 
step 1, loss = 0.41014260053634644 {'hold_vars': 13, 'lived_vars': 62, 'lived_ops': 56}
step 2, loss = 0.39250561594963074 {'hold_vars': 13, 'lived_vars': 62, 'lived_ops': 56}
...
----------------------------------------------------------------------
Ran 1 test in 0.316s

OK

总结一下,这么折腾的原因,一个是python版本不太一样,一个是conda不一样,还是ARM的一点区别

可能还是docker会更方便,但折腾都折腾完了

upd:神奇的事情,把base的卸载了,发现突然可以在conda env里装了

python3 -m pip uninstall

conda环境是python3.9,直接装

posted @ 2022-04-29 00:41  GhostCai  阅读(240)  评论(0编辑  收藏  举报