diff options
Diffstat (limited to 'sci-libs')
-rw-r--r-- | sci-libs/Manifest.gz | bin | 43624 -> 43618 bytes | |||
-rw-r--r-- | sci-libs/pytorch/Manifest | 4 | ||||
-rw-r--r-- | sci-libs/pytorch/files/pytorch-2.0.0-emptyso.patch | 15 | ||||
-rw-r--r-- | sci-libs/pytorch/files/pytorch-2.0.0-global-dlopen.patch | 20 | ||||
-rw-r--r-- | sci-libs/pytorch/pytorch-2.0.0.ebuild | 64 |
5 files changed, 103 insertions, 0 deletions
diff --git a/sci-libs/Manifest.gz b/sci-libs/Manifest.gz Binary files differindex 2986c385e2ce..bb68e04d774e 100644 --- a/sci-libs/Manifest.gz +++ b/sci-libs/Manifest.gz diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest index 66e4b986b07f..40d7c19a3858 100644 --- a/sci-libs/pytorch/Manifest +++ b/sci-libs/pytorch/Manifest @@ -4,6 +4,10 @@ AUX pytorch-1.13.1-emptyso.patch 490 BLAKE2B 97de7ab941aaf1d21714654a26ddd52247b AUX pytorch-1.13.1-global-dlopen.patch 961 BLAKE2B 215e85440efef71df0e96c1014c8922237016e433c639ae3b002266a43e01da8686bd89d1e50ed0164ac29bbde902ff3df9abdfff304cfede856ebd125bb1c58 SHA512 b924ec573f8225bd2655f7c6c5e344909754a5330ce0a78d5cf00620884e15b23698ca99125fd74bcb12f300161aa3dd881a921fd51b2caa974709a81e8a2ee9 AUX pytorch-1.7.1-torch_shm_manager.patch 441 BLAKE2B 28b87353a0afa0ef25c8ab00e204998b4fb3472fbbb5bb2b300a3fb22d864846d51ccef652ce331484c7a522f7d74e6674c1ceaf26d0a4956d1c8b57b29a7428 SHA512 08f2e5f35768e70713a1432797d9fbe0b133a80ae7dff2898e4b9b51ab398f88bce90a0698b3c9f77bf8a4c5c054911c22931d0684276a0b6d4f2afb69633088 AUX pytorch-1.9.0-Change-library-directory-according-to-CMake-build.patch 1063 BLAKE2B c93cb4c1ff40ef332cd518474a397e9b61d310f4cbdb8701c18749f103533a69e4a3e892f1e3613113cc97ae320951dacb956025ba6be694c5275448d2af3a78 SHA512 7931a220068a36b15ee0f282161f23422acdbef32990bd1eafeab55e06131748f5b4ad93e6a0dc7a4f92e7ebd0595a97835c768b46dd7139f626df666642ce18 +AUX pytorch-2.0.0-emptyso.patch 522 BLAKE2B 8c0dd836c19bf64846bc2fc401b917494f01080b1a8ab8f6c284658f35d6d647070f536e33adae8bc77de1c36ebc4d54aa90ca6b6992decd3b68dd95c273b931 SHA512 5432165bc5cd5e428a086a05581bedace5487b48b093ece843c8d4756580b0b0387f213b0ca92ceeca700fa6605b432e0442ecb4ef9f9248ee3d7ae1a576ac22 +AUX pytorch-2.0.0-global-dlopen.patch 834 BLAKE2B da3ddd29124ab345e50acd4b42cb310d75d7c9b13005ee41051a1a2b702958b81677fe4f7e76dcd678dd439c89114de2e568f4330380e6e621d2975957293921 SHA512 fa0156229d7cd20e0f3949913750ecf3d8c2f0e872c8dc272cb0144427e079938588c7d4d3fec087b6cfd7846ed6844fbaa3c5510e9be8890be926ba854f7833 DIST pytorch-1.13.1.tar.gz 108279745 BLAKE2B 75de03b74dfdaf8d8fb5ea743fcc0c1b0e408a714ad4160c487921220a7b1755e5fa6e587e6bbc8c9f34dd75e096d2e6dd69c80d24821835fff6c833314434d3 SHA512 f16f89d027efade11d057245cad5b69a390e88b458398310ae30de2dbff7c8fd7f1165be7b8da7ea989c81ac3f5a66c5cb9050610e441a97c83fb8aa28c0bd62 +DIST pytorch-2.0.0.tar.gz 111327292 BLAKE2B 6d593a975c0ade714f0b189f7e3c4ff704b9a9a2377b5e441a9cefc202fa22779966d08948e63671912c6ea5a0eee124042155f4f57a654db34e19e42f013cc9 SHA512 4dd76160711c0d87f3026c8b7fa3ed149dd86b8ac0ee9ecea0eaf80d2e6ce8c29368392e77b9466d90b60634087b462b782495997a5d33367cc8ca9fe14c8a14 EBUILD pytorch-1.13.1-r2.ebuild 1512 BLAKE2B a83a2846755b3ad3dc62329f77b04e73be1f5a79a3c3e2311a61c0965c50a17a83deac89c22ce26470be415c0c48a760f1b74c207e6864a16aead25e42896867 SHA512 55a6ed013855c4d20fad0bb213e51b2881d0b7c3e456055800b16658f92460d998294148d041dba642a11be1a60d5d830edf8613cc09cdf9ce6eef7ecc809976 +EBUILD pytorch-2.0.0.ebuild 1549 BLAKE2B f347c1bb89ff80f4cec2f6d5ca27134c3936f02d80a285d2df88c7472e62dcdb025f72d7f88820bbda2422dd0810db2b53017fc91fdedd2cbb5a1880f79d0d74 SHA512 19e390bcb88b81d5eda1f143bcadce730e2c02776dbcad4327f36b0b61beb2932973ee6352bddd27da2fd030a8626fb6687abccff0cb503d159019006264f7d3 MISC metadata.xml 328 BLAKE2B f49c6d62ac88dfffe497ed05b1f727941a94acb87a809611dda8aedbd87508fdfdf94ec0e025cac2a649b0881b600236289943b4be0f6ca44fc105b6d8fbe97c SHA512 16c29d2c1177a89026235191ea3e33870c2e6b63f029b7febd4dbd2e99f598fab4b4fd2fa7a801ffd88393663a00752300e6e2cc847a83690b715bcc481d9dc2 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 000000000000..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 000000000000..0f1b400e234d --- /dev/null +++ b/sci-libs/pytorch/files/pytorch-2.0.0-global-dlopen.patch @@ -0,0 +1,20 @@ +--- a/torch/__init__.py 2023-04-05 11:12:25.682681130 +0200 ++++ b/torch/__init__.py 2023-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 000000000000..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 \ + "${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 +} |