jetson开发板自编译编译pytorch
编译pytorch 流程
首先拉取github上源码:
git clone --branch v2.5.1 https://xget.xi-xu.me/gh/pytorch/pytorch
1#修补third_party缺失部分:
cd pytorch
git checkout v2.5.1
git submodule sync
# 使用 https://xget.xi-xu.me/gh/ 加速克隆
git config --global url."https://xget.xi-xu.me/gh/".insteadOf "https://github.com/"
git submodule update --init --recursive --force
如果还有缺失可以进入缺失的目录进行单独拉取,例如:
cd third_party
rm -rf XNNPACK
git clone https://github.com/facebookresearch/XNNPACK.git
cd XNNPACK
git checkout <对应 commit> # 用 pytorch 子模块里指定的 commit
你可以在 pytorch/.gitmodules 查看 XNNPACK 的 commit
例如:
检查 XNNPACK 依赖,发现缺少 psimd 子模块
# 如果 XNNPACK 存在,进入它
cd XNNPACK
git clone https://github.com/Maratyszcza/psimd.git
git clone https://github.com/Maratyszcza/pthreadpool.git
cd ..
