aboutsummaryrefslogtreecommitdiff
path: root/libraries/pytorch
diff options
context:
space:
mode:
authorJohannes Schoepfer <slackbuilds@schoepfer.info>2024-08-23 18:12:58 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-08-23 20:26:23 +0700
commit7d079e534d4f4d9a23177ef67368b0545b0b3ac9 (patch)
treee2dd67b04f64009fc882586676be172339347d71 /libraries/pytorch
parent2a829513820318c3ed00de9fc067257a5705dd49 (diff)
libraries/pytorch: Updated for version 2.4.0.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries/pytorch')
-rw-r--r--libraries/pytorch/boxing.patch19
-rw-r--r--libraries/pytorch/pytorch.SlackBuild35
-rw-r--r--libraries/pytorch/pytorch.info10
3 files changed, 21 insertions, 43 deletions
diff --git a/libraries/pytorch/boxing.patch b/libraries/pytorch/boxing.patch
deleted file mode 100644
index 4d28fd2c8c2e..000000000000
--- a/libraries/pytorch/boxing.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- aten/src/ATen/core/boxing/impl/boxing.h.orig 2024-06-16 07:55:38.662684245 +0200
-+++ aten/src/ATen/core/boxing/impl/boxing.h 2024-06-16 07:58:43.690715864 +0200
-@@ -39,7 +39,15 @@
- struct has_ivalue_to : std::false_type {};
-
- template <class T>
--struct has_ivalue_to<T, std::void_t<decltype(std::declval<IValue>().to<T>())>>
-+struct ivalue_to_helper
-+{
-+ using type = decltype(std::declval<IValue>().template to<T>());
-+};
-+template <class T>
-+using ivalue_to_helper_t = typename ivalue_to_helper<T>::type;
-+
-+template <class T>
-+struct has_ivalue_to<T, std::void_t<ivalue_to_helper_t<T>>>
- : std::true_type
- {};
-
diff --git a/libraries/pytorch/pytorch.SlackBuild b/libraries/pytorch/pytorch.SlackBuild
index 4a75253f3dd8..78f4a0a68f5c 100644
--- a/libraries/pytorch/pytorch.SlackBuild
+++ b/libraries/pytorch/pytorch.SlackBuild
@@ -25,8 +25,8 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=pytorch
-VERSION=${VERSION:-2.3.1}
-VERSION_SIX=1.11.0
+VERSION=${VERSION:-2.4.0}
+COMMIT_QNNPACK=7d2a4e9931a82adc3814275b6219a03e24e36b4c
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -75,21 +75,19 @@ cd $PRGNAM-v$VERSION
chown -R root:root .
chmod -R u+w,go-w,a+rX-st $PKG
-# Needed for NNPACK
-mkdir -p build/confu-deps/six-download/six-prefix/src/
-cp $CWD/six-$VERSION_SIX.tar.gz build/confu-deps/six-download/six-prefix/src/
+# QNNPACK not present in tar ball since version 2.4.0
+(
+cd third_party
+tar vxf $CWD/QNNPACK-$COMMIT_QNNPACK.tar.gz
+ln -s QNNPACK-$COMMIT_QNNPACK QNNPACK
+)
# Fix cmake libdir location
sed -i c10/CMakeLists.txt \
-e "s;DESTINATION lib;DESTINATION lib$LIBDIRSUFFIX;g"
-# Make Vulkan Warnings not to make the build fail
-sed -i "/Werror=return-type/d" CMakeLists.txt
-
-# Fix compilation with nvidia-cuda-toolkit-12.4.0
-# https://github.com/pytorch/pytorch/issues/122169
-patch -p0 < $CWD/boxing.patch
-
+TMP_DIR=tmpxxx
+mkdir build
cd build
unshare -n cmake \
-G Ninja \
@@ -102,20 +100,19 @@ cd build
-DPYTHON_EXECUTABLE=$(which python3) \
-DBUILD_CUSTOM_PROTOBUF=OFF \
-DBUILD_TEST=OFF \
- -DUSE_FFMPEG=ON \
-DUSE_GOLD_LINKER=ON \
-DUSE_OPENCL=ON \
- -DUSE_OPENCV=ON \
-DUSE_VULKAN=ON \
-DCMAKE_BUILD_TYPE=Release ..
"${NINJA:=ninja}"
- DESTDIR=tmpxxx $NINJA install/strip
+ DESTDIR=$TMP_DIR $NINJA install/strip
mkdir -p $PKG/usr/{share,lib$LIBDIRSUFFIX}
- mv tmpxxx/usr/bin $PKG/usr
- mv tmpxxx/usr/include $PKG/usr
- mv tmpxxx/usr/share/cmake $PKG/usr/share
- mv tmpxxx/usr/lib$LIBDIRSUFFIX/*.so $PKG/usr/lib$LIBDIRSUFFIX
+ find $TMP_DIR -empty -type d -delete
+ mv $TMP_DIR/usr/bin $PKG/usr
+ mv $TMP_DIR/usr/include $PKG/usr
+ mv $TMP_DIR/usr/share/cmake $PKG/usr/share
+ mv $TMP_DIR/usr/lib$LIBDIRSUFFIX/*.so $PKG/usr/lib$LIBDIRSUFFIX
cd ..
python3 setup.py install --root=$PKG
diff --git a/libraries/pytorch/pytorch.info b/libraries/pytorch/pytorch.info
index 474b69c3deba..0025329e7e67 100644
--- a/libraries/pytorch/pytorch.info
+++ b/libraries/pytorch/pytorch.info
@@ -1,12 +1,12 @@
PRGNAM="pytorch"
-VERSION="2.3.1"
+VERSION="2.4.0"
HOMEPAGE="https://pytorch.org/"
DOWNLOAD="UNSUPPORTED"
MD5SUM=""
-DOWNLOAD_x86_64="https://github.com/pytorch/pytorch/releases/download/v2.3.1/pytorch-v2.3.1.tar.gz \
- https://pypi.io/packages/source/s/six/six-1.11.0.tar.gz"
-MD5SUM_x86_64="2c5e05b270b657219cd3e612ffd10e4e \
- d12789f9baf7e9fb2524c0c64f1773f8"
+DOWNLOAD_x86_64="https://github.com/pytorch/pytorch/releases/download/v2.4.0/pytorch-v2.4.0.tar.gz \
+ https://github.com/pytorch/QNNPACK/archive/7d2a4e9/QNNPACK-7d2a4e9931a82adc3814275b6219a03e24e36b4c.tar.gz"
+MD5SUM_x86_64="8604669939cd671b648f2280139dc242 \
+ fd513287f0b623e58860306c029022b2"
REQUIRES="protobuf3 typing-extensions"
MAINTAINER="Johannes Schoepfer"
EMAIL="slackbuilds@schoepfer.info"