* [gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2022-06-26 7:58 Alfredo Tupone
0 siblings, 0 replies; 5+ messages in thread
From: Alfredo Tupone @ 2022-06-26 7:58 UTC (permalink / raw
To: gentoo-commits
commit: 8337afbc16f16f0799c2e08094f5dc36fdbcc3ea
Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 26 07:58:44 2022 +0000
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Sun Jun 26 07:58:44 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8337afbc
sci-libs/pytorch: add to tree
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
sci-libs/pytorch/Manifest | 1 +
...-t-build-libtorch-again-for-PyTorch-1.7.1.patch | 18 +++++++
.../files/pytorch-1.6.0-global-dlopen.patch | 15 ++++++
.../files/pytorch-1.7.1-torch_shm_manager.patch | 13 +++++
...ibrary-directory-according-to-CMake-build.patch | 32 +++++++++++++
sci-libs/pytorch/metadata.xml | 11 +++++
sci-libs/pytorch/pytorch-1.11.0.ebuild | 56 ++++++++++++++++++++++
7 files changed, 146 insertions(+)
diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest
new file mode 100644
index 000000000000..ae4d5567b7fc
--- /dev/null
+++ b/sci-libs/pytorch/Manifest
@@ -0,0 +1 @@
+DIST pytorch-1.11.0.tar.gz 20719323 BLAKE2B 24e7aaa2c26821d36f8092542de9d8d5ac85a619fb9fffb5131987958842afb1cad395780662d15f3411a7cc6ff83a445871960eca1e469fcbf0b9895d83d6e0 SHA512 2342eb7a1a241f5855a7cf12e11f62bc4baaa78d1d0864e53bfc946e783eb4addd05ca154a814d2376cd602098b5547e61c158d6eddb7cad5a9f3b0c1357adca
diff --git a/sci-libs/pytorch/files/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch b/sci-libs/pytorch/files/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch
new file mode 100644
index 000000000000..640d061fcc59
--- /dev/null
+++ b/sci-libs/pytorch/files/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch
@@ -0,0 +1,18 @@
+diff --git a/setup.py b/setup.py
+index 2db381644c..2241a33015 100644
+--- a/setup.py
++++ b/setup.py
+@@ -363,13 +363,6 @@ def build_deps():
+ check_submodules()
+ check_pydep('yaml', 'pyyaml')
+
+- build_caffe2(version=version,
+- cmake_python_library=cmake_python_library,
+- build_python=True,
+- rerun_cmake=RERUN_CMAKE,
+- cmake_only=CMAKE_ONLY,
+- cmake=cmake)
+-
+ if CMAKE_ONLY:
+ report('Finished running cmake. Run "ccmake build" or '
+ '"cmake-gui build" to adjust build options and '
diff --git a/sci-libs/pytorch/files/pytorch-1.6.0-global-dlopen.patch b/sci-libs/pytorch/files/pytorch-1.6.0-global-dlopen.patch
new file mode 100644
index 000000000000..1e9388ff17a6
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.6.0-global-dlopen.patch
@@ -0,0 +1,15 @@
+Don't hardcode the library path. Leave it to the dynamic loader.
+
+Index: pytorch-1.6.0/torch/__init__.py
+===================================================================
+--- pytorch-1.6.0.orig/torch/__init__.py
++++ pytorch-1.6.0/torch/__init__.py
+@@ -138,7 +138,7 @@ def _load_global_deps():
+ here = os.path.abspath(__file__)
+ lib_path = os.path.join(os.path.dirname(here), 'lib', lib_name)
+
+- ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
++ ctypes.CDLL(lib_name, mode=ctypes.RTLD_GLOBAL)
+
+
+ if (USE_RTLD_GLOBAL_WITH_LIBTORCH or os.getenv('TORCH_USE_RTLD_GLOBAL')) and \
diff --git a/sci-libs/pytorch/files/pytorch-1.7.1-torch_shm_manager.patch b/sci-libs/pytorch/files/pytorch-1.7.1-torch_shm_manager.patch
new file mode 100644
index 000000000000..69c2ddc5947e
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.7.1-torch_shm_manager.patch
@@ -0,0 +1,13 @@
+diff --git a/torch/__init__.py b/torch/__init__.py
+index 03f6eca622..297fb169a4 100644
+--- a/torch/__init__.py
++++ b/torch/__init__.py
+@@ -412,7 +412,7 @@ def manager_path():
+
+
+ # Shared memory manager needs to know the exact location of manager executable
+-_C._initExtension(manager_path())
++_C._initExtension(b"/usr/bin/torch_shm_manager")
+ del manager_path
+
+ # Appease the type checker: it can't deal with direct setting of globals().
diff --git a/sci-libs/pytorch/files/pytorch-1.9.0-Change-library-directory-according-to-CMake-build.patch b/sci-libs/pytorch/files/pytorch-1.9.0-Change-library-directory-according-to-CMake-build.patch
new file mode 100644
index 000000000000..214267487c95
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.9.0-Change-library-directory-according-to-CMake-build.patch
@@ -0,0 +1,32 @@
+From 52019a3f395e5fa97b26d424152d91f73b400f8e Mon Sep 17 00:00:00 2001
+From: Alexey Chernov <4ernov@gmail.com>
+Date: Wed, 13 Nov 2019 23:44:12 +0300
+Subject: [PATCH 5/5] Change library directory according to CMake build
+Modified: Tue, 03 Aug 2021, fit for pytorch-1.9.0
+
+Change `lib_path` in favour of out-of-tree CMake build
+directory, so that all the C++ libraries be found.
+---
+ setup.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 60502b6add..cbced52192 100644
+--- a/setup.py
++++ b/setup.py
+@@ -268,9 +268,10 @@ else:
+
+ # Constant known variables used throughout this file
+ cwd = os.path.dirname(os.path.abspath(__file__))
+-lib_path = os.path.join(cwd, "torch", "lib")
++cmake_build_dir = os.environ.get("CMAKE_BUILD_DIR", os.path.join(cwd, "build"))
++lib_path = os.path.join(cmake_build_dir, "lib")
+ third_party_path = os.path.join(cwd, "third_party")
+-caffe2_build_dir = os.path.join(cwd, "build")
++caffe2_build_dir = cmake_build_dir
+
+ # CMAKE: full path to python library
+ if IS_WINDOWS:
+--
+2.23.0
+
diff --git a/sci-libs/pytorch/metadata.xml b/sci-libs/pytorch/metadata.xml
new file mode 100644
index 000000000000..d12749aa5c21
--- /dev/null
+++ b/sci-libs/pytorch/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>tupone@gentoo.org</email>
+ <name>Tupone Alfredo</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">pytorch/pytorch</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-libs/pytorch/pytorch-1.11.0.ebuild b/sci-libs/pytorch/pytorch-1.11.0.ebuild
new file mode 100644
index 000000000000..a57ff0163fd0
--- /dev/null
+++ b/sci-libs/pytorch/pytorch-1.11.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8,9,10} )
+inherit distutils-r1
+
+DESCRIPTION="Tensors and Dynamic neural networks in Python"
+HOMEPAGE="https://pytorch.org/"
+SRC_URI="https://github.com/pytorch/${PN}/archive/refs/tags/v${PV}.tar.gz
+ -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+RESTRICT="test"
+
+REQUIRED_USE=${PYTHON_REQUIRED_USE}
+RDEPEND="
+ ${PYTHON_DEPS}
+ sci-libs/caffe2[${PYTHON_USEDEP}]
+ dev-python/typing-extensions[${PYTHON_USEDEP}]
+"
+DEPEND="${RDEPEND}
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+"
+
+src_prepare() {
+ eapply \
+ "${FILESDIR}"/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch \
+ "${FILESDIR}"/pytorch-1.9.0-Change-library-directory-according-to-CMake-build.patch \
+ "${FILESDIR}"/${PN}-1.6.0-global-dlopen.patch \
+ "${FILESDIR}"/pytorch-1.7.1-torch_shm_manager.patch
+
+ # Set build dir for pytorch's setup
+ sed -i \
+ -e "/BUILD_DIR/s|build|/var/lib/caffe2/|" \
+ tools/setup_helpers/env.py \
+ || die
+ distutils-r1_src_prepare
+}
+
+src_compile() {
+ PYTORCH_BUILD_VERSION=${PV} \
+ PYTORCH_BUILD_NUMBER=0 \
+ USE_SYSTEM_LIBS=ON \
+ CMAKE_BUILD_DIR="${BUILD_DIR}" \
+ BUILD_DIR= \
+ distutils-r1_src_compile
+}
+
+src_install() {
+ USE_SYSTEM_LIBS=ON distutils-r1_src_install
+}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2023-02-14 19:32 Alfredo Tupone
0 siblings, 0 replies; 5+ messages in thread
From: Alfredo Tupone @ 2023-02-14 19:32 UTC (permalink / raw
To: gentoo-commits
commit: 3c8165f6ff751f984855d95e5f66d2d66b65a04f
Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 14 19:31:25 2023 +0000
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Tue Feb 14 19:31:40 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c8165f6
sci-libs/pytorch: add 1.13.0
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
sci-libs/pytorch/Manifest | 1 +
sci-libs/pytorch/files/pytorch-1.13.0-setup.patch | 11 ++++
sci-libs/pytorch/pytorch-1.13.0.ebuild | 63 +++++++++++++++++++++++
3 files changed, 75 insertions(+)
diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest
index adfe026eaff0..fba79e4a9a24 100644
--- a/sci-libs/pytorch/Manifest
+++ b/sci-libs/pytorch/Manifest
@@ -1,2 +1,3 @@
DIST pytorch-1.12.0.tar.gz 106286765 BLAKE2B ff9bafedb35f859f7dccb9b606299cf9c345bdaa0deb87ecfe0c0c30c3c828414d989e1d9a243d9b7cd3f376d56a2f81c241ca2e3c9a8a2b30cddcdeddd3a5c7 SHA512 c9c748a2e0047daaaf199a1ba3198d2d1aee47f664170a9b34ccacd3deeb95f2070e4035eeb900012ef48dc62cf6fb6806f1a1dfe22de8c94892963076e593b7
DIST pytorch-1.12.1.tar.gz 106311625 BLAKE2B e8ca19d0e1987449c33ad4c36722a3a467f7f8a9f90be2a7f2de643cbd665038f6802b5ff1f1d3da09b6253d8f29e11549a24295de013d97f73affe538c84c99 SHA512 afeb551904ebd9b5901ae623a98eadbb3045115247cedf8006a940742cfad04e5ce24cfaf363336a9ed88d7ce6a4ac53dbb6a5c690aef6efdf20477c3a22c7ca
+DIST pytorch-1.13.0.tar.gz 108276317 BLAKE2B 8149775dea06d8e4027b741c828169d33f768a96aef58cd2f86daa3bbad5bf36143454e26b683a992aca34e7fb52e6483c46168b698db48ff6978c9605d7a3d2 SHA512 5a0e8c589bdf552ccf682511a8860c754ab6f5844f51e568c5034793f787b97707af4340b338b9b8606dd27a6ced6ef50091f0cc514458b3021a2220409d7f20
diff --git a/sci-libs/pytorch/files/pytorch-1.13.0-setup.patch b/sci-libs/pytorch/files/pytorch-1.13.0-setup.patch
new file mode 100644
index 000000000000..bc5721e5b932
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.13.0-setup.patch
@@ -0,0 +1,11 @@
+--- a/setup.py 2023-02-14 19:34:56.327571750 +0100
++++ b/setup.py 2023-02-14 19:35:31.073020464 +0100
+@@ -234,6 +234,8 @@
+ import time
+ import sysconfig
+
++sys.path[:0] = os.getcwd()
++
+ from tools.build_pytorch_libs import build_caffe2
+ from tools.setup_helpers.env import (IS_WINDOWS, IS_DARWIN, IS_LINUX,
+ build_type)
diff --git a/sci-libs/pytorch/pytorch-1.13.0.ebuild b/sci-libs/pytorch/pytorch-1.13.0.ebuild
new file mode 100644
index 000000000000..7cde7f7262bb
--- /dev/null
+++ b/sci-libs/pytorch/pytorch-1.13.0.ebuild
@@ -0,0 +1,63 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{9,10} )
+DISTUTILS_SINGLE_IMPL=1
+inherit distutils-r1
+
+DESCRIPTION="Tensors and Dynamic neural networks in Python"
+HOMEPAGE="https://pytorch.org/"
+SRC_URI="https://github.com/pytorch/${PN}/archive/refs/tags/v${PV}.tar.gz
+ -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+RESTRICT="test"
+
+REQUIRED_USE=${PYTHON_REQUIRED_USE}
+RDEPEND="
+ ${PYTHON_DEPS}
+ ~sci-libs/caffe2-${PV}[${PYTHON_SINGLE_USEDEP}]
+ $(python_gen_cond_dep '
+ dev-python/typing-extensions[${PYTHON_USEDEP}]
+ ')
+"
+DEPEND="${RDEPEND}
+ $(python_gen_cond_dep '
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ ')
+"
+
+src_prepare() {
+ eapply \
+ "${FILESDIR}"/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch \
+ "${FILESDIR}"/pytorch-1.9.0-Change-library-directory-according-to-CMake-build.patch \
+ "${FILESDIR}"/${PN}-1.6.0-global-dlopen.patch \
+ "${FILESDIR}"/pytorch-1.7.1-torch_shm_manager.patch \
+ "${FILESDIR}"/${P}-setup.patch \
+ "${FILESDIR}"/pytorch-1.12.0-CVE-2022-45907.patch
+
+ # Set build dir for pytorch's setup
+ sed -i \
+ -e "/BUILD_DIR/s|build|/var/lib/caffe2/|" \
+ tools/setup_helpers/env.py \
+ || die
+ distutils-r1_src_prepare
+}
+
+src_compile() {
+ PYTORCH_BUILD_VERSION=${PV} \
+ PYTORCH_BUILD_NUMBER=0 \
+ USE_SYSTEM_LIBS=ON \
+ CMAKE_BUILD_DIR="${BUILD_DIR}" \
+ BUILD_DIR= \
+ distutils-r1_src_compile
+}
+
+src_install() {
+ USE_SYSTEM_LIBS=ON distutils-r1_src_install
+}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2023-12-10 10:36 Alfredo Tupone
0 siblings, 0 replies; 5+ messages in thread
From: Alfredo Tupone @ 2023-12-10 10:36 UTC (permalink / raw
To: gentoo-commits
commit: c0ea108c42908c6fd647cbbfad98d29b9ca86c21
Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 10 10:35:41 2023 +0000
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Sun Dec 10 10:35:41 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0ea108c
sci-libs/pytorch: add 2.1.1
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
sci-libs/pytorch/Manifest | 1 +
.../files/pytorch-2.1.1-dontbuildagain.patch | 17 ++++++
sci-libs/pytorch/files/pytorch-2.1.1-emptyso.patch | 13 +++++
sci-libs/pytorch/pytorch-2.1.1.ebuild | 68 ++++++++++++++++++++++
4 files changed, 99 insertions(+)
diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest
index 0ee75499ccbe..d51cccdc3c37 100644
--- a/sci-libs/pytorch/Manifest
+++ b/sci-libs/pytorch/Manifest
@@ -1,3 +1,4 @@
DIST pytorch-1.13.1.tar.gz 108279745 BLAKE2B 75de03b74dfdaf8d8fb5ea743fcc0c1b0e408a714ad4160c487921220a7b1755e5fa6e587e6bbc8c9f34dd75e096d2e6dd69c80d24821835fff6c833314434d3 SHA512 f16f89d027efade11d057245cad5b69a390e88b458398310ae30de2dbff7c8fd7f1165be7b8da7ea989c81ac3f5a66c5cb9050610e441a97c83fb8aa28c0bd62
DIST pytorch-2.0.0.tar.gz 111327292 BLAKE2B 6d593a975c0ade714f0b189f7e3c4ff704b9a9a2377b5e441a9cefc202fa22779966d08948e63671912c6ea5a0eee124042155f4f57a654db34e19e42f013cc9 SHA512 4dd76160711c0d87f3026c8b7fa3ed149dd86b8ac0ee9ecea0eaf80d2e6ce8c29368392e77b9466d90b60634087b462b782495997a5d33367cc8ca9fe14c8a14
DIST pytorch-2.0.1.tar.gz 111335778 BLAKE2B 7a10cc2b2d5e2422aef7e060a0c3a62ca5c7460c6e0b9becade9b98939501975c74ed5a175a653731f43ca824d2c9bd31f41d1f633c2b139779ab23d5331e9ce SHA512 2309a22b3be3ccdb36d8d9781a59a7bdcc2fdb8d95ada205702ec77862480f0cbb12cd5d6b8cd3114d01a6e33b7743d0fe9de93debf37138ca5c14403cdb0c43
+DIST pytorch-2.1.1.tar.gz 116317162 BLAKE2B d9819256cba0b9951aabe95d86fb135e97d8bafa2c010d13162cd9b3373ca75f20d218e31279ace41981f3f76308721c522f9e53745a1ff9e6386fa10634f9ad SHA512 31b36e7732ee086ae7565a3811ab2d1b2869e79057bea7a4ffc4a3c95c544757e656a6d2289ee11fe7508828aca144e4220ef1e9ab1878e075e1259cf6ff9ca4
diff --git a/sci-libs/pytorch/files/pytorch-2.1.1-dontbuildagain.patch b/sci-libs/pytorch/files/pytorch-2.1.1-dontbuildagain.patch
new file mode 100644
index 000000000000..f031a7345c69
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-2.1.1-dontbuildagain.patch
@@ -0,0 +1,17 @@
+--- a/setup.py 2023-12-07 20:38:21.247250326 +0100
++++ b/setup.py 2023-12-07 20:38:30.707272148 +0100
+@@ -455,14 +455,6 @@
+ check_submodules()
+ check_pydep("yaml", "pyyaml")
+
+- build_caffe2(
+- version=version,
+- cmake_python_library=cmake_python_library,
+- build_python=True,
+- rerun_cmake=RERUN_CMAKE,
+- cmake_only=CMAKE_ONLY,
+- cmake=cmake,
+- )
+
+ if CMAKE_ONLY:
+ report(
diff --git a/sci-libs/pytorch/files/pytorch-2.1.1-emptyso.patch b/sci-libs/pytorch/files/pytorch-2.1.1-emptyso.patch
new file mode 100644
index 000000000000..b2983609819a
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-2.1.1-emptyso.patch
@@ -0,0 +1,13 @@
+--- a/setup.py 2023-04-05 11:23:00.713405789 +0200
++++ b/setup.py 2023-04-05 11:23:36.900876249 +0200
+@@ -1037,10 +1037,6 @@
+ extensions.append(
+ Extension(name="caffe2.python.caffe2_pybind11_state_hip", sources=[]),
+ )
+- if cmake_cache_vars["BUILD_FUNCTORCH"]:
+- extensions.append(
+- Extension(name="functorch._C", sources=[]),
+- )
+ if cmake_cache_vars["BUILD_NVFUSER"]:
+ extensions.append(
+ Extension(name="nvfuser._C", sources=[]),
diff --git a/sci-libs/pytorch/pytorch-2.1.1.ebuild b/sci-libs/pytorch/pytorch-2.1.1.ebuild
new file mode 100644
index 000000000000..e53135e714a6
--- /dev/null
+++ b/sci-libs/pytorch/pytorch-2.1.1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{9..11} )
+DISTUTILS_SINGLE_IMPL=1
+DISTUTILS_EXT=1
+inherit distutils-r1 prefix
+
+DESCRIPTION="Tensors and Dynamic neural networks in Python"
+HOMEPAGE="https://pytorch.org/"
+SRC_URI="https://github.com/pytorch/${PN}/archive/refs/tags/v${PV}.tar.gz
+ -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+RESTRICT="test"
+
+REQUIRED_USE=${PYTHON_REQUIRED_USE}
+RDEPEND="
+ ${PYTHON_DEPS}
+ ~sci-libs/caffe2-${PV}[${PYTHON_SINGLE_USEDEP}]
+ $(python_gen_cond_dep '
+ dev-python/typing-extensions[${PYTHON_USEDEP}]
+ dev-python/sympy[${PYTHON_USEDEP}]
+ ')
+"
+DEPEND="${RDEPEND}
+ $(python_gen_cond_dep '
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ ')
+"
+
+src_prepare() {
+ eapply \
+ "${FILESDIR}"/${P}-dontbuildagain.patch \
+ "${FILESDIR}"/pytorch-1.9.0-Change-library-directory-according-to-CMake-build.patch \
+ "${FILESDIR}"/${PN}-2.0.0-global-dlopen.patch \
+ "${FILESDIR}"/pytorch-1.7.1-torch_shm_manager.patch \
+ "${FILESDIR}"/${PN}-1.13.0-setup.patch \
+ "${FILESDIR}"/${P}-emptyso.patch \
+
+ # Set build dir for pytorch's setup
+ sed -i \
+ -e "/BUILD_DIR/s|build|/var/lib/caffe2/|" \
+ tools/setup_helpers/env.py \
+ || die
+ distutils-r1_src_prepare
+
+ hprefixify tools/setup_helpers/env.py
+}
+
+python_compile() {
+ PYTORCH_BUILD_VERSION=${PV} \
+ PYTORCH_BUILD_NUMBER=0 \
+ USE_SYSTEM_LIBS=ON \
+ CMAKE_BUILD_DIR="${BUILD_DIR}" \
+ distutils-r1_python_compile develop sdist
+}
+
+python_install() {
+ USE_SYSTEM_LIBS=ON distutils-r1_python_install
+ python_moduleinto nvfuser
+ python_domodule third_party/nvfuser/python/__init__.py
+}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2024-03-08 18:46 Alfredo Tupone
0 siblings, 0 replies; 5+ messages in thread
From: Alfredo Tupone @ 2024-03-08 18:46 UTC (permalink / raw
To: gentoo-commits
commit: 4eb8205d726b5460edf6a0071e44170b4ad06f38
Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 8 18:44:22 2024 +0000
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Fri Mar 8 18:45:34 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4eb8205d
sci-libs/pytorch: add 2.2.1
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
sci-libs/pytorch/Manifest | 1 +
sci-libs/pytorch/files/pytorch-2.2.1-emptyso.patch | 13 +++++++++++++
sci-libs/pytorch/pytorch-2.1.2-r1.ebuild | 2 +-
.../{pytorch-2.1.2-r1.ebuild => pytorch-2.2.1.ebuild} | 4 ++--
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest
index a05e285f98e0..2a63d8018442 100644
--- a/sci-libs/pytorch/Manifest
+++ b/sci-libs/pytorch/Manifest
@@ -1,3 +1,4 @@
DIST pytorch-1.13.1.tar.gz 108279745 BLAKE2B 75de03b74dfdaf8d8fb5ea743fcc0c1b0e408a714ad4160c487921220a7b1755e5fa6e587e6bbc8c9f34dd75e096d2e6dd69c80d24821835fff6c833314434d3 SHA512 f16f89d027efade11d057245cad5b69a390e88b458398310ae30de2dbff7c8fd7f1165be7b8da7ea989c81ac3f5a66c5cb9050610e441a97c83fb8aa28c0bd62
DIST pytorch-2.0.1.tar.gz 111335778 BLAKE2B 7a10cc2b2d5e2422aef7e060a0c3a62ca5c7460c6e0b9becade9b98939501975c74ed5a175a653731f43ca824d2c9bd31f41d1f633c2b139779ab23d5331e9ce SHA512 2309a22b3be3ccdb36d8d9781a59a7bdcc2fdb8d95ada205702ec77862480f0cbb12cd5d6b8cd3114d01a6e33b7743d0fe9de93debf37138ca5c14403cdb0c43
DIST pytorch-2.1.2.tar.gz 116316469 BLAKE2B c5a55ee264bc3477d3556ba6376b5591117e992e56e0dd0c9ba93d12526e2727f7840f6f1e0730a38223b6492c9556840c4ebf22ffd220e97225c2abff303747 SHA512 a8961d78ad785b13c959a0612563a60e0de17a7c8bb9822ddea9a24072796354d07e81c47b6cc8761b21a6448845b088cf80e1661d9e889b0ed5474d3dc76756
+DIST pytorch-2.2.1.tar.gz 116370903 BLAKE2B 7d08e80f91bad76fba1751c30a34bebfe7145058b7758c0d47112702263a80666f70687a8860744725c6aa995e854f766a5bfa4644c23e5635e7e08c8d63a6e9 SHA512 f19ebcf59d183c3348946ba7cfcab2bc4ca93785863b8edc39dba5772083a7b0425ccb4f92a8df4dc0d18246c75e8ff812993161467fbf9dc48d7fb28a1e26f1
diff --git a/sci-libs/pytorch/files/pytorch-2.2.1-emptyso.patch b/sci-libs/pytorch/files/pytorch-2.2.1-emptyso.patch
new file mode 100644
index 000000000000..2b4839baec5b
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-2.2.1-emptyso.patch
@@ -0,0 +1,13 @@
+--- a/setup.py 2024-03-08 19:34:42.148677983 +0100
++++ b/setup.py 2024-03-08 19:34:52.402558423 +0100
+@@ -1019,10 +1019,6 @@
+ extensions.append(
+ Extension(name="caffe2.python.caffe2_pybind11_state_hip", sources=[]),
+ )
+- if cmake_cache_vars["BUILD_FUNCTORCH"]:
+- extensions.append(
+- Extension(name="functorch._C", sources=[]),
+- )
+
+ cmdclass = {
+ "bdist_wheel": wheel_concatenate,
diff --git a/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild b/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild
index e3bdd2b2f216..eeedad68bd1b 100644
--- a/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild
+++ b/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild
@@ -7,7 +7,7 @@ DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{9..12} )
DISTUTILS_SINGLE_IMPL=1
DISTUTILS_EXT=1
-inherit distutils-r1 multibuild prefix
+inherit distutils-r1 prefix
DESCRIPTION="Tensors and Dynamic neural networks in Python"
HOMEPAGE="https://pytorch.org/"
diff --git a/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild b/sci-libs/pytorch/pytorch-2.2.1.ebuild
similarity index 94%
copy from sci-libs/pytorch/pytorch-2.1.2-r1.ebuild
copy to sci-libs/pytorch/pytorch-2.2.1.ebuild
index e3bdd2b2f216..442d74f6a2d6 100644
--- a/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild
+++ b/sci-libs/pytorch/pytorch-2.2.1.ebuild
@@ -7,7 +7,7 @@ DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{9..12} )
DISTUTILS_SINGLE_IMPL=1
DISTUTILS_EXT=1
-inherit distutils-r1 multibuild prefix
+inherit distutils-r1 prefix
DESCRIPTION="Tensors and Dynamic neural networks in Python"
HOMEPAGE="https://pytorch.org/"
@@ -41,7 +41,7 @@ src_prepare() {
"${FILESDIR}"/${PN}-2.0.0-global-dlopen.patch \
"${FILESDIR}"/pytorch-1.7.1-torch_shm_manager.patch \
"${FILESDIR}"/${PN}-1.13.0-setup.patch \
- "${FILESDIR}"/${PN}-2.1.1-emptyso.patch \
+ "${FILESDIR}"/${P}-emptyso.patch \
# Set build dir for pytorch's setup
sed -i \
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2024-03-22 20:42 Alfredo Tupone
0 siblings, 0 replies; 5+ messages in thread
From: Alfredo Tupone @ 2024-03-22 20:42 UTC (permalink / raw
To: gentoo-commits
commit: 3969938e8e1d00781a660e7f188549070671b82c
Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 22 20:41:31 2024 +0000
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Fri Mar 22 20:42:12 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3969938e
sci-libs/pytorch: drop 1.13.1-r2, 2.0.1-r1
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
sci-libs/pytorch/Manifest | 2 -
...-t-build-libtorch-again-for-PyTorch-1.7.1.patch | 18 ------
.../pytorch/files/pytorch-1.13.1-emptyso.patch | 15 -----
.../files/pytorch-1.13.1-global-dlopen.patch | 23 --------
sci-libs/pytorch/files/pytorch-2.0.0-emptyso.patch | 15 -----
sci-libs/pytorch/pytorch-1.13.1-r2.ebuild | 63 --------------------
sci-libs/pytorch/pytorch-2.0.1-r1.ebuild | 67 ----------------------
7 files changed, 203 deletions(-)
diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest
index 2a63d8018442..09e1f64fbe4c 100644
--- a/sci-libs/pytorch/Manifest
+++ b/sci-libs/pytorch/Manifest
@@ -1,4 +1,2 @@
-DIST pytorch-1.13.1.tar.gz 108279745 BLAKE2B 75de03b74dfdaf8d8fb5ea743fcc0c1b0e408a714ad4160c487921220a7b1755e5fa6e587e6bbc8c9f34dd75e096d2e6dd69c80d24821835fff6c833314434d3 SHA512 f16f89d027efade11d057245cad5b69a390e88b458398310ae30de2dbff7c8fd7f1165be7b8da7ea989c81ac3f5a66c5cb9050610e441a97c83fb8aa28c0bd62
-DIST pytorch-2.0.1.tar.gz 111335778 BLAKE2B 7a10cc2b2d5e2422aef7e060a0c3a62ca5c7460c6e0b9becade9b98939501975c74ed5a175a653731f43ca824d2c9bd31f41d1f633c2b139779ab23d5331e9ce SHA512 2309a22b3be3ccdb36d8d9781a59a7bdcc2fdb8d95ada205702ec77862480f0cbb12cd5d6b8cd3114d01a6e33b7743d0fe9de93debf37138ca5c14403cdb0c43
DIST pytorch-2.1.2.tar.gz 116316469 BLAKE2B c5a55ee264bc3477d3556ba6376b5591117e992e56e0dd0c9ba93d12526e2727f7840f6f1e0730a38223b6492c9556840c4ebf22ffd220e97225c2abff303747 SHA512 a8961d78ad785b13c959a0612563a60e0de17a7c8bb9822ddea9a24072796354d07e81c47b6cc8761b21a6448845b088cf80e1661d9e889b0ed5474d3dc76756
DIST pytorch-2.2.1.tar.gz 116370903 BLAKE2B 7d08e80f91bad76fba1751c30a34bebfe7145058b7758c0d47112702263a80666f70687a8860744725c6aa995e854f766a5bfa4644c23e5635e7e08c8d63a6e9 SHA512 f19ebcf59d183c3348946ba7cfcab2bc4ca93785863b8edc39dba5772083a7b0425ccb4f92a8df4dc0d18246c75e8ff812993161467fbf9dc48d7fb28a1e26f1
diff --git a/sci-libs/pytorch/files/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch b/sci-libs/pytorch/files/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch
deleted file mode 100644
index 640d061fcc59..000000000000
--- a/sci-libs/pytorch/files/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 2db381644c..2241a33015 100644
---- a/setup.py
-+++ b/setup.py
-@@ -363,13 +363,6 @@ def build_deps():
- check_submodules()
- check_pydep('yaml', 'pyyaml')
-
-- build_caffe2(version=version,
-- cmake_python_library=cmake_python_library,
-- build_python=True,
-- rerun_cmake=RERUN_CMAKE,
-- cmake_only=CMAKE_ONLY,
-- cmake=cmake)
--
- if CMAKE_ONLY:
- report('Finished running cmake. Run "ccmake build" or '
- '"cmake-gui build" to adjust build options and '
diff --git a/sci-libs/pytorch/files/pytorch-1.13.1-emptyso.patch b/sci-libs/pytorch/files/pytorch-1.13.1-emptyso.patch
deleted file mode 100644
index 1479354b7f7a..000000000000
--- a/sci-libs/pytorch/files/pytorch-1.13.1-emptyso.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/setup.py 2023-03-24 22:36:50.361860100 +0100
-+++ b/setup.py 2023-03-24 22:36:57.384752383 +0100
-@@ -922,12 +922,6 @@
- name=str('caffe2.python.caffe2_pybind11_state_hip'),
- sources=[]),
- )
-- if cmake_cache_vars['BUILD_FUNCTORCH']:
-- extensions.append(
-- Extension(
-- name=str('functorch._C'),
-- sources=[]),
-- )
-
- cmdclass = {
- 'bdist_wheel': wheel_concatenate,
diff --git a/sci-libs/pytorch/files/pytorch-1.13.1-global-dlopen.patch b/sci-libs/pytorch/files/pytorch-1.13.1-global-dlopen.patch
deleted file mode 100644
index 4f414be67a29..000000000000
--- a/sci-libs/pytorch/files/pytorch-1.13.1-global-dlopen.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Don't hardcode the library path. Leave it to the dynamic loader.
-
-Index: pytorch-1.13.1/torch/__init__.py
-===================================================================
---- a/torch/__init__.py 2023-02-15 20:27:51.747853677 +0100
-+++ b/torch/__init__.py 2023-02-15 20:28:23.506341918 +0100
-@@ -169,14 +169,14 @@
- lib_path = os.path.join(os.path.dirname(here), 'lib', lib_name)
-
- try:
-- ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
-+ ctypes.CDLL(lib_name, mode=ctypes.RTLD_GLOBAL)
- except OSError as err:
- # Can only happen of wheel with cublas as PYPI deps
- # As PyTorch is not purelib, but nvidia-cublas-cu11 is
- if 'libcublas.so.11' not in err.args[0]:
- raise err
- _preload_cuda_deps()
-- ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
-+ ctypes.CDLL(lib_name, mode=ctypes.RTLD_GLOBAL)
-
-
- if (USE_RTLD_GLOBAL_WITH_LIBTORCH or os.getenv('TORCH_USE_RTLD_GLOBAL')) and \
diff --git a/sci-libs/pytorch/files/pytorch-2.0.0-emptyso.patch b/sci-libs/pytorch/files/pytorch-2.0.0-emptyso.patch
deleted file mode 100644
index e4703894308a..000000000000
--- a/sci-libs/pytorch/files/pytorch-2.0.0-emptyso.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/setup.py 2023-04-05 11:23:00.713405789 +0200
-+++ b/setup.py 2023-04-05 11:23:36.900876249 +0200
-@@ -960,12 +960,6 @@
- name=str('caffe2.python.caffe2_pybind11_state_hip'),
- sources=[]),
- )
-- if cmake_cache_vars['BUILD_FUNCTORCH']:
-- extensions.append(
-- Extension(
-- name=str('functorch._C'),
-- sources=[]),
-- )
- if cmake_cache_vars['BUILD_NVFUSER']:
- extensions.append(
- Extension(
diff --git a/sci-libs/pytorch/pytorch-1.13.1-r2.ebuild b/sci-libs/pytorch/pytorch-1.13.1-r2.ebuild
deleted file mode 100644
index 14b2e8d56547..000000000000
--- a/sci-libs/pytorch/pytorch-1.13.1-r2.ebuild
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 2022-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{9..11} )
-DISTUTILS_SINGLE_IMPL=1
-inherit distutils-r1 multibuild
-
-DESCRIPTION="Tensors and Dynamic neural networks in Python"
-HOMEPAGE="https://pytorch.org/"
-SRC_URI="https://github.com/pytorch/${PN}/archive/refs/tags/v${PV}.tar.gz
- -> ${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64"
-RESTRICT="test"
-
-REQUIRED_USE=${PYTHON_REQUIRED_USE}
-RDEPEND="
- ${PYTHON_DEPS}
- ~sci-libs/caffe2-${PV}[${PYTHON_SINGLE_USEDEP}]
- $(python_gen_cond_dep '
- dev-python/typing-extensions[${PYTHON_USEDEP}]
- ')
-"
-DEPEND="${RDEPEND}
- $(python_gen_cond_dep '
- dev-python/pyyaml[${PYTHON_USEDEP}]
- ')
-"
-
-src_prepare() {
- eapply \
- "${FILESDIR}"/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch \
- "${FILESDIR}"/pytorch-1.9.0-Change-library-directory-according-to-CMake-build.patch \
- "${FILESDIR}"/${P}-global-dlopen.patch \
- "${FILESDIR}"/pytorch-1.7.1-torch_shm_manager.patch \
- "${FILESDIR}"/${PN}-1.13.0-setup.patch \
- "${FILESDIR}"/${P}-emptyso.patch \
-
- # Set build dir for pytorch's setup
- sed -i \
- -e "/BUILD_DIR/s|build|/var/lib/caffe2/|" \
- tools/setup_helpers/env.py \
- || die
- distutils-r1_src_prepare
-}
-
-src_compile() {
- PYTORCH_BUILD_VERSION=${PV} \
- PYTORCH_BUILD_NUMBER=0 \
- USE_SYSTEM_LIBS=ON \
- CMAKE_BUILD_DIR="${BUILD_DIR}" \
- BUILD_DIR= \
- distutils-r1_src_compile
-}
-
-src_install() {
- USE_SYSTEM_LIBS=ON distutils-r1_src_install
-}
diff --git a/sci-libs/pytorch/pytorch-2.0.1-r1.ebuild b/sci-libs/pytorch/pytorch-2.0.1-r1.ebuild
deleted file mode 100644
index 2ee51ce0e418..000000000000
--- a/sci-libs/pytorch/pytorch-2.0.1-r1.ebuild
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 2022-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{9..11} )
-DISTUTILS_SINGLE_IMPL=1
-DISTUTILS_EXT=1
-inherit distutils-r1 multibuild prefix
-
-DESCRIPTION="Tensors and Dynamic neural networks in Python"
-HOMEPAGE="https://pytorch.org/"
-SRC_URI="https://github.com/pytorch/${PN}/archive/refs/tags/v${PV}.tar.gz
- -> ${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64"
-RESTRICT="test"
-
-REQUIRED_USE=${PYTHON_REQUIRED_USE}
-RDEPEND="
- ${PYTHON_DEPS}
- ~sci-libs/caffe2-${PV}[${PYTHON_SINGLE_USEDEP}]
- $(python_gen_cond_dep '
- dev-python/typing-extensions[${PYTHON_USEDEP}]
- dev-python/sympy[${PYTHON_USEDEP}]
- ')
-"
-DEPEND="${RDEPEND}
- $(python_gen_cond_dep '
- dev-python/pyyaml[${PYTHON_USEDEP}]
- ')
-"
-
-src_prepare() {
- eapply \
- "${FILESDIR}"/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch \
- "${FILESDIR}"/pytorch-1.9.0-Change-library-directory-according-to-CMake-build.patch \
- "${FILESDIR}"/${PN}-2.0.0-global-dlopen.patch \
- "${FILESDIR}"/pytorch-1.7.1-torch_shm_manager.patch \
- "${FILESDIR}"/${PN}-1.13.0-setup.patch \
- "${FILESDIR}"/${PN}-2.0.0-emptyso.patch \
-
- # Set build dir for pytorch's setup
- sed -i \
- -e "/BUILD_DIR/s|build|/var/lib/caffe2/|" \
- tools/setup_helpers/env.py \
- || die
- distutils-r1_src_prepare
-
- hprefixify tools/setup_helpers/env.py
-}
-
-src_compile() {
- PYTORCH_BUILD_VERSION=${PV} \
- PYTORCH_BUILD_NUMBER=0 \
- USE_SYSTEM_LIBS=ON \
- CMAKE_BUILD_DIR="${BUILD_DIR}" \
- BUILD_DIR= \
- distutils-r1_src_compile develop sdist
-}
-
-src_install() {
- USE_SYSTEM_LIBS=ON distutils-r1_src_install
-}
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-03-22 20:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-14 19:32 [gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/ Alfredo Tupone
-- strict thread matches above, loose matches on Subject: below --
2024-03-22 20:42 Alfredo Tupone
2024-03-08 18:46 Alfredo Tupone
2023-12-10 10:36 Alfredo Tupone
2022-06-26 7:58 Alfredo Tupone
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox