pytorch源码编译安装

  • conda环境

安装conda环境,python 3.8以上,gcc支持9.4以上
conda install cmake ninja

conda install intel::mkl-static intel::mkl-include

#CUDA only: Add LAPACK support for the GPU if needed
conda install -c pytorch magma-cuda110
#or the magma-cuda* that matches your CUDA version from https://anaconda.org/pytorch/repo

#(optional) If using torch.compile with inductor/triton, install the matching version of triton
#Run from the pytorch directory after cloning
make triton

  • 源码下载

git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
#if you are updating an existing checkout
git submodule sync
git submodule update --init --recursive

  • 安装依赖

pip install -r requirements.txt

  • 安装命令

DEBUG=1是编译debug版本

export _GLIBCXX_USE_CXX11_ABI=1
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
DEBUG=1 USE_DISTRIBUTED=0 USE_MKLDNN=0 USE_CUDA=0 BUILD_TEST=0 USE_FBGEMM=0 USE_NNPACK=0 USE_QNNPACK=0 USE_XNNPACK=0 python setup.py develop
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值