[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/files/
commit: aef1700cf7f52bbc186c79c266b44a1c96a141a6 Author: Michael Mair-Keimberger levelnine at> AuthorDate: Tue May 28 16:28:43 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Thu May 30 14:54:17 2024 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aef1700c sci-libs/pytorch: remove unused patch Signed-off-by: Michael Mair-Keimberger levelnine.at> Signed-off-by: Arthur Zamarin gentoo.org> sci-libs/pytorch/files/pytorch-2.1.1-emptyso.patch | 13 - 1 file changed, 13 deletions(-) diff --git a/sci-libs/pytorch/files/pytorch-2.1.1-emptyso.patch b/sci-libs/pytorch/files/pytorch-2.1.1-emptyso.patch deleted file mode 100644 index b2983609819a.. --- a/sci-libs/pytorch/files/pytorch-2.1.1-emptyso.patch +++ /dev/null @@ -1,13 +0,0 @@ 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=[]),
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: 967fb7d17397d503065c49b6f11394099937f503 Author: Alfredo Tupone gentoo org> AuthorDate: Sun May 26 15:07:21 2024 + Commit: Alfredo Tupone gentoo org> CommitDate: Sun May 26 15:18:10 2024 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=967fb7d1 sci-libs/pytorch: drop 2.1.2-r1 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/Manifest| 1 - sci-libs/pytorch/pytorch-2.1.2-r1.ebuild | 66 2 files changed, 67 deletions(-) diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest index f1df96691729..d70fba8fc67b 100644 --- a/sci-libs/pytorch/Manifest +++ b/sci-libs/pytorch/Manifest @@ -1,3 +1,2 @@ -DIST pytorch-2.1.2.tar.gz 116316469 BLAKE2B c5a55ee264bc3477d3556ba6376b5591117e992e56e0dd0c9ba93d12526e2727f7840f6f1e0730a38223b6492c9556840c4ebf22ffd220e97225c2abff303747 SHA512 a8961d78ad785b13c959a0612563a60e0de17a7c8bb9822ddea9a24072796354d07e81c47b6cc8761b21a6448845b088cf80e1661d9e889b0ed5474d3dc76756 DIST pytorch-2.2.2.tar.gz 116367503 BLAKE2B 0be22f2ec4b9aac6f5e976664cae01facf07929a32565cd57d7cc5b2d9888e9ae71ca301853752fe8f31d174d04c9974eb9ed2f3d452360a50ccf024f200726a SHA512 7990e0f9484038c3458c0bda2c863bf2b19e56edab81fc5938c6e0f08b17558287f853bb67350e8cca8f42bec0f1d4ba0e94e50a145db8da44bdd4bd703d91d0 DIST pytorch-2.3.0.tar.gz 117029829 BLAKE2B 8f9c0d71ee0a9219b495eddccdcc65107f7ad537c43c68100b229f3d27b0e6c01ccb1659c7fffc356a48d80f2adc0a10361305dc8f1df20446de837d380f89f6 SHA512 67f7e9a096c3ffb952206ebf9105bedebb68c24ad82456083adf1d1d210437fcaa9dd52b68484cfc97d408c9eebc9541c76868c34a7c9982494dc3f424cfb07c diff --git a/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild b/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild deleted file mode 100644 index 40a5e8ab3df1.. --- a/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild +++ /dev/null @@ -1,66 +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_{10..12} ) -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}"/${PN}-2.1.1-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}"/${PN}-2.1.1-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 -}
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: a707f7e24c174e2ceb6e9ae93d8a3571dd99e048 Author: Alfredo Tupone gentoo org> AuthorDate: Tue Apr 30 17:20:41 2024 + Commit: Alfredo Tupone gentoo org> CommitDate: Tue Apr 30 17:20:58 2024 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a707f7e2 sci-libs/pytorch: add 2.3.0 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/Manifest | 1 + sci-libs/pytorch/pytorch-2.3.0.ebuild | 66 +++ 2 files changed, 67 insertions(+) diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest index b72973ca6f63..f1df96691729 100644 --- a/sci-libs/pytorch/Manifest +++ b/sci-libs/pytorch/Manifest @@ -1,2 +1,3 @@ DIST pytorch-2.1.2.tar.gz 116316469 BLAKE2B c5a55ee264bc3477d3556ba6376b5591117e992e56e0dd0c9ba93d12526e2727f7840f6f1e0730a38223b6492c9556840c4ebf22ffd220e97225c2abff303747 SHA512 a8961d78ad785b13c959a0612563a60e0de17a7c8bb9822ddea9a24072796354d07e81c47b6cc8761b21a6448845b088cf80e1661d9e889b0ed5474d3dc76756 DIST pytorch-2.2.2.tar.gz 116367503 BLAKE2B 0be22f2ec4b9aac6f5e976664cae01facf07929a32565cd57d7cc5b2d9888e9ae71ca301853752fe8f31d174d04c9974eb9ed2f3d452360a50ccf024f200726a SHA512 7990e0f9484038c3458c0bda2c863bf2b19e56edab81fc5938c6e0f08b17558287f853bb67350e8cca8f42bec0f1d4ba0e94e50a145db8da44bdd4bd703d91d0 +DIST pytorch-2.3.0.tar.gz 117029829 BLAKE2B 8f9c0d71ee0a9219b495eddccdcc65107f7ad537c43c68100b229f3d27b0e6c01ccb1659c7fffc356a48d80f2adc0a10361305dc8f1df20446de837d380f89f6 SHA512 67f7e9a096c3ffb952206ebf9105bedebb68c24ad82456083adf1d1d210437fcaa9dd52b68484cfc97d408c9eebc9541c76868c34a7c9982494dc3f424cfb07c diff --git a/sci-libs/pytorch/pytorch-2.3.0.ebuild b/sci-libs/pytorch/pytorch-2.3.0.ebuild new file mode 100644 index ..75fbde095842 --- /dev/null +++ b/sci-libs/pytorch/pytorch-2.3.0.ebuild @@ -0,0 +1,66 @@ +# 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_{10..12} ) +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}"/${PN}-2.1.1-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}"/${PN}-2.2.1-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 +}
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: f1151f8cb2e89dc758a767f7fd34ca7e97455c22 Author: Alfredo Tupone gentoo org> AuthorDate: Thu Apr 4 10:01:53 2024 + Commit: Alfredo Tupone gentoo org> CommitDate: Thu Apr 4 10:01:53 2024 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1151f8c sci-libs/pytorch: disable py3.9 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/pytorch-2.2.2.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sci-libs/pytorch/pytorch-2.2.2.ebuild b/sci-libs/pytorch/pytorch-2.2.2.ebuild index df97d95b2528..75fbde095842 100644 --- a/sci-libs/pytorch/pytorch-2.2.2.ebuild +++ b/sci-libs/pytorch/pytorch-2.2.2.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{9..12} ) +PYTHON_COMPAT=( python3_{10..12} ) DISTUTILS_SINGLE_IMPL=1 DISTUTILS_EXT=1 inherit distutils-r1 prefix
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: 601b06974369767b85c13a316227aa70f305bbae Author: Alfredo Tupone gentoo org> AuthorDate: Thu Apr 4 09:59:57 2024 + Commit: Alfredo Tupone gentoo org> CommitDate: Thu Apr 4 09:59:57 2024 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=601b0697 sci-libs/pytorch: add 2.2.2, drop 2.2.1 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/Manifest | 2 +- sci-libs/pytorch/{pytorch-2.2.1.ebuild => pytorch-2.2.2.ebuild} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest index 09e1f64fbe4c..b72973ca6f63 100644 --- a/sci-libs/pytorch/Manifest +++ b/sci-libs/pytorch/Manifest @@ -1,2 +1,2 @@ DIST pytorch-2.1.2.tar.gz 116316469 BLAKE2B c5a55ee264bc3477d3556ba6376b5591117e992e56e0dd0c9ba93d12526e2727f7840f6f1e0730a38223b6492c9556840c4ebf22ffd220e97225c2abff303747 SHA512 a8961d78ad785b13c959a0612563a60e0de17a7c8bb9822ddea9a24072796354d07e81c47b6cc8761b21a6448845b088cf80e1661d9e889b0ed5474d3dc76756 -DIST pytorch-2.2.1.tar.gz 116370903 BLAKE2B 7d08e80f91bad76fba1751c30a34bebfe7145058b7758c0d47112702263a80666f70687a8860744725c6aa995e854f766a5bfa4644c23e5635e7e08c8d63a6e9 SHA512 f19ebcf59d183c3348946ba7cfcab2bc4ca93785863b8edc39dba5772083a7b0425ccb4f92a8df4dc0d18246c75e8ff812993161467fbf9dc48d7fb28a1e26f1 +DIST pytorch-2.2.2.tar.gz 116367503 BLAKE2B 0be22f2ec4b9aac6f5e976664cae01facf07929a32565cd57d7cc5b2d9888e9ae71ca301853752fe8f31d174d04c9974eb9ed2f3d452360a50ccf024f200726a SHA512 7990e0f9484038c3458c0bda2c863bf2b19e56edab81fc5938c6e0f08b17558287f853bb67350e8cca8f42bec0f1d4ba0e94e50a145db8da44bdd4bd703d91d0 diff --git a/sci-libs/pytorch/pytorch-2.2.1.ebuild b/sci-libs/pytorch/pytorch-2.2.2.ebuild similarity index 97% rename from sci-libs/pytorch/pytorch-2.2.1.ebuild rename to sci-libs/pytorch/pytorch-2.2.2.ebuild index 442d74f6a2d6..df97d95b2528 100644 --- a/sci-libs/pytorch/pytorch-2.2.1.ebuild +++ b/sci-libs/pytorch/pytorch-2.2.2.ebuild @@ -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}"/${P}-emptyso.patch \ + "${FILESDIR}"/${PN}-2.2.1-emptyso.patch \ # Set build dir for pytorch's setup sed -i \
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
commit: 3969938e8e1d00781a660e7f188549070671b82c Author: Alfredo Tupone gentoo org> AuthorDate: Fri Mar 22 20:41:31 2024 + Commit: Alfredo Tupone gentoo org> CommitDate: Fri Mar 22 20:42:12 2024 + 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 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.. --- 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.. --- 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.. --- 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__.py2023-02-15 20:27:51.747853677 +0100 -+++ b/torch/__init__.py2023-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 - #
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: b8a8608e64e318ca0bd8fce3ed34468453a87be4 Author: Alfredo Tupone gentoo org> AuthorDate: Fri Mar 8 18:47:16 2024 + Commit: Alfredo Tupone gentoo org> CommitDate: Fri Mar 8 18:47:16 2024 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b8a8608e sci-libs/pytorch: disable py3.9 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/pytorch-2.1.2-r1.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild b/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild index eeedad68bd1b..40a5e8ab3df1 100644 --- a/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild +++ b/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{9..12} ) +PYTHON_COMPAT=( python3_{10..12} ) DISTUTILS_SINGLE_IMPL=1 DISTUTILS_EXT=1 inherit distutils-r1 prefix
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
commit: 4eb8205d726b5460edf6a0071e44170b4ad06f38 Author: Alfredo Tupone gentoo org> AuthorDate: Fri Mar 8 18:44:22 2024 + Commit: Alfredo Tupone gentoo org> CommitDate: Fri Mar 8 18:45:34 2024 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4eb8205d sci-libs/pytorch: add 2.2.1 Signed-off-by: Alfredo Tupone 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 ..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 \
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: 580d5b265f60162f18b90ccd5ec23c4e37219574 Author: Alfredo Tupone gentoo org> AuthorDate: Sun Jan 21 10:09:44 2024 + Commit: Alfredo Tupone gentoo org> CommitDate: Sun Jan 21 10:10:07 2024 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=580d5b26 sci-libs/pytorch: IndirectInherits Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/pytorch-1.13.1-r2.ebuild | 4 ++-- sci-libs/pytorch/pytorch-2.0.1-r1.ebuild | 4 ++-- sci-libs/pytorch/pytorch-2.1.2-r1.ebuild | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sci-libs/pytorch/pytorch-1.13.1-r2.ebuild b/sci-libs/pytorch/pytorch-1.13.1-r2.ebuild index f93b9a108820..14b2e8d56547 100644 --- a/sci-libs/pytorch/pytorch-1.13.1-r2.ebuild +++ b/sci-libs/pytorch/pytorch-1.13.1-r2.ebuild @@ -1,4 +1,4 @@ -# Copyright 2022-2023 Gentoo Authors +# Copyright 2022-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -6,7 +6,7 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools PYTHON_COMPAT=( python3_{9..11} ) DISTUTILS_SINGLE_IMPL=1 -inherit distutils-r1 +inherit distutils-r1 multibuild DESCRIPTION="Tensors and Dynamic neural networks in Python" HOMEPAGE="https://pytorch.org/; diff --git a/sci-libs/pytorch/pytorch-2.0.1-r1.ebuild b/sci-libs/pytorch/pytorch-2.0.1-r1.ebuild index 11f7d447a1e1..2ee51ce0e418 100644 --- a/sci-libs/pytorch/pytorch-2.0.1-r1.ebuild +++ b/sci-libs/pytorch/pytorch-2.0.1-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 2022-2023 Gentoo Authors +# Copyright 2022-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -7,7 +7,7 @@ DISTUTILS_USE_PEP517=setuptools PYTHON_COMPAT=( python3_{9..11} ) DISTUTILS_SINGLE_IMPL=1 DISTUTILS_EXT=1 -inherit distutils-r1 prefix +inherit distutils-r1 multibuild 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.1.2-r1.ebuild index eeedad68bd1b..e3bdd2b2f216 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 prefix +inherit distutils-r1 multibuild prefix DESCRIPTION="Tensors and Dynamic neural networks in Python" HOMEPAGE="https://pytorch.org/;
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: 6c4610ee0544074c435417db797ba35a3f58c467 Author: Alfredo Tupone gentoo org> AuthorDate: Tue Jan 9 20:39:54 2024 + Commit: Alfredo Tupone gentoo org> CommitDate: Tue Jan 9 20:39:54 2024 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c4610ee sci-libs/pytorch: PythonCompatUpdate Closes: https://bugs.gentoo.org/921248 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/{pytorch-2.1.2.ebuild => pytorch-2.1.2-r1.ebuild} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sci-libs/pytorch/pytorch-2.1.2.ebuild b/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild similarity index 95% rename from sci-libs/pytorch/pytorch-2.1.2.ebuild rename to sci-libs/pytorch/pytorch-2.1.2-r1.ebuild index cc603731123f..eeedad68bd1b 100644 --- a/sci-libs/pytorch/pytorch-2.1.2.ebuild +++ b/sci-libs/pytorch/pytorch-2.1.2-r1.ebuild @@ -1,10 +1,10 @@ -# Copyright 2022-2023 Gentoo Authors +# 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} ) +PYTHON_COMPAT=( python3_{9..12} ) DISTUTILS_SINGLE_IMPL=1 DISTUTILS_EXT=1 inherit distutils-r1 prefix
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: 0d56c97d2731c37417676dd778b68213b8d3963c Author: Alfredo Tupone gentoo org> AuthorDate: Wed Jan 3 18:48:50 2024 + Commit: Alfredo Tupone gentoo org> CommitDate: Wed Jan 3 18:49:23 2024 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d56c97d sci-libs/pytorch: drop 2.0.0, 2.1.1-r1 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/Manifest| 2 - sci-libs/pytorch/pytorch-2.0.0.ebuild| 64 --- sci-libs/pytorch/pytorch-2.1.1-r1.ebuild | 66 3 files changed, 132 deletions(-) diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest index 2fc8f8663e91..a05e285f98e0 100644 --- a/sci-libs/pytorch/Manifest +++ b/sci-libs/pytorch/Manifest @@ -1,5 +1,3 @@ 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 DIST pytorch-2.1.2.tar.gz 116316469 BLAKE2B c5a55ee264bc3477d3556ba6376b5591117e992e56e0dd0c9ba93d12526e2727f7840f6f1e0730a38223b6492c9556840c4ebf22ffd220e97225c2abff303747 SHA512 a8961d78ad785b13c959a0612563a60e0de17a7c8bb9822ddea9a24072796354d07e81c47b6cc8761b21a6448845b088cf80e1661d9e889b0ed5474d3dc76756 diff --git a/sci-libs/pytorch/pytorch-2.0.0.ebuild b/sci-libs/pytorch/pytorch-2.0.0.ebuild deleted file mode 100644 index 506f1889b280.. --- a/sci-libs/pytorch/pytorch-2.0.0.ebuild +++ /dev/null @@ -1,64 +0,0 @@ -# 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 -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}] - 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}"/${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.1.1-r1.ebuild b/sci-libs/pytorch/pytorch-2.1.1-r1.ebuild deleted file mode 100644 index 6d8199663ff6.. --- a/sci-libs/pytorch/pytorch-2.1.1-r1.ebuild +++ /dev/null @@ -1,66 +0,0 @@ -# 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
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: fe0d2123de65d6d5d32306b2420875f790eff68e Author: Alfredo Tupone gentoo org> AuthorDate: Tue Dec 26 22:13:33 2023 + Commit: Alfredo Tupone gentoo org> CommitDate: Tue Dec 26 22:13:55 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe0d2123 sci-libs/pytorch: add 2.1.2 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/Manifest | 1 + sci-libs/pytorch/pytorch-2.1.2.ebuild | 66 +++ 2 files changed, 67 insertions(+) diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest index d51cccdc3c37..2fc8f8663e91 100644 --- a/sci-libs/pytorch/Manifest +++ b/sci-libs/pytorch/Manifest @@ -2,3 +2,4 @@ DIST pytorch-1.13.1.tar.gz 108279745 BLAKE2B 75de03b74dfdaf8d8fb5ea743fcc0c1b0e4 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 +DIST pytorch-2.1.2.tar.gz 116316469 BLAKE2B c5a55ee264bc3477d3556ba6376b5591117e992e56e0dd0c9ba93d12526e2727f7840f6f1e0730a38223b6492c9556840c4ebf22ffd220e97225c2abff303747 SHA512 a8961d78ad785b13c959a0612563a60e0de17a7c8bb9822ddea9a24072796354d07e81c47b6cc8761b21a6448845b088cf80e1661d9e889b0ed5474d3dc76756 diff --git a/sci-libs/pytorch/pytorch-2.1.2.ebuild b/sci-libs/pytorch/pytorch-2.1.2.ebuild new file mode 100644 index ..cc603731123f --- /dev/null +++ b/sci-libs/pytorch/pytorch-2.1.2.ebuild @@ -0,0 +1,66 @@ +# 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}"/${PN}-2.1.1-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}"/${PN}-2.1.1-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 +}
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: c884f73010d4d4459e9c9fb257a1d7d4467c7b70 Author: Alfredo Tupone gentoo org> AuthorDate: Sun Dec 24 11:47:13 2023 + Commit: Alfredo Tupone gentoo org> CommitDate: Sun Dec 24 11:47:48 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c884f730 sci-libs/pytorch: nvfuser installed in caffe2 Bug: https://bugs.gentoo.org/914572 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/{pytorch-2.1.1.ebuild => pytorch-2.1.1-r1.ebuild} | 2 -- 1 file changed, 2 deletions(-) diff --git a/sci-libs/pytorch/pytorch-2.1.1.ebuild b/sci-libs/pytorch/pytorch-2.1.1-r1.ebuild similarity index 95% rename from sci-libs/pytorch/pytorch-2.1.1.ebuild rename to sci-libs/pytorch/pytorch-2.1.1-r1.ebuild index e53135e714a6..6d8199663ff6 100644 --- a/sci-libs/pytorch/pytorch-2.1.1.ebuild +++ b/sci-libs/pytorch/pytorch-2.1.1-r1.ebuild @@ -63,6 +63,4 @@ python_compile() { python_install() { USE_SYSTEM_LIBS=ON distutils-r1_python_install - python_moduleinto nvfuser - python_domodule third_party/nvfuser/python/__init__.py }
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
commit: c0ea108c42908c6fd647cbbfad98d29b9ca86c21 Author: Alfredo Tupone gentoo org> AuthorDate: Sun Dec 10 10:35:41 2023 + Commit: Alfredo Tupone gentoo org> CommitDate: Sun Dec 10 10:35:41 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0ea108c sci-libs/pytorch: add 2.1.1 Signed-off-by: Alfredo Tupone 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 ..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 ..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 ..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 \ +
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: dad0c736cba97bd2cc73f529aa4b10693829a8e9 Author: Alfredo Tupone gentoo org> AuthorDate: Tue Aug 1 07:29:25 2023 + Commit: Alfredo Tupone gentoo org> CommitDate: Tue Aug 1 07:30:12 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dad0c736 sci-libs/pytorch: prefixify (by ZongyuZ) Closes: https://bugs.gentoo.org/911421 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/{pytorch-2.0.1.ebuild => pytorch-2.0.1-r1.ebuild} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sci-libs/pytorch/pytorch-2.0.1.ebuild b/sci-libs/pytorch/pytorch-2.0.1-r1.ebuild similarity index 95% rename from sci-libs/pytorch/pytorch-2.0.1.ebuild rename to sci-libs/pytorch/pytorch-2.0.1-r1.ebuild index b778dcb357c3..11f7d447a1e1 100644 --- a/sci-libs/pytorch/pytorch-2.0.1.ebuild +++ b/sci-libs/pytorch/pytorch-2.0.1-r1.ebuild @@ -7,7 +7,7 @@ DISTUTILS_USE_PEP517=setuptools PYTHON_COMPAT=( python3_{9..11} ) DISTUTILS_SINGLE_IMPL=1 DISTUTILS_EXT=1 -inherit distutils-r1 +inherit distutils-r1 prefix DESCRIPTION="Tensors and Dynamic neural networks in Python" HOMEPAGE="https://pytorch.org/; @@ -49,6 +49,8 @@ src_prepare() { tools/setup_helpers/env.py \ || die distutils-r1_src_prepare + + hprefixify tools/setup_helpers/env.py } src_compile() {
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: 426b63bcf071bae8629d1a50d209da6393bf15d3 Author: Alfredo Tupone gentoo org> AuthorDate: Sun May 14 07:58:28 2023 + Commit: Alfredo Tupone gentoo org> CommitDate: Sun May 14 07:58:55 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=426b63bc sci-libs/pytorch: add 2.0.1 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/Manifest | 1 + sci-libs/pytorch/pytorch-2.0.1.ebuild | 65 +++ 2 files changed, 66 insertions(+) diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest index 1424256938e9..0ee75499ccbe 100644 --- a/sci-libs/pytorch/Manifest +++ b/sci-libs/pytorch/Manifest @@ -1,2 +1,3 @@ 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 diff --git a/sci-libs/pytorch/pytorch-2.0.1.ebuild b/sci-libs/pytorch/pytorch-2.0.1.ebuild new file mode 100644 index ..b778dcb357c3 --- /dev/null +++ b/sci-libs/pytorch/pytorch-2.0.1.ebuild @@ -0,0 +1,65 @@ +# 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 + +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 +} + +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 +}
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/files/, sci-libs/pytorch/
commit: d2a5c15046bab11f3e70927d6b053ab98870acf0 Author: Alfredo Tupone gentoo org> AuthorDate: Wed Apr 5 19:35:41 2023 + Commit: Alfredo Tupone gentoo org> CommitDate: Wed Apr 5 19:35:58 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2a5c150 sci-libs/pytorch: add 2.0.0 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/Manifest | 1 + sci-libs/pytorch/files/pytorch-2.0.0-emptyso.patch | 15 + .../files/pytorch-2.0.0-global-dlopen.patch| 20 +++ sci-libs/pytorch/pytorch-2.0.0.ebuild | 64 ++ 4 files changed, 100 insertions(+) diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest index 616b75a49763..1424256938e9 100644 --- a/sci-libs/pytorch/Manifest +++ b/sci-libs/pytorch/Manifest @@ -1 +1,2 @@ DIST pytorch-1.13.1.tar.gz 108279745 BLAKE2B 75de03b74dfdaf8d8fb5ea743fcc0c1b0e408a714ad4160c487921220a7b1755e5fa6e587e6bbc8c9f34dd75e096d2e6dd69c80d24821835fff6c833314434d3 SHA512 f16f89d027efade11d057245cad5b69a390e88b458398310ae30de2dbff7c8fd7f1165be7b8da7ea989c81ac3f5a66c5cb9050610e441a97c83fb8aa28c0bd62 +DIST pytorch-2.0.0.tar.gz 111327292 BLAKE2B 6d593a975c0ade714f0b189f7e3c4ff704b9a9a2377b5e441a9cefc202fa22779966d08948e63671912c6ea5a0eee124042155f4f57a654db34e19e42f013cc9 SHA512 4dd76160711c0d87f3026c8b7fa3ed149dd86b8ac0ee9ecea0eaf80d2e6ce8c29368392e77b9466d90b60634087b462b782495997a5d33367cc8ca9fe14c8a14 diff --git a/sci-libs/pytorch/files/pytorch-2.0.0-emptyso.patch b/sci-libs/pytorch/files/pytorch-2.0.0-emptyso.patch new file mode 100644 index ..e4703894308a --- /dev/null +++ b/sci-libs/pytorch/files/pytorch-2.0.0-emptyso.patch @@ -0,0 +1,15 @@ +--- 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/files/pytorch-2.0.0-global-dlopen.patch b/sci-libs/pytorch/files/pytorch-2.0.0-global-dlopen.patch new file mode 100644 index ..0f1b400e234d --- /dev/null +++ b/sci-libs/pytorch/files/pytorch-2.0.0-global-dlopen.patch @@ -0,0 +1,20 @@ +--- a/torch/__init__.py2023-04-05 11:12:25.682681130 +0200 b/torch/__init__.py2023-04-05 11:13:00.640170307 +0200 +@@ -165,7 +165,7 @@ + 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 for wheel with cuda libs as PYPI deps + # As PyTorch is not purelib, but nvidia-*-cu11 is +@@ -187,7 +187,7 @@ + raise err + for lib_folder, lib_name in cuda_libs.items(): + _preload_cuda_deps(lib_folder, 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/pytorch-2.0.0.ebuild b/sci-libs/pytorch/pytorch-2.0.0.ebuild new file mode 100644 index ..506f1889b280 --- /dev/null +++ b/sci-libs/pytorch/pytorch-2.0.0.ebuild @@ -0,0 +1,64 @@ +# 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 +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}] + 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}"/${P}-global-dlopen.patch \ + "${FILESDIR}"/pytorch-1.7.1-torch_shm_manager.patch \ + "${FILESDIR}"/${PN}-1.13.0-setup.patch \ +
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/files/, sci-libs/pytorch/
commit: f4836af254dee6b81c749b3df569d7c5bd6faa98 Author: Alfredo Tupone gentoo org> AuthorDate: Fri Mar 24 21:40:49 2023 + Commit: Alfredo Tupone gentoo org> CommitDate: Fri Mar 24 21:41:36 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4836af2 sci-libs/pytorch: drop building an empty .so Closes: https://bugs.gentoo.org/902727 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/files/pytorch-1.13.1-emptyso.patch | 15 +++ ...{pytorch-1.13.1-r1.ebuild => pytorch-1.13.1-r2.ebuild} | 1 + 2 files changed, 16 insertions(+) diff --git a/sci-libs/pytorch/files/pytorch-1.13.1-emptyso.patch b/sci-libs/pytorch/files/pytorch-1.13.1-emptyso.patch new file mode 100644 index ..1479354b7f7a --- /dev/null +++ b/sci-libs/pytorch/files/pytorch-1.13.1-emptyso.patch @@ -0,0 +1,15 @@ +--- 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/pytorch-1.13.1-r1.ebuild b/sci-libs/pytorch/pytorch-1.13.1-r2.ebuild similarity index 97% rename from sci-libs/pytorch/pytorch-1.13.1-r1.ebuild rename to sci-libs/pytorch/pytorch-1.13.1-r2.ebuild index 956c5e89cbc8..f93b9a108820 100644 --- a/sci-libs/pytorch/pytorch-1.13.1-r1.ebuild +++ b/sci-libs/pytorch/pytorch-1.13.1-r2.ebuild @@ -39,6 +39,7 @@ src_prepare() { "${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 \
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/files/, sci-libs/pytorch/
commit: 32fc208629a6e23dc5c64902ab73be47a305743a Author: Alfredo Tupone gentoo org> AuthorDate: Wed Feb 22 08:03:32 2023 + Commit: Alfredo Tupone gentoo org> CommitDate: Wed Feb 22 08:03:47 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32fc2086 sci-libs/pytorch: drop 1.12.0-r2, 1.12.1, 1.13.0 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/Manifest | 3 -- .../files/pytorch-1.12.0-CVE-2022-45907.patch | 59 .../files/pytorch-1.6.0-global-dlopen.patch| 15 -- sci-libs/pytorch/pytorch-1.12.0-r2.ebuild | 62 - sci-libs/pytorch/pytorch-1.12.1.ebuild | 62 - sci-libs/pytorch/pytorch-1.13.0.ebuild | 63 -- 6 files changed, 264 deletions(-) diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest index 7a1c9e4370ae..616b75a49763 100644 --- a/sci-libs/pytorch/Manifest +++ b/sci-libs/pytorch/Manifest @@ -1,4 +1 @@ -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 DIST pytorch-1.13.1.tar.gz 108279745 BLAKE2B 75de03b74dfdaf8d8fb5ea743fcc0c1b0e408a714ad4160c487921220a7b1755e5fa6e587e6bbc8c9f34dd75e096d2e6dd69c80d24821835fff6c833314434d3 SHA512 f16f89d027efade11d057245cad5b69a390e88b458398310ae30de2dbff7c8fd7f1165be7b8da7ea989c81ac3f5a66c5cb9050610e441a97c83fb8aa28c0bd62 diff --git a/sci-libs/pytorch/files/pytorch-1.12.0-CVE-2022-45907.patch b/sci-libs/pytorch/files/pytorch-1.12.0-CVE-2022-45907.patch deleted file mode 100644 index 085b6d9ca1bb.. --- a/sci-libs/pytorch/files/pytorch-1.12.0-CVE-2022-45907.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 78cad998e505b667d25ac42f8aaa24409f5031e1 Mon Sep 17 00:00:00 2001 -From: Nikita Shulga -Date: Thu, 17 Nov 2022 22:05:27 + -Subject: [PATCH] [JIT][Security] Do not blindly eval input string (#89189) - -Introduce `_eval_no_call` method, that evaluates statement only if it -does not contain any calls(done by examining the bytecode), thus preventing command injection exploit - -Added simple unit test to check for that -`torch.jit.annotations.get_signature` would not result in calling random -code. - -Although, this code path exists for Python-2 compatibility, and perhaps -should be simply removed. - -diff --git a/torch/jit/annotations.py b/torch/jit/annotations.py -index a4a36ce36a5e8..a6ff2d04d2076 100644 a/torch/jit/annotations.py -+++ b/torch/jit/annotations.py -@@ -1,4 +1,5 @@ - import ast -+import dis - import enum - import inspect - import re -@@ -144,6 +145,15 @@ def check_fn(fn, loc): - raise torch.jit.frontend.FrontendError(loc, "Expected a single top-level function") - - -+def _eval_no_call(stmt, glob, loc): -+"""Evaluate statement as long as it does not contain any method/function calls""" -+bytecode = compile(stmt, "", mode="eval") -+for insn in dis.get_instructions(bytecode): -+if "CALL" in insn.opname: -+raise RuntimeError(f"Type annotation should not contain calls, but '{stmt}' does") -+return eval(bytecode, glob, loc) # type: ignore[arg-type] # noqa: P204 -+ -+ - def parse_type_line(type_line, rcb, loc): - """Parses a type annotation specified as a comment. - -@@ -154,7 +164,7 @@ def parse_type_line(type_line, rcb, loc): - arg_ann_str, ret_ann_str = split_type_line(type_line) - - try: --arg_ann = eval(arg_ann_str, {}, EvalEnv(rcb)) # type: ignore[arg-type] # noqa: P204 -+arg_ann = _eval_no_call(arg_ann_str, {}, EvalEnv(rcb)) - except (NameError, SyntaxError) as e: - raise RuntimeError("Failed to parse the argument list of a type annotation") from e - -@@ -162,7 +172,7 @@ def parse_type_line(type_line, rcb, loc): - arg_ann = (arg_ann,) - - try: --ret_ann = eval(ret_ann_str, {}, EvalEnv(rcb)) # type: ignore[arg-type] # noqa: P204 -+ret_ann = _eval_no_call(ret_ann_str, {}, EvalEnv(rcb)) - except (NameError, SyntaxError) as e: - raise RuntimeError("Failed to parse the return type of a type
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: 1c138845549fbbd957aa9c6c41aa57d81666c04c Author: Alfredo Tupone gentoo org> AuthorDate: Wed Feb 22 06:52:45 2023 + Commit: Alfredo Tupone gentoo org> CommitDate: Wed Feb 22 06:53:13 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1c138845 sci-libs/pytorch: support python 3.11 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/{pytorch-1.13.1.ebuild => pytorch-1.13.1-r1.ebuild} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sci-libs/pytorch/pytorch-1.13.1.ebuild b/sci-libs/pytorch/pytorch-1.13.1-r1.ebuild similarity index 97% rename from sci-libs/pytorch/pytorch-1.13.1.ebuild rename to sci-libs/pytorch/pytorch-1.13.1-r1.ebuild index 898c43a39ba9..956c5e89cbc8 100644 --- a/sci-libs/pytorch/pytorch-1.13.1.ebuild +++ b/sci-libs/pytorch/pytorch-1.13.1-r1.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{9,10} ) +PYTHON_COMPAT=( python3_{9..11} ) DISTUTILS_SINGLE_IMPL=1 inherit distutils-r1
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/files/, sci-libs/pytorch/
commit: de632cbceb0e91127bcaefb47e3538ca48477b15 Author: Alfredo Tupone gentoo org> AuthorDate: Wed Feb 15 19:40:24 2023 + Commit: Alfredo Tupone gentoo org> CommitDate: Wed Feb 15 19:40:24 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de632cbc sci-libs/pytorch: add 1.13.1 Closes: https://bugs.gentoo.org/893594 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/Manifest | 1 + .../files/pytorch-1.13.1-global-dlopen.patch | 23 sci-libs/pytorch/pytorch-1.13.1.ebuild | 62 ++ 3 files changed, 86 insertions(+) diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest index fba79e4a9a24..7a1c9e4370ae 100644 --- a/sci-libs/pytorch/Manifest +++ b/sci-libs/pytorch/Manifest @@ -1,3 +1,4 @@ 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 +DIST pytorch-1.13.1.tar.gz 108279745 BLAKE2B 75de03b74dfdaf8d8fb5ea743fcc0c1b0e408a714ad4160c487921220a7b1755e5fa6e587e6bbc8c9f34dd75e096d2e6dd69c80d24821835fff6c833314434d3 SHA512 f16f89d027efade11d057245cad5b69a390e88b458398310ae30de2dbff7c8fd7f1165be7b8da7ea989c81ac3f5a66c5cb9050610e441a97c83fb8aa28c0bd62 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 new file mode 100644 index ..4f414be67a29 --- /dev/null +++ b/sci-libs/pytorch/files/pytorch-1.13.1-global-dlopen.patch @@ -0,0 +1,23 @@ +Don't hardcode the library path. Leave it to the dynamic loader. + +Index: pytorch-1.13.1/torch/__init__.py +=== +--- a/torch/__init__.py2023-02-15 20:27:51.747853677 +0100 b/torch/__init__.py2023-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/pytorch-1.13.1.ebuild b/sci-libs/pytorch/pytorch-1.13.1.ebuild new file mode 100644 index ..898c43a39ba9 --- /dev/null +++ b/sci-libs/pytorch/pytorch-1.13.1.ebuild @@ -0,0 +1,62 @@ +# 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}"/${P}-global-dlopen.patch \ + "${FILESDIR}"/pytorch-1.7.1-torch_shm_manager.patch \ + "${FILESDIR}"/${PN}-1.13.0-setup.patch \ + + # Set build dir for pytorch's setup + sed -i \ + -e "/BUILD_DIR/s|build|/var/lib/caffe2/|" \ +
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
commit: 3c8165f6ff751f984855d95e5f66d2d66b65a04f Author: Alfredo Tupone gentoo org> AuthorDate: Tue Feb 14 19:31:25 2023 + Commit: Alfredo Tupone gentoo org> CommitDate: Tue Feb 14 19:31:40 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c8165f6 sci-libs/pytorch: add 1.13.0 Signed-off-by: Alfredo Tupone 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 ..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 ..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 +}
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: aad83ecda38ba17d8bd1b68d3ae42ceb57b57acd Author: Alfredo Tupone gentoo org> AuthorDate: Sun Feb 12 09:08:37 2023 + Commit: Alfredo Tupone gentoo org> CommitDate: Sun Feb 12 09:08:57 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aad83ecd sci-libs/pytorch: add 1.12.1 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/Manifest | 1 + sci-libs/pytorch/pytorch-1.12.1.ebuild | 62 ++ 2 files changed, 63 insertions(+) diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest index 013309cd70ce..adfe026eaff0 100644 --- a/sci-libs/pytorch/Manifest +++ b/sci-libs/pytorch/Manifest @@ -1 +1,2 @@ DIST pytorch-1.12.0.tar.gz 106286765 BLAKE2B ff9bafedb35f859f7dccb9b606299cf9c345bdaa0deb87ecfe0c0c30c3c828414d989e1d9a243d9b7cd3f376d56a2f81c241ca2e3c9a8a2b30cddcdeddd3a5c7 SHA512 c9c748a2e0047daaaf199a1ba3198d2d1aee47f664170a9b34ccacd3deeb95f2070e4035eeb900012ef48dc62cf6fb6806f1a1dfe22de8c94892963076e593b7 +DIST pytorch-1.12.1.tar.gz 106311625 BLAKE2B e8ca19d0e1987449c33ad4c36722a3a467f7f8a9f90be2a7f2de643cbd665038f6802b5ff1f1d3da09b6253d8f29e11549a24295de013d97f73affe538c84c99 SHA512 afeb551904ebd9b5901ae623a98eadbb3045115247cedf8006a940742cfad04e5ce24cfaf363336a9ed88d7ce6a4ac53dbb6a5c690aef6efdf20477c3a22c7ca diff --git a/sci-libs/pytorch/pytorch-1.12.1.ebuild b/sci-libs/pytorch/pytorch-1.12.1.ebuild new file mode 100644 index ..0948de848ca1 --- /dev/null +++ b/sci-libs/pytorch/pytorch-1.12.1.ebuild @@ -0,0 +1,62 @@ +# 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}"/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 +}
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: fa97825f64cac2d8ae1fe93f8bf5d1c6abc75930 Author: Alfredo Tupone gentoo org> AuthorDate: Tue Jan 3 06:19:00 2023 + Commit: Alfredo Tupone gentoo org> CommitDate: Tue Jan 3 06:20:02 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa97825f sci-libs/pytorch: use single python class Signed-off-by: Alfredo Tupone gentoo.org> .../{pytorch-1.12.0-r1.ebuild => pytorch-1.12.0-r2.ebuild} | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sci-libs/pytorch/pytorch-1.12.0-r1.ebuild b/sci-libs/pytorch/pytorch-1.12.0-r2.ebuild similarity index 82% rename from sci-libs/pytorch/pytorch-1.12.0-r1.ebuild rename to sci-libs/pytorch/pytorch-1.12.0-r2.ebuild index 02fa58c7ba75..83a4944773f1 100644 --- a/sci-libs/pytorch/pytorch-1.12.0-r1.ebuild +++ b/sci-libs/pytorch/pytorch-1.12.0-r2.ebuild @@ -1,10 +1,11 @@ -# Copyright 2022 Gentoo Authors +# 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_{8,9,10} ) +DISTUTILS_SINGLE_IMPL=1 inherit distutils-r1 DESCRIPTION="Tensors and Dynamic neural networks in Python" @@ -20,11 +21,15 @@ RESTRICT="test" REQUIRED_USE=${PYTHON_REQUIRED_USE} RDEPEND=" ${PYTHON_DEPS} - ~sci-libs/caffe2-${PV}[${PYTHON_USEDEP}] - dev-python/typing-extensions[${PYTHON_USEDEP}] + ~sci-libs/caffe2-${PV}[${PYTHON_SINGLE_USEDEP}] + $(python_gen_cond_dep ' + dev-python/typing-extensions[${PYTHON_USEDEP}] + ') " DEPEND="${RDEPEND} - dev-python/pyyaml[${PYTHON_USEDEP}] + $(python_gen_cond_dep ' + dev-python/pyyaml[${PYTHON_USEDEP}] + ') " src_prepare() {
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/files/, sci-libs/pytorch/
commit: 1b1b577bb33b34295e8cad2294c5486ee50200cf Author: Alfredo Tupone gentoo org> AuthorDate: Wed Nov 30 18:12:11 2022 + Commit: Alfredo Tupone gentoo org> CommitDate: Wed Nov 30 18:13:03 2022 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b1b577b sci-libs/pytorch: fix CVE-2022-45907 Bug: https://bugs.gentoo.org/883381 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/Manifest | 1 - .../files/pytorch-1.12.0-CVE-2022-45907.patch | 59 ++ sci-libs/pytorch/metadata.xml | 11 sci-libs/pytorch/pytorch-1.11.0.ebuild | 58 - ...orch-1.12.0.ebuild => pytorch-1.12.0-r1.ebuild} | 3 +- 5 files changed, 61 insertions(+), 71 deletions(-) diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest index 0d28654e641f..013309cd70ce 100644 --- a/sci-libs/pytorch/Manifest +++ b/sci-libs/pytorch/Manifest @@ -1,2 +1 @@ -DIST pytorch-1.11.0.tar.gz 20719323 BLAKE2B 24e7aaa2c26821d36f8092542de9d8d5ac85a619fb9fffb5131987958842afb1cad395780662d15f3411a7cc6ff83a445871960eca1e469fcbf0b9895d83d6e0 SHA512 2342eb7a1a241f5855a7cf12e11f62bc4baaa78d1d0864e53bfc946e783eb4addd05ca154a814d2376cd602098b5547e61c158d6eddb7cad5a9f3b0c1357adca DIST pytorch-1.12.0.tar.gz 106286765 BLAKE2B ff9bafedb35f859f7dccb9b606299cf9c345bdaa0deb87ecfe0c0c30c3c828414d989e1d9a243d9b7cd3f376d56a2f81c241ca2e3c9a8a2b30cddcdeddd3a5c7 SHA512 c9c748a2e0047daaaf199a1ba3198d2d1aee47f664170a9b34ccacd3deeb95f2070e4035eeb900012ef48dc62cf6fb6806f1a1dfe22de8c94892963076e593b7 diff --git a/sci-libs/pytorch/files/pytorch-1.12.0-CVE-2022-45907.patch b/sci-libs/pytorch/files/pytorch-1.12.0-CVE-2022-45907.patch new file mode 100644 index ..085b6d9ca1bb --- /dev/null +++ b/sci-libs/pytorch/files/pytorch-1.12.0-CVE-2022-45907.patch @@ -0,0 +1,59 @@ +From 78cad998e505b667d25ac42f8aaa24409f5031e1 Mon Sep 17 00:00:00 2001 +From: Nikita Shulga +Date: Thu, 17 Nov 2022 22:05:27 + +Subject: [PATCH] [JIT][Security] Do not blindly eval input string (#89189) + +Introduce `_eval_no_call` method, that evaluates statement only if it +does not contain any calls(done by examining the bytecode), thus preventing command injection exploit + +Added simple unit test to check for that +`torch.jit.annotations.get_signature` would not result in calling random +code. + +Although, this code path exists for Python-2 compatibility, and perhaps +should be simply removed. + +diff --git a/torch/jit/annotations.py b/torch/jit/annotations.py +index a4a36ce36a5e8..a6ff2d04d2076 100644 +--- a/torch/jit/annotations.py b/torch/jit/annotations.py +@@ -1,4 +1,5 @@ + import ast ++import dis + import enum + import inspect + import re +@@ -144,6 +145,15 @@ def check_fn(fn, loc): + raise torch.jit.frontend.FrontendError(loc, "Expected a single top-level function") + + ++def _eval_no_call(stmt, glob, loc): ++"""Evaluate statement as long as it does not contain any method/function calls""" ++bytecode = compile(stmt, "", mode="eval") ++for insn in dis.get_instructions(bytecode): ++if "CALL" in insn.opname: ++raise RuntimeError(f"Type annotation should not contain calls, but '{stmt}' does") ++return eval(bytecode, glob, loc) # type: ignore[arg-type] # noqa: P204 ++ ++ + def parse_type_line(type_line, rcb, loc): + """Parses a type annotation specified as a comment. + +@@ -154,7 +164,7 @@ def parse_type_line(type_line, rcb, loc): + arg_ann_str, ret_ann_str = split_type_line(type_line) + + try: +-arg_ann = eval(arg_ann_str, {}, EvalEnv(rcb)) # type: ignore[arg-type] # noqa: P204 ++arg_ann = _eval_no_call(arg_ann_str, {}, EvalEnv(rcb)) + except (NameError, SyntaxError) as e: + raise RuntimeError("Failed to parse the argument list of a type annotation") from e + +@@ -162,7 +172,7 @@ def parse_type_line(type_line, rcb, loc): + arg_ann = (arg_ann,) + + try: +-ret_ann = eval(ret_ann_str, {}, EvalEnv(rcb)) # type: ignore[arg-type] # noqa: P204 ++ret_ann = _eval_no_call(ret_ann_str, {}, EvalEnv(rcb)) + except (NameError, SyntaxError) as e: + raise RuntimeError("Failed to parse the return type of a type annotation") from e + diff --git a/sci-libs/pytorch/metadata.xml b/sci-libs/pytorch/metadata.xml index bc2785e5f6db..d12749aa5c21 100644 --- a/sci-libs/pytorch/metadata.xml +++ b/sci-libs/pytorch/metadata.xml @@ -5,17 +5,6 @@ tup...@gentoo.org Tupone Alfredo - - Add support for CUDA processing - Add support for video processing operators - Use NNPACK - Add support for math operations through numpy - Use OpenCL - Add support for image processing operators - Use OpenMP for parallel code - Use QNNPACK - Use XNNPACK -
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: 78893e494fae29e990504d527800096efb48299e Author: Alfredo Tupone gentoo org> AuthorDate: Tue Jul 5 06:08:24 2022 + Commit: Alfredo Tupone gentoo org> CommitDate: Tue Jul 5 06:08:24 2022 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78893e49 sci-libs/pytorch: add USE flags controlling caffe2 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/metadata.xml | 11 +++ sci-libs/pytorch/pytorch-1.11.0.ebuild | 2 ++ 2 files changed, 13 insertions(+) diff --git a/sci-libs/pytorch/metadata.xml b/sci-libs/pytorch/metadata.xml index d12749aa5c21..bc2785e5f6db 100644 --- a/sci-libs/pytorch/metadata.xml +++ b/sci-libs/pytorch/metadata.xml @@ -5,6 +5,17 @@ tup...@gentoo.org Tupone Alfredo + + Add support for CUDA processing + Add support for video processing operators + Use NNPACK + Add support for math operations through numpy + Use OpenCL + Add support for image processing operators + Use OpenMP for parallel code + Use QNNPACK + Use XNNPACK + pytorch/pytorch diff --git a/sci-libs/pytorch/pytorch-1.11.0.ebuild b/sci-libs/pytorch/pytorch-1.11.0.ebuild index 0a1cae78f4bb..401bdea8264a 100644 --- a/sci-libs/pytorch/pytorch-1.11.0.ebuild +++ b/sci-libs/pytorch/pytorch-1.11.0.ebuild @@ -16,11 +16,13 @@ LICENSE="BSD" SLOT="0" KEYWORDS="~amd64" RESTRICT="test" +IUSE="cuda ffmpeg nnpack +numpy opencl opencv openmp qnnpack xnnpack" REQUIRED_USE=${PYTHON_REQUIRED_USE} RDEPEND=" ${PYTHON_DEPS} ~sci-libs/caffe2-${PV}[${PYTHON_USEDEP}] + sci-libs/caffe2[cuda?,ffmpeg?,nnpack?,numpy?,opencl?,opencv?,openmp?,qnnpack?,xnnpack?] dev-python/typing-extensions[${PYTHON_USEDEP}] " DEPEND="${RDEPEND}
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: 51a62dbc390c29214e3364cce32f01f28c16eefd Author: James Beddek posteo de> AuthorDate: Sun Jul 3 07:59:03 2022 + Commit: Alfredo Tupone gentoo org> CommitDate: Sun Jul 3 10:49:38 2022 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51a62dbc sci-libs/pytorch: add 1.12.0 Signed-off-by: James Beddek posteo.de> Closes: https://github.com/gentoo/gentoo/pull/26209 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/Manifest | 1 + sci-libs/pytorch/pytorch-1.12.0.ebuild | 56 ++ 2 files changed, 57 insertions(+) diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest index ae4d5567b7fc..0d28654e641f 100644 --- a/sci-libs/pytorch/Manifest +++ b/sci-libs/pytorch/Manifest @@ -1 +1,2 @@ DIST pytorch-1.11.0.tar.gz 20719323 BLAKE2B 24e7aaa2c26821d36f8092542de9d8d5ac85a619fb9fffb5131987958842afb1cad395780662d15f3411a7cc6ff83a445871960eca1e469fcbf0b9895d83d6e0 SHA512 2342eb7a1a241f5855a7cf12e11f62bc4baaa78d1d0864e53bfc946e783eb4addd05ca154a814d2376cd602098b5547e61c158d6eddb7cad5a9f3b0c1357adca +DIST pytorch-1.12.0.tar.gz 106286765 BLAKE2B ff9bafedb35f859f7dccb9b606299cf9c345bdaa0deb87ecfe0c0c30c3c828414d989e1d9a243d9b7cd3f376d56a2f81c241ca2e3c9a8a2b30cddcdeddd3a5c7 SHA512 c9c748a2e0047daaaf199a1ba3198d2d1aee47f664170a9b34ccacd3deeb95f2070e4035eeb900012ef48dc62cf6fb6806f1a1dfe22de8c94892963076e593b7 diff --git a/sci-libs/pytorch/pytorch-1.12.0.ebuild b/sci-libs/pytorch/pytorch-1.12.0.ebuild new file mode 100644 index ..0a1cae78f4bb --- /dev/null +++ b/sci-libs/pytorch/pytorch-1.12.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-${PV}[${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 +}
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/
commit: 7d80a880d21a8264eb58fcc2ee4c4afee19e0d64 Author: Alfredo Tupone gentoo org> AuthorDate: Sun Jun 26 08:17:00 2022 + Commit: Alfredo Tupone gentoo org> CommitDate: Sun Jun 26 08:17:19 2022 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d80a880 sci-libs/pytorch: depends on the caffe2 exact version Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Alfredo Tupone gentoo.org> sci-libs/pytorch/pytorch-1.11.0.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sci-libs/pytorch/pytorch-1.11.0.ebuild b/sci-libs/pytorch/pytorch-1.11.0.ebuild index a57ff0163fd0..0a1cae78f4bb 100644 --- a/sci-libs/pytorch/pytorch-1.11.0.ebuild +++ b/sci-libs/pytorch/pytorch-1.11.0.ebuild @@ -20,7 +20,7 @@ RESTRICT="test" REQUIRED_USE=${PYTHON_REQUIRED_USE} RDEPEND=" ${PYTHON_DEPS} - sci-libs/caffe2[${PYTHON_USEDEP}] + ~sci-libs/caffe2-${PV}[${PYTHON_USEDEP}] dev-python/typing-extensions[${PYTHON_USEDEP}] " DEPEND="${RDEPEND}
[gentoo-commits] repo/gentoo:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
commit: 8337afbc16f16f0799c2e08094f5dc36fdbcc3ea Author: Alfredo Tupone gentoo org> AuthorDate: Sun Jun 26 07:58:44 2022 + Commit: Alfredo Tupone gentoo org> CommitDate: Sun Jun 26 07:58:44 2022 + 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 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 ..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 ..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 ..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 ..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 ..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 <4er...@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: + +