Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
upgpkg: python-pytorch 1.6.0rc3-1
Browse files Browse the repository at this point in the history
git-svn-id: file:///srv/repos/svn-community/svn@663400 9fca08f4-af9d-4005-b8df-a31f2cc04f65
  • Loading branch information
svenstaro authored and svntogit committed Jul 13, 2020
1 parent 4b634ff commit e8e1955
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 10 deletions.
24 changes: 14 additions & 10 deletions trunk/PKGBUILD
Expand Up @@ -4,8 +4,9 @@
pkgbase=python-pytorch
pkgname=("python-pytorch" "python-pytorch-opt" "python-pytorch-cuda" "python-pytorch-opt-cuda")
_pkgname="pytorch"
pkgver=1.5.0
pkgrel=2
pkgver=1.6.0rc3
_pkgver=1.6.0-rc3
pkgrel=1
pkgdesc="Tensors and Dynamic neural networks in Python with strong GPU acceleration"
arch=('x86_64')
url="https://pytorch.org"
Expand All @@ -14,13 +15,15 @@ depends=('google-glog' 'gflags' 'opencv' 'openmp' 'nccl' 'pybind11' 'python' 'py
'python-numpy' 'protobuf' 'ffmpeg' 'python-future' 'qt5-base' 'onednn' 'intel-mkl')
makedepends=('python' 'python-setuptools' 'python-yaml' 'python-numpy' 'cmake' 'cuda'
'cudnn' 'git' 'magma' 'ninja' 'pkgconfig' 'doxygen')
source=("${_pkgname}-${pkgver}::git+https://github.com/pytorch/pytorch.git#tag=v$pkgver"
https://patch-diff.githubusercontent.com/raw/pytorch/pytorch/pull/35359.patch
source=("${_pkgname}-${pkgver}::git+https://github.com/pytorch/pytorch.git#tag=v$_pkgver"
fix_include_system.patch
use-system-libuv.patch
use-system-libuv2.patch
nccl_version.patch)
sha256sums=('SKIP'
'1a67a90174276e9462e632df1bbb2e9fd7890f08da45d831edf1610c0e3e3c72'
'147bdaeac8ec46ea46382e6146878bd8f8d51e05d5bd6f930dfd8e2b520859b9'
'6f3b7a87172011de810bf1ab581245b4463ef86e5cd09bec63aeffa372e26646'
'7b65c3b209fc39f92ba58a58be6d3da40799f1922910b1171ccd9209eda1f9eb'
'1a276bd827a0c76dab908cbc6605fa4c9fc2cc2b9431b6578a41133ae27dba2b')

get_pyver () {
Expand All @@ -37,12 +40,13 @@ prepare() {
# It will result in the same package, don't worry.
git submodule update --init --recursive

# https://github.com/pytorch/pytorch/pull/35359
patch -Np1 -i "${srcdir}/35359.patch"

# https://bugs.archlinux.org/task/64981
patch -N torch/utils/cpp_extension.py "${srcdir}"/fix_include_system.patch

# Use system libuv
patch -Np1 -i "${srcdir}"/use-system-libuv.patch
patch -Np1 -i "${srcdir}"/use-system-libuv2.patch -d third_party/tensorpipe

# FindNCCL patch to export correct nccl version
patch -Np1 -i "${srcdir}"/nccl_version.patch

Expand Down Expand Up @@ -71,12 +75,12 @@ prepare() {
export USE_SYSTEM_NCCL=ON
export NCCL_VERSION=$(pkg-config nccl --modversion)
export NCCL_VER_CODE=$(sed -n 's/^#define NCCL_VERSION_CODE\s*\(.*\).*/\1/p' /usr/include/nccl.h)
export CUDAHOSTCXX=g++-8
export CUDAHOSTCXX=g++-9
export CUDA_HOME=/opt/cuda
export CUDNN_LIB_DIR=/usr/lib
export CUDNN_INCLUDE_DIR=/usr/include
export TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
export TORCH_CUDA_ARCH_LIST="3.2;3.5;3.7;5.0;5.2;5.3;6.0;6.0+PTX;6.1;6.1+PTX;6.2;6.2+PTX;7.0;7.0+PTX;7.2;7.2+PTX;7.5;7.5+PTX"
export TORCH_CUDA_ARCH_LIST="5.2;5.3;6.0;6.0+PTX;6.1;6.1+PTX;6.2;6.2+PTX;7.0;7.0+PTX;7.2;7.2+PTX;7.5;7.5+PTX;8.0;8.0+PTX;"
}

build() {
Expand Down
13 changes: 13 additions & 0 deletions trunk/use-system-libuv.patch
@@ -0,0 +1,13 @@
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index b498be17e1..69e5c9f187 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -1312,7 +1312,7 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
set(__BUILD_TESTING ${BUILD_TESTING})
set(BUILD_TESTING OFF)
set(TP_BUILD_PYTHON OFF)
- set(TP_BUILD_LIBUV ON)
+ set(TP_BUILD_LIBUV OFF)

add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/tensorpipe)

13 changes: 13 additions & 0 deletions trunk/use-system-libuv2.patch
@@ -0,0 +1,13 @@
diff --git a/cmake/pytorch.cmake b/cmake/pytorch.cmake
index e4d6b9c..48e0669 100644
--- a/cmake/pytorch.cmake
+++ b/cmake/pytorch.cmake
@@ -138,7 +138,7 @@ endif()

add_library(tensorpipe ${TENSORPIPE_SRC})

-set(TP_BUILD_LIBUV ON)
+set(TP_BUILD_LIBUV OFF)
find_package(uv REQUIRED)
target_link_libraries(tensorpipe PRIVATE uv::uv)

0 comments on commit e8e1955

Please sign in to comment.