* [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2020-08-06 1:10 Benda XU
0 siblings, 0 replies; 10+ messages in thread
From: Benda XU @ 2020-08-06 1:10 UTC (permalink / raw
To: gentoo-commits
commit: fa9ca8f66c0bbbabb61ec8574389bab85862741a
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 6 01:07:30 2020 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu Aug 6 01:07:30 2020 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=fa9ca8f6
sci-libs/pytorch: bump to 1.6.0.
Remove virtual/python-typing dependency. It was removed from tree and only
needed by python-2.
Package-Manager: Portage-2.3.88, Repoman-2.3.18
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
sci-libs/pytorch/files/pytorch-1.6.0-setup.patch | 14 ++++
.../pytorch/files/pytorch-1.6.0-skip-tests.patch | 14 ++++
.../pytorch-1.6.0-tensorpipe-unbundle-libuv.patch | 13 ++++
sci-libs/pytorch/pytorch-1.4.0_p0.ebuild | 1 -
...ytorch-1.4.0_p0.ebuild => pytorch-1.6.0.ebuild} | 87 ++++++++++++++--------
5 files changed, 96 insertions(+), 33 deletions(-)
diff --git a/sci-libs/pytorch/files/pytorch-1.6.0-setup.patch b/sci-libs/pytorch/files/pytorch-1.6.0-setup.patch
new file mode 100644
index 000000000..6a197a907
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.6.0-setup.patch
@@ -0,0 +1,14 @@
+Index: pytorch-1.4.0_p0/setup.py
+===================================================================
+--- pytorch-1.4.0_p0.orig/setup.py
++++ pytorch-1.4.0_p0/setup.py
+@@ -288,9 +288,7 @@ def build_deps():
+ sys.exit(1)
+
+ check_file(os.path.join(third_party_path, "gloo", "CMakeLists.txt"))
+- check_file(os.path.join(third_party_path, "pybind11", "CMakeLists.txt"))
+ check_file(os.path.join(third_party_path, 'cpuinfo', 'CMakeLists.txt'))
+- check_file(os.path.join(third_party_path, 'tbb', 'Makefile'))
+ check_file(os.path.join(third_party_path, 'onnx', 'CMakeLists.txt'))
+ check_file(os.path.join(third_party_path, 'foxi', 'CMakeLists.txt'))
+ check_file(os.path.join(third_party_path, 'QNNPACK', 'CMakeLists.txt'))
diff --git a/sci-libs/pytorch/files/pytorch-1.6.0-skip-tests.patch b/sci-libs/pytorch/files/pytorch-1.6.0-skip-tests.patch
new file mode 100644
index 000000000..3ef2c533f
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.6.0-skip-tests.patch
@@ -0,0 +1,14 @@
+Disable expected test failures.
+
+Reference: https://github.com/pytorch/pytorch/issues/13746
+Reference: https://github.com/pytorch/pytorch/issues/21873
+
+Index: pytorch-1.4.0_p0/caffe2/share/contrib/depthwise/CMakeLists.txt
+===================================================================
+--- pytorch-1.4.0_p0.orig/caffe2/share/contrib/depthwise/CMakeLists.txt
++++ pytorch-1.4.0_p0/caffe2/share/contrib/depthwise/CMakeLists.txt
+@@ -6,4 +6,3 @@ set(Caffe2_CONTRIB_DEPTHWISE3x3_TEST_CPU
+ )
+
+ set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS} ${Caffe2_CONTRIB_DEPTHWISE3x3_CPU_SRC} PARENT_SCOPE)
+-set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${Caffe2_CONTRIB_DEPTHWISE3x3_TEST_CPU_SRC} PARENT_SCOPE)
diff --git a/sci-libs/pytorch/files/pytorch-1.6.0-tensorpipe-unbundle-libuv.patch b/sci-libs/pytorch/files/pytorch-1.6.0-tensorpipe-unbundle-libuv.patch
new file mode 100644
index 000000000..a4ba38322
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.6.0-tensorpipe-unbundle-libuv.patch
@@ -0,0 +1,13 @@
+Index: tensorpipe/cmake/pytorch.cmake
+===================================================================
+--- tensorpipe.orig/cmake/pytorch.cmake
++++ tensorpipe/cmake/pytorch.cmake
+@@ -138,7 +138,7 @@ endif()
+
+ add_library(tensorpipe ${TENSORPIPE_SRC})
+
+-set(TP_BUILD_LIBUV ON)
++set(TP_BUILD_LIBUV OFF)
+ find_package(uv REQUIRED)
+ target_link_libraries(tensorpipe PRIVATE uv::uv)
+
diff --git a/sci-libs/pytorch/pytorch-1.4.0_p0.ebuild b/sci-libs/pytorch/pytorch-1.4.0_p0.ebuild
index e77582078..762608507 100644
--- a/sci-libs/pytorch/pytorch-1.4.0_p0.ebuild
+++ b/sci-libs/pytorch/pytorch-1.4.0_p0.ebuild
@@ -50,7 +50,6 @@ REQUIRED_USE="
DEPEND="
dev-libs/protobuf
dev-python/pyyaml[${PYTHON_USEDEP}]
- virtual/python-typing[${PYTHON_USEDEP}]
atlas? ( sci-libs/atlas )
cuda? ( dev-libs/cudnn
dev-cpp/eigen[cuda] )
diff --git a/sci-libs/pytorch/pytorch-1.4.0_p0.ebuild b/sci-libs/pytorch/pytorch-1.6.0.ebuild
similarity index 63%
copy from sci-libs/pytorch/pytorch-1.4.0_p0.ebuild
copy to sci-libs/pytorch/pytorch-1.6.0.ebuild
index e77582078..c59b248e2 100644
--- a/sci-libs/pytorch/pytorch-1.4.0_p0.ebuild
+++ b/sci-libs/pytorch/pytorch-1.6.0.ebuild
@@ -12,34 +12,56 @@ MPV=${PV/_p/a}
DESCRIPTION="Tensors and Dynamic neural networks in Python with strong GPU acceleration"
HOMEPAGE="https://pytorch.org/"
SRC_URI="https://github.com/pytorch/${PN}/archive/v${MPV}.tar.gz -> ${P}.tar.gz
-https://github.com/facebookincubator/gloo/archive/ca528e32.tar.gz -> gloo-ca528e32.tar.gz
-https://github.com/google/benchmark/archive/505be96a.tar.gz -> benchmark-505be96a.tar.gz
-https://github.com/google/gemmlowp/archive/3fb5c176.tar.gz -> gemmlowp-3fb5c176.tar.gz
-https://github.com/google/googletest/archive/2fe3bd99.tar.gz -> googletest-2fe3bd99.tar.gz
-https://github.com/houseroad/foxi/archive/8f74bc4d.tar.gz -> foxi-8f74bc4d.tar.gz
-https://github.com/intel/ideep/archive/78eafa5d.tar.gz -> ideep-78eafa5d.tar.gz
-https://github.com/Maratyszcza/FP16/archive/febbb1c1.tar.gz -> FP16-febbb1c1.tar.gz
-https://github.com/Maratyszcza/FXdiv/archive/b742d114.tar.gz -> FXdiv-b742d114.tar.gz
-https://github.com/Maratyszcza/NNPACK/archive/c039579a.tar.gz -> NNPACK-c039579a.tar.gz
-https://github.com/Maratyszcza/PeachPy/archive/07d8fde8.tar.gz -> PeachPy-07d8fde8.tar.gz
-https://github.com/Maratyszcza/psimd/archive/90a938f3.tar.gz -> psimd-90a938f3.tar.gz
-https://github.com/Maratyszcza/pthreadpool/archive/13da0b4c.tar.gz -> pthreadpool-13da0b4c.tar.gz
-cuda? ( https://github.com/NVIDIA/nccl/archive/7c72dee6.tar.gz -> nccl-7c72dee6.tar.gz )
-https://github.com/NVlabs/cub/archive/285aeeba.tar.gz -> cub-285aeeba.tar.gz
-https://github.com/onnx/onnx/archive/2891e145.tar.gz -> onnx-2891e145.tar.gz
-https://github.com/onnx/onnx-tensorrt/archive/cb3d8066.tar.gz -> onnx-tensorrt-cb3d8066.tar.gz
-https://github.com/pytorch/cpuinfo/archive/89fe1695.tar.gz -> cpuinfo-89fe1695.tar.gz
-https://github.com/pytorch/fbgemm/archive/82d259da.tar.gz -> fbgemm-82d259da.tar.gz
-https://github.com/pytorch/QNNPACK/archive/7d2a4e99.tar.gz -> QNNPACK-7d2a4e99.tar.gz
-https://github.com/shibatch/sleef/archive/7f523de6.tar.gz -> sleef-7f523de6.tar.gz
-https://github.com/asmjit/asmjit/archive/17556b2d.tar.gz -> asmjit-17556b2d.tar.gz
+https://github.com/google/benchmark/archive/505be96ab.tar.gz -> benchmark-505be96ab.tar.gz
+https://github.com/pytorch/cpuinfo/archive/63b254577.tar.gz -> cpuinfo-63b254577.tar.gz
+https://github.com/NVlabs/cub/archive/d106ddb99.tar.gz -> cub-d106ddb99.tar.gz
+https://github.com/pytorch/fbgemm/archive/87c378172.tar.gz -> fbgemm-87c378172.tar.gz
+https://github.com/fmtlib/fmt/archive/9bdd1596c.tar.gz -> fmt-9bdd1596c.tar.gz
+https://github.com/houseroad/foxi/archive/8015abb72.tar.gz -> foxi-8015abb72.tar.gz
+https://github.com/Maratyszcza/FP16/archive/4dfe081cf.tar.gz -> FP16-4dfe081cf.tar.gz
+https://github.com/Maratyszcza/FXdiv/archive/b408327ac.tar.gz -> FXdiv-b408327ac.tar.gz
+https://github.com/google/gemmlowp/archive/3fb5c176c.tar.gz -> gemmlowp-3fb5c176c.tar.gz
+https://github.com/facebookincubator/gloo/archive/3d08580f9.tar.gz -> gloo-3d08580f9.tar.gz
+https://github.com/google/googletest/archive/2fe3bd994.tar.gz -> googletest-2fe3bd994.tar.gz
+https://github.com/intel/ideep/archive/938cc6889.tar.gz -> ideep-938cc6889.tar.gz
+cuda? ( https://github.com/NVIDIA/nccl/archive/5949d96f3.tar.gz -> nccl-5949d96f3.tar.gz )
+https://github.com/Maratyszcza/NNPACK/archive/24b55303f.tar.gz -> NNPACK-24b55303f.tar.gz
+https://github.com/onnx/onnx/archive/a82c6a701.tar.gz -> onnx-a82c6a701.tar.gz
+https://github.com/onnx/onnx-tensorrt/archive/c15321141.tar.gz -> onnx-tensorrt-c15321141.tar.gz
+https://github.com/Maratyszcza/psimd/archive/072586a71.tar.gz -> psimd-072586a71.tar.gz
+https://github.com/Maratyszcza/pthreadpool/archive/029c88620.tar.gz -> pthreadpool-029c88620.tar.gz
+https://github.com/Maratyszcza/PeachPy/archive/07d8fde8a.tar.gz -> PeachPy-07d8fde8a.tar.gz
+https://github.com/pytorch/QNNPACK/archive/7d2a4e993.tar.gz -> QNNPACK-7d2a4e993.tar.gz
+https://github.com/shibatch/sleef/archive/7f523de65.tar.gz -> sleef-7f523de65.tar.gz
+https://github.com/pytorch/tensorpipe/archive/3b8089c9c.tar.gz -> tensorpipe-3b8089c9c.tar.gz
+https://github.com/google/XNNPACK/archive/1b354636b.tar.gz -> XNNPACK-1b354636b.tar.gz
+https://github.com/asmjit/asmjit/archive/9057aa30.tar.gz -> asmjit-9057aa30.tar.gz
"
+# git clone git@github.com:pytorch/pytorch.git && cd pytorch
+# src_uri() {
+# join \
+# <(git config --file .gitmodules --get-regexp url | sed -r -e 's/^submodule.(.*).url (.*)/\1 \2/' -e 's,NNPACK_deps/,,' -e 's/third-party/third_party/' | sort) \
+# <(git submodule status | awk '{print $2 " " $1}' | sort) | \
+# while read path url hash; do
+# [[ ${path} =~ (eigen|six|ios|neon2sse|protobuf|pybind11|enum34|tbb|zstd|fbjni) ]] && continue
+# u=${url%.git}
+# h=${hash#-}
+# h=${h:0:8}
+# echo "${u}/archive/${h}.tar.gz -> $(basename ${u})-${h}.tar.gz"
+# done
+# }
+# src_uri
+
+# git submodule update --init third_party/fbgemm && cd third_party/fbgemm
+# src_uri | grep asmjit
+# cd ../..
+
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
-IUSE="asan atlas cuda eigen +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkl mkldnn mpi namedtensor +nnpack numa +numpy +observers +openblas opencl opencv +openmp +python +qnnpack redis static tbb test tools zeromq"
+IUSE="asan atlas cuda eigen +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkl mkldnn mpi namedtensor +nnpack numa +numpy +observers +openblas opencl opencv +openmp +python +qnnpack redis static test tools zeromq"
REQUIRED_USE="
python? ( ${PYTHON_REQUIRED_USE} )
@@ -47,10 +69,9 @@ REQUIRED_USE="
^^ ( atlas eigen mkl openblas )
"
-DEPEND="
+RDEPEND="
dev-libs/protobuf
dev-python/pyyaml[${PYTHON_USEDEP}]
- virtual/python-typing[${PYTHON_USEDEP}]
atlas? ( sci-libs/atlas )
cuda? ( dev-libs/cudnn
dev-cpp/eigen[cuda] )
@@ -71,11 +92,11 @@ DEPEND="
redis? ( dev-db/redis )
zeromq? ( net-libs/zeromq )
eigen? ( dev-cpp/eigen )
+ dev-libs/libuv
"
-RDEPEND="${DEPEND}"
BDEPEND=""
-DEPEND="
+DEPEND="${RDEPEND}
test? ( dev-python/pytest[${PYTHON_USEDEP}] )
dev-python/setuptools[${PYTHON_USEDEP}]
dev-cpp/tbb
@@ -87,9 +108,8 @@ DEPEND="
"
PATCHES=(
- "${FILESDIR}"/${PN}-1.2.0-setup.patch
- "${FILESDIR}"/${PN}-1.4.0-sleef.patch
- "${FILESDIR}"/${PN}-1.4.0-skip-tests.patch
+ "${FILESDIR}"/${PN}-1.6.0-setup.patch
+ "${FILESDIR}"/${PN}-1.6.0-skip-tests.patch
"${FILESDIR}"/0002-Don-t-build-libtorch-again-for-PyTorch-1.4.0.patch
"${FILESDIR}"/0003-Change-path-to-caffe2-build-dir-made-by-libtorch.patch
"${FILESDIR}"/0005-Change-library-directory-according-to-CMake-build.patch
@@ -98,7 +118,7 @@ PATCHES=(
src_unpack() {
default
- mv -v ${PN}-${MPV} ${P} || die
+ [[ -d ${P} ]] || mv -v ${PN}-${MPV} ${P} || die
}
src_prepare() {
@@ -133,6 +153,9 @@ src_prepare() {
cuda_src_prepare
export CUDAHOSTCXX=$(cuda_gccdir)/g++
fi
+
+ cd ../tensorpipe || die
+ eapply "${FILESDIR}"/${PN}-1.6.0-tensorpipe-unbundle-libuv.patch
}
src_configure() {
@@ -192,11 +215,11 @@ src_configure() {
cmake-utils_src_configure
if use python; then
- CMAKE_BUILD_DIR=${BUILD_DIR} distutils-r1_src_configure
+ CMAKE_BUILD_DIR="${BUILD_DIR}" distutils-r1_src_configure
fi
# do not rerun cmake and the build process in src_install
- sed '/RERUN/,+1d' -i ${BUILD_DIR}/build.ninja || die
+ sed '/RERUN/,+1d' -i "${BUILD_DIR}"/build.ninja || die
}
src_compile() {
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2020-08-07 12:56 Benda XU
0 siblings, 0 replies; 10+ messages in thread
From: Benda XU @ 2020-08-07 12:56 UTC (permalink / raw
To: gentoo-commits
commit: a788dbf0de374240b116598b7a93881509258e24
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 7 12:55:50 2020 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Fri Aug 7 12:55:58 2020 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=a788dbf0
sci-libs/pytorch: refresh cuda nccl patch for 1.6.0.
Package-Manager: Portage-2.3.88, Repoman-2.3.18
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
.../files/pytorch-1.6.0-nccl-nvccflags.patch | 27 ++++++++++++++++++++++
sci-libs/pytorch/pytorch-1.6.0.ebuild | 2 +-
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/sci-libs/pytorch/files/pytorch-1.6.0-nccl-nvccflags.patch b/sci-libs/pytorch/files/pytorch-1.6.0-nccl-nvccflags.patch
new file mode 100644
index 000000000..052474ee4
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.6.0-nccl-nvccflags.patch
@@ -0,0 +1,27 @@
+diff -uprN nccl-5949d96f36d050e59d05872f8bbffd2549318e95/makefiles/common.mk nccl-patched/makefiles/common.mk
+--- nccl-5949d96f36d050e59d05872f8bbffd2549318e95/makefiles/common.mk 2020-06-09 00:31:44.000000000 +0800
++++ nccl-patched/makefiles/common.mk 2020-08-06 21:25:57.784279738 +0800
+@@ -54,7 +54,7 @@ CXXFLAGS := -DCUDA_MAJOR=$(CUDA_MAJOR)
+ # Maxrregcount needs to be set accordingly to NCCL_MAX_NTHREADS (otherwise it will cause kernel launch errors)
+ # 512 : 120, 640 : 96, 768 : 80, 1024 : 60
+ # We would not have to set this if we used __launch_bounds__, but this only works on kernels, not on functions.
+-NVCUFLAGS := -ccbin $(CXX) $(NVCC_GENCODE) -std=c++11 -Xptxas -maxrregcount=96 -Xfatbin -compress-all
++NVCUFLAGS := $(NVCCFLAGS) $(NVCC_GENCODE) -std=c++11 -Xptxas -maxrregcount=96 -Xfatbin -compress-all
+ # Use addprefix so that we can specify more than one path
+ NVLDFLAGS := -L${CUDA_LIB} -lcudart -lrt
+
+@@ -68,14 +68,6 @@ NVLDFLAGS += ${GCOV_FLAGS:%=-Xcompiler
+ # $(warning GCOV_FLAGS=${GCOV_FLAGS})
+ ########## GCOV ##########
+
+-ifeq ($(DEBUG), 0)
+-NVCUFLAGS += -O3
+-CXXFLAGS += -O3 -g
+-else
+-NVCUFLAGS += -O0 -G -g
+-CXXFLAGS += -O0 -g -ggdb3
+-endif
+-
+ ifneq ($(VERBOSE), 0)
+ NVCUFLAGS += -Xptxas -v -Xcompiler -Wall,-Wextra,-Wno-unused-parameter
+ CXXFLAGS += -Wall -Wextra
diff --git a/sci-libs/pytorch/pytorch-1.6.0.ebuild b/sci-libs/pytorch/pytorch-1.6.0.ebuild
index c59b248e2..1394bdbe3 100644
--- a/sci-libs/pytorch/pytorch-1.6.0.ebuild
+++ b/sci-libs/pytorch/pytorch-1.6.0.ebuild
@@ -147,7 +147,7 @@ src_prepare() {
if use cuda; then
cd ../nccl || die
- eapply "${FILESDIR}"/${PN}-1.4.0-nccl-nvccflags.patch
+ eapply "${FILESDIR}"/${PN}-1.6.0-nccl-nvccflags.patch
ln -s . nccl || die
cuda_src_prepare
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2020-08-11 13:44 Benda XU
0 siblings, 0 replies; 10+ messages in thread
From: Benda XU @ 2020-08-11 13:44 UTC (permalink / raw
To: gentoo-commits
commit: 72df8ef8dc56f868d4feaf7b558e93562b7627f3
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 11 13:41:24 2020 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Tue Aug 11 13:44:16 2020 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=72df8ef8
sci-libs/pytorch: donot hardcode the library path.
Closes: https://bugs.gentoo.org/736643
Package-Manager: Portage-2.3.88, Repoman-2.3.18
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
sci-libs/pytorch/files/pytorch-1.6.0-global-dlopen.patch | 15 +++++++++++++++
sci-libs/pytorch/pytorch-1.6.0.ebuild | 3 ++-
2 files changed, 17 insertions(+), 1 deletion(-)
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 000000000..1e9388ff1
--- /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/pytorch-1.6.0.ebuild b/sci-libs/pytorch/pytorch-1.6.0.ebuild
index 1394bdbe3..8c3236244 100644
--- a/sci-libs/pytorch/pytorch-1.6.0.ebuild
+++ b/sci-libs/pytorch/pytorch-1.6.0.ebuild
@@ -110,6 +110,7 @@ DEPEND="${RDEPEND}
PATCHES=(
"${FILESDIR}"/${PN}-1.6.0-setup.patch
"${FILESDIR}"/${PN}-1.6.0-skip-tests.patch
+ "${FILESDIR}"/${PN}-pytorch-1.6.0-global-dlopen.patch
"${FILESDIR}"/0002-Don-t-build-libtorch-again-for-PyTorch-1.4.0.patch
"${FILESDIR}"/0003-Change-path-to-caffe2-build-dir-made-by-libtorch.patch
"${FILESDIR}"/0005-Change-library-directory-according-to-CMake-build.patch
@@ -272,7 +273,7 @@ src_install() {
python_foreach_impl python_optimize
fi
- find "${ED}/usr/lib64" -name "*.a" -exec rm -fv {} \;
+ find "${ED}/usr/${LIB}" -name "*.a" -exec rm -fv {} \;
use test && rm -rfv "${ED}/usr/test" "${ED}"/usr/bin/test_{api,jit}
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2021-01-24 13:38 Benda XU
0 siblings, 0 replies; 10+ messages in thread
From: Benda XU @ 2021-01-24 13:38 UTC (permalink / raw
To: gentoo-commits
commit: f4f6740dd370885258be7c6f97f08e37143489dd
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 24 13:27:51 2021 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sun Jan 24 13:38:00 2021 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=f4f6740d
sci-libs/pytorch: bump to 1.7.1.
Add ROCm support for AMD GPUs.
Remove fine-grained BLAS flags, use a general USE=blas and rely on
eselect-ldso for runtime switch of blas libraries.
merge USE=numpy into USE=python.
Suggested-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Bug: https://bugs.gentoo.org/650804
Bug: https://github.com/gentoo/gentoo/pull/10724
Closes: https://github.com/justxi/rocm/issues/133
Closes: https://github.com/gentoo/sci/issues/1039
Closes: https://github.com/gentoo/sci/issues/1011
Package-Manager: Portage-3.0.12, Repoman-3.0.1
RepoMan-Options: --force
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
...-t-build-libtorch-again-for-PyTorch-1.7.1.patch | 18 ++
sci-libs/pytorch/files/get_third_parties | 20 ++
.../pytorch/files/pytorch-1.7.1-no-rpath.patch | 12 +
sci-libs/pytorch/files/pytorch-1.7.1-setup.patch | 12 +
.../pytorch-1.7.1-tensorpipe-unbundle-libuv.patch | 12 +
.../files/pytorch-1.7.1-torch_shm_manager.patch | 13 +
sci-libs/pytorch/metadata.xml | 1 +
sci-libs/pytorch/pytorch-1.7.1-r2.ebuild | 292 +++++++++++++++++++++
8 files changed, 380 insertions(+)
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 000000000..16d2c1f2e
--- /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
+@@ -307,13 +307,6 @@ def build_deps():
+ check_pydep('yaml', 'pyyaml')
+ check_pydep('typing', 'typing')
+
+- 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/get_third_parties b/sci-libs/pytorch/files/get_third_parties
new file mode 100755
index 000000000..8c38a9b73
--- /dev/null
+++ b/sci-libs/pytorch/files/get_third_parties
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+path_url() {
+ local dir=$(dirname $1)/
+ git config --file $1 --get-regexp '(path|url)' | sed -r -e "N;s,[^ ]* ([^ ]*)\n[^ ]* ([^ ]*),${dir#./}\1 \2,"
+}
+
+join \
+ <(for gm in $(find . -name '.gitmodules' | sort -r); do path_url $gm; done | sort -u) \
+ <(git submodule status --recursive | awk '{print $2 " " $1}' | sort -u) | \
+while read path url hash; do
+ [[ ${path} =~ (eigen|six|ios|neon2sse|protobuf|pybind11|python-enum|tbb|zstd|fbjni) ]] && continue
+ u=${url%.git}
+ hfull=${hash#-}
+ h=${hfull:0:8}
+ p=$(basename $u)
+ echo "${u}/archive/${h}.tar.gz -> ${p}-${h}.tar.gz" >> SRC_URI
+ [[ $p = fbgemm ]] && p=${p^^}
+ echo "rmdir ${path} && ln -sv \"\${WORKDIR}\"/${p}-${hfull} ${path}" >> src_prepare
+done
diff --git a/sci-libs/pytorch/files/pytorch-1.7.1-no-rpath.patch b/sci-libs/pytorch/files/pytorch-1.7.1-no-rpath.patch
new file mode 100644
index 000000000..eabda092e
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.7.1-no-rpath.patch
@@ -0,0 +1,12 @@
+diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
+index b3a892cf88..2c8622870c 100644
+--- a/cmake/Dependencies.cmake
++++ b/cmake/Dependencies.cmake
+@@ -4,7 +4,6 @@ if(APPLE)
+ set(CMAKE_MACOSX_RPATH ON)
+ set(_rpath_portable_origin "@loader_path")
+ else()
+- set(_rpath_portable_origin $ORIGIN)
+ endif(APPLE)
+ # Use separate rpaths during build and install phases
+ set(CMAKE_SKIP_BUILD_RPATH FALSE)
diff --git a/sci-libs/pytorch/files/pytorch-1.7.1-setup.patch b/sci-libs/pytorch/files/pytorch-1.7.1-setup.patch
new file mode 100644
index 000000000..28db5692c
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.7.1-setup.patch
@@ -0,0 +1,12 @@
+diff --git a/setup.py b/setup.py
+index 2db381644c..01a2e57aea 100644
+--- a/setup.py
++++ b/setup.py
+@@ -294,7 +294,6 @@ def build_deps():
+
+ check_file(os.path.join(third_party_path, "gloo", "CMakeLists.txt"))
+ check_file(os.path.join(third_party_path, 'cpuinfo', 'CMakeLists.txt'))
+- check_file(os.path.join(third_party_path, 'tbb', 'Makefile'))
+ check_file(os.path.join(third_party_path, 'onnx', 'CMakeLists.txt'))
+ check_file(os.path.join(third_party_path, 'foxi', 'CMakeLists.txt'))
+ check_file(os.path.join(third_party_path, 'QNNPACK', 'CMakeLists.txt'))
diff --git a/sci-libs/pytorch/files/pytorch-1.7.1-tensorpipe-unbundle-libuv.patch b/sci-libs/pytorch/files/pytorch-1.7.1-tensorpipe-unbundle-libuv.patch
new file mode 100644
index 000000000..960ae3618
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.7.1-tensorpipe-unbundle-libuv.patch
@@ -0,0 +1,12 @@
+diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
+index d1e4bdaed6..85821a78df 100644
+--- a/cmake/Dependencies.cmake
++++ b/cmake/Dependencies.cmake
+@@ -1308,7 +1308,6 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
+ if(MSVC)
+ message(WARNING "Tensorpipe cannot be used on Windows.")
+ else()
+- set(TP_BUILD_LIBUV ON CACHE BOOL "" FORCE)
+ set(TP_ENABLE_SHM OFF CACHE BOOL "" FORCE)
+ set(TP_ENABLE_CMA OFF CACHE BOOL "" FORCE)
+ set(TP_STATIC_OR_SHARED STATIC CACHE STRING "" FORCE)
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 000000000..44b27cac3
--- /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"@GENTOO_PORTAGE_EPREFIX@/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/metadata.xml b/sci-libs/pytorch/metadata.xml
index 423c3c434..01e2b2703 100644
--- a/sci-libs/pytorch/metadata.xml
+++ b/sci-libs/pytorch/metadata.xml
@@ -32,6 +32,7 @@
<flag name="opencl">Enable support for OpenCL</flag>
<flag name="qnnpack">Enable QNNPACK support</flag>
<flag name="redis">Enable support for Redis</flag>
+ <flag name="rocm">Enable AMD ROCm</flag>
<flag name="tools">Build binary tools</flag>
<flag name="zeromq">Enable support for ZeroMQ</flag>
</use>
diff --git a/sci-libs/pytorch/pytorch-1.7.1-r2.ebuild b/sci-libs/pytorch/pytorch-1.7.1-r2.ebuild
new file mode 100644
index 000000000..e116b7ef7
--- /dev/null
+++ b/sci-libs/pytorch/pytorch-1.7.1-r2.ebuild
@@ -0,0 +1,292 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7,8,9} )
+
+inherit cmake cuda distutils-r1 prefix
+
+DESCRIPTION="Tensors and Dynamic neural networks in Python with strong GPU acceleration"
+HOMEPAGE="https://pytorch.org/"
+SRC_URI="https://github.com/pytorch/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
+https://github.com/google/benchmark/archive/505be96a.tar.gz -> benchmark-505be96a.tar.gz
+https://github.com/pytorch/cpuinfo/archive/63b25457.tar.gz -> cpuinfo-63b25457.tar.gz
+https://github.com/NVlabs/cub/archive/d106ddb9.tar.gz -> cub-d106ddb9.tar.gz
+https://github.com/pytorch/fbgemm/archive/1d710393.tar.gz -> fbgemm-1d710393.tar.gz
+https://github.com/asmjit/asmjit/archive/9057aa30.tar.gz -> asmjit-9057aa30.tar.gz
+https://github.com/pytorch/cpuinfo/archive/d5e37adf.tar.gz -> cpuinfo-d5e37adf.tar.gz
+https://github.com/google/googletest/archive/0fc5466d.tar.gz -> googletest-0fc5466d.tar.gz
+https://github.com/fmtlib/fmt/archive/cd4af11e.tar.gz -> fmt-cd4af11e.tar.gz
+https://github.com/houseroad/foxi/archive/4aba696e.tar.gz -> foxi-4aba696e.tar.gz
+https://github.com/Maratyszcza/FP16/archive/4dfe081c.tar.gz -> FP16-4dfe081c.tar.gz
+https://github.com/Maratyszcza/FXdiv/archive/b408327a.tar.gz -> FXdiv-b408327a.tar.gz
+https://github.com/google/gemmlowp/archive/3fb5c176.tar.gz -> gemmlowp-3fb5c176.tar.gz
+https://github.com/facebookincubator/gloo/archive/3dc0328f.tar.gz -> gloo-3dc0328f.tar.gz
+https://github.com/google/googletest/archive/2fe3bd99.tar.gz -> googletest-2fe3bd99.tar.gz
+https://github.com/intel/ideep/archive/ba885200.tar.gz -> ideep-ba885200.tar.gz
+https://github.com/intel/mkl-dnn/archive/5ef631a0.tar.gz -> mkl-dnn-5ef631a0.tar.gz
+cuda? ( https://github.com/NVIDIA/nccl/archive/033d7995.tar.gz -> nccl-033d7995.tar.gz )
+https://github.com/Maratyszcza/NNPACK/archive/24b55303.tar.gz -> NNPACK-24b55303.tar.gz
+https://github.com/onnx/onnx/archive/a82c6a70.tar.gz -> onnx-a82c6a70.tar.gz
+https://github.com/onnx/onnx-tensorrt/archive/c1532114.tar.gz -> onnx-tensorrt-c1532114.tar.gz
+https://github.com/onnx/onnx/archive/765f5ee8.tar.gz -> onnx-765f5ee8.tar.gz
+https://github.com/google/benchmark/archive/e776aa02.tar.gz -> benchmark-e776aa02.tar.gz
+https://github.com/google/benchmark/archive/5b7683f4.tar.gz -> benchmark-5b7683f4.tar.gz
+https://github.com/google/googletest/archive/5ec7f0c4.tar.gz -> googletest-5ec7f0c4.tar.gz
+https://github.com/Maratyszcza/psimd/archive/072586a7.tar.gz -> psimd-072586a7.tar.gz
+https://github.com/Maratyszcza/pthreadpool/archive/029c8862.tar.gz -> pthreadpool-029c8862.tar.gz
+https://github.com/Maratyszcza/PeachPy/archive/07d8fde8.tar.gz -> PeachPy-07d8fde8.tar.gz
+https://github.com/pytorch/QNNPACK/archive/7d2a4e99.tar.gz -> QNNPACK-7d2a4e99.tar.gz
+https://github.com/shibatch/sleef/archive/7f523de6.tar.gz -> sleef-7f523de6.tar.gz
+https://github.com/pytorch/tensorpipe/archive/95ff9319.tar.gz -> tensorpipe-95ff9319.tar.gz
+https://github.com/google/googletest/archive/2fe3bd99.tar.gz -> googletest-2fe3bd99.tar.gz
+https://github.com/google/libnop/archive/aa95422e.tar.gz -> libnop-aa95422e.tar.gz
+https://github.com/libuv/libuv/archive/02a9e1be.tar.gz -> libuv-02a9e1be.tar.gz
+https://github.com/google/XNNPACK/archive/1b354636.tar.gz -> XNNPACK-1b354636.tar.gz
+ "
+
+# git clone git@github.com:pytorch/pytorch.git && cd pytorch
+# git submodules update --init --recursive
+# ${FILESDIR}/get_third_paries
+# cat SRC_URI src_prepare
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="asan blas cuda +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkldnn mpi namedtensor +nnpack numa +observers opencl opencv +openmp +python +qnnpack redis rocm static test tools zeromq"
+
+REQUIRED_USE="
+ ^^ ( cuda rocm )
+"
+
+RDEPEND="
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ blas? ( virtual/blas )
+ cuda? ( dev-libs/cudnn
+ dev-cpp/eigen[cuda] )
+ rocm? ( >=dev-util/hip-4.0.0-r1
+ >=dev-libs/rccl-4
+ >=sci-libs/rocThrust-4
+ >=sci-libs/hipCUB-4
+ >=sci-libs/rocPRIM-4
+ >=sci-libs/miopen-4
+ >=sci-libs/rocBLAS-4
+ >=sci-libs/rocRAND-4
+ >=sci-libs/hipSPARSE-4
+ >=sci-libs/rocFFT-4
+ >=dev-util/roctracer-4 )
+ ffmpeg? ( media-video/ffmpeg )
+ gflags? ( dev-cpp/gflags )
+ glog? ( dev-cpp/glog )
+ leveldb? ( dev-libs/leveldb )
+ lmdb? ( dev-db/lmdb )
+ mpi? ( virtual/mpi )
+ opencl? ( dev-libs/clhpp virtual/opencl )
+ opencv? ( media-libs/opencv )
+ python? ( ${PYTHON_DEPS}
+ dev-python/pybind11[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-libs/protobuf-python:0/22
+ )
+ redis? ( dev-db/redis )
+ zeromq? ( net-libs/zeromq )
+ dev-cpp/eigen
+ dev-libs/protobuf:0/22
+ dev-libs/libuv
+"
+
+#ATen code generation
+BDEPEND="dev-python/pyyaml"
+
+DEPEND="${RDEPEND}
+ test? ( dev-python/pytest[${PYTHON_USEDEP}] )
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ dev-cpp/tbb
+ app-arch/zstd
+ dev-python/pybind11[${PYTHON_USEDEP}]
+ sys-fabric/libibverbs
+ sys-process/numactl
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.7.1-setup.patch
+ "${FILESDIR}"/${PN}-1.6.0-skip-tests.patch
+ "${FILESDIR}"/${PN}-1.6.0-global-dlopen.patch
+ "${FILESDIR}"/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch
+ "${FILESDIR}"/0003-Change-path-to-caffe2-build-dir-made-by-libtorch.patch
+ "${FILESDIR}"/0005-Change-library-directory-according-to-CMake-build.patch
+ "${FILESDIR}"/${PN}-1.7.1-no-rpath.patch
+ "${FILESDIR}"/${PN}-1.7.1-tensorpipe-unbundle-libuv.patch
+ "${FILESDIR}"/${PN}-1.7.1-torch_shm_manager.patch
+)
+
+src_prepare() {
+ cmake_src_prepare
+ eprefixify torch/__init__.py
+ eapply_user
+
+ rmdir third_party/benchmark && ln -sv "${WORKDIR}"/benchmark-505be96ab23056580a3a2315abba048f4428b04e third_party/benchmark
+ rmdir third_party/cpuinfo && ln -sv "${WORKDIR}"/cpuinfo-63b254577ed77a8004a9be6ac707f3dccc4e1fd9 third_party/cpuinfo
+ rmdir third_party/cub && ln -sv "${WORKDIR}"/cub-d106ddb991a56c3df1b6d51b2409e36ba8181ce4 third_party/cub
+ rmdir third_party/fbgemm && ln -sv "${WORKDIR}"/FBGEMM-1d710393d5b7588f5de3b83f51c22bbddf095229 third_party/fbgemm
+ rmdir third_party/fbgemm/third_party/asmjit && ln -sv "${WORKDIR}"/asmjit-9057aa30b620f0662ff51e2230c126a345063064 third_party/fbgemm/third_party/asmjit
+ rmdir third_party/fbgemm/third_party/cpuinfo && ln -sv "${WORKDIR}"/cpuinfo-d5e37adf1406cf899d7d9ec1d317c47506ccb970 third_party/fbgemm/third_party/cpuinfo
+ rmdir third_party/fbgemm/third_party/googletest && ln -sv "${WORKDIR}"/googletest-0fc5466dbb9e623029b1ada539717d10bd45e99e third_party/fbgemm/third_party/googletest
+ rmdir third_party/fmt && ln -sv "${WORKDIR}"/fmt-cd4af11efc9c622896a3e4cb599fa28668ca3d05 third_party/fmt
+ rmdir third_party/foxi && ln -sv "${WORKDIR}"/foxi-4aba696ec8f31794fd42880346dc586486205e0a third_party/foxi
+ rmdir third_party/FP16 && ln -sv "${WORKDIR}"/FP16-4dfe081cf6bcd15db339cf2680b9281b8451eeb3 third_party/FP16
+ rmdir third_party/FXdiv && ln -sv "${WORKDIR}"/FXdiv-b408327ac2a15ec3e43352421954f5b1967701d1 third_party/FXdiv
+ rmdir third_party/gemmlowp/gemmlowp && ln -sv "${WORKDIR}"/gemmlowp-3fb5c176c17c765a3492cd2f0321b0dab712f350 third_party/gemmlowp/gemmlowp
+ rmdir third_party/gloo && ln -sv "${WORKDIR}"/gloo-3dc0328fe6a9d47bd47c0c6ca145a0d8a21845c6 third_party/gloo
+ rmdir third_party/googletest && ln -sv "${WORKDIR}"/googletest-2fe3bd994b3189899d93f1d5a881e725e046fdc2 third_party/googletest
+ rmdir third_party/ideep && ln -sv "${WORKDIR}"/ideep-ba885200dbbc1f144c7b58eba487378eb324f281 third_party/ideep
+ rmdir third_party/ideep/mkl-dnn && ln -sv "${WORKDIR}"/mkl-dnn-5ef631a030a6f73131c77892041042805a06064f third_party/ideep/mkl-dnn
+ rmdir third_party/nccl/nccl && ln -sv "${WORKDIR}"/nccl-033d799524fb97629af5ac2f609de367472b2696 third_party/nccl/nccl
+ rmdir third_party/NNPACK && ln -sv "${WORKDIR}"/NNPACK-24b55303f5cf65d75844714513a0d1b1409809bd third_party/NNPACK
+ rmdir third_party/onnx && ln -sv "${WORKDIR}"/onnx-a82c6a7010e2e332d8f74ad5b0c726fd47c85376 third_party/onnx
+ rmdir third_party/onnx-tensorrt && ln -sv "${WORKDIR}"/onnx-tensorrt-c153211418a7c57ce071d9ce2a41f8d1c85a878f third_party/onnx-tensorrt
+ rmdir third_party/onnx-tensorrt/third_party/onnx && ln -sv "${WORKDIR}"/onnx-765f5ee823a67a866f4bd28a9860e81f3c811ce8 third_party/onnx-tensorrt/third_party/onnx
+ rmdir third_party/onnx-tensorrt/third_party/onnx/third_party/benchmark && ln -sv "${WORKDIR}"/benchmark-e776aa0275e293707b6a0901e0e8d8a8a3679508 third_party/onnx-tensorrt/third_party/onnx/third_party/benchmark
+ rmdir third_party/onnx/third_party/benchmark && ln -sv "${WORKDIR}"/benchmark-e776aa0275e293707b6a0901e0e8d8a8a3679508 third_party/onnx/third_party/benchmark
+ rmdir third_party/psimd && ln -sv "${WORKDIR}"/psimd-072586a71b55b7f8c584153d223e95687148a900 third_party/psimd
+ rmdir third_party/pthreadpool && ln -sv "${WORKDIR}"/pthreadpool-029c88620802e1361ccf41d1970bd5b07fd6b7bb third_party/pthreadpool
+ rmdir third_party/python-peachpy && ln -sv "${WORKDIR}"/PeachPy-07d8fde8ac45d7705129475c0f94ed8925b93473 third_party/python-peachpy
+ rmdir third_party/QNNPACK && ln -sv "${WORKDIR}"/QNNPACK-7d2a4e9931a82adc3814275b6219a03e24e36b4c third_party/QNNPACK
+ rmdir third_party/sleef && ln -sv "${WORKDIR}"/sleef-7f523de651585fe25cade462efccca647dcc8d02 third_party/sleef
+ rmdir third_party/tensorpipe && ln -sv "${WORKDIR}"/tensorpipe-95ff9319161fcdb3c674d2bb63fac3e94095b343 third_party/tensorpipe
+ rmdir third_party/tensorpipe/third_party/googletest && ln -sv "${WORKDIR}"/googletest-2fe3bd994b3189899d93f1d5a881e725e046fdc2 third_party/tensorpipe/third_party/googletest
+ rmdir third_party/tensorpipe/third_party/libnop && ln -sv "${WORKDIR}"/libnop-aa95422ea8c409e3f078d2ee7708a5f59a8b9fa2 third_party/tensorpipe/third_party/libnop
+ rmdir third_party/tensorpipe/third_party/libuv && ln -sv "${WORKDIR}"/libuv-02a9e1be252b623ee032a3137c0b0c94afbe6809 third_party/tensorpipe/third_party/libuv
+ rmdir third_party/XNNPACK && ln -sv "${WORKDIR}"/XNNPACK-1b354636b5942826547055252f3b359b54acff95 third_party/XNNPACK
+
+ if use cuda; then
+ cd third_party/nccl/nccl || die
+ eapply "${FILESDIR}"/${PN}-1.6.0-nccl-nvccflags.patch
+
+ addpredict /dev/nvidiactl
+ cuda_src_prepare
+ export CUDAHOSTCXX=$(cuda_gccdir)/g++
+ fi
+
+ if use rocm; then
+ #Allow escaping sandbox
+ addread /dev/kfd
+ addread /dev/dri
+ addwrite /dev/kfd
+ addwrite /dev/dri
+
+ ebegin "HIPifying cuda sources"
+ tools/amd_build/build_amd.py
+ eend $?
+
+ export PYTORCH_ROCM_ARCH=$(rocminfo | egrep -o "gfx[0-9]+" | uniq | awk -vORS=';' "{print $1}" | sed 's/;$/\n/') || die
+ sed -e "/set(roctracer_INCLUDE_DIRS/s,\${ROCTRACER_PATH}/include,${EPREFIX}/usr/include/roctracer," \
+ -i cmake/public/LoadHIP.cmake || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DTORCH_BUILD_VERSION=${PV}
+ -DTORCH_INSTALL_LIB_DIR=$(get_libdir)
+ -DBUILD_BINARY=$(usex tools ON OFF)
+ -DBUILD_CUSTOM_PROTOBUF=OFF
+ -DBUILD_PYTHON=$(usex python ON OFF)
+ -DBUILD_SHARED_LIBS=$(usex static OFF ON)
+ -DBUILD_TEST=$(usex test ON OFF)
+ -DUSE_ASAN=$(usex asan ON OFF)
+ -DUSE_CUDA=$(usex cuda ON OFF)
+ -DUSE_NCCL=$(usex cuda ON OFF)
+ -DUSE_SYSTEM_NCCL=OFF
+ -DUSE_ROCM=$(usex rocm ON OFF)
+ -DUSE_FBGEMM=$(usex fbgemm ON OFF)
+ -DUSE_FFMPEG=$(usex ffmpeg ON OFF)
+ -DUSE_GFLAGS=$(usex gflags ON OFF)
+ -DUSE_GLOG=$(usex glog ON OFF)
+ -DUSE_LEVELDB=$(usex leveldb ON OFF)
+ -DUSE_LITE_PROTO=OFF
+ -DUSE_LMDB=$(usex lmdb ON OFF)
+ -DUSE_MKLDNN=$(usex mkldnn ON OFF)
+ -DUSE_MKLDNN_CBLAS=OFF
+ -DUSE_NNPACK=$(usex nnpack ON OFF)
+ -DUSE_NUMPY=$(usex python ON OFF)
+ -DUSE_NUMA=$(usex numa ON OFF)
+ -DUSE_OBSERVERS=$(usex observers ON OFF)
+ -DUSE_OPENCL=$(usex opencl ON OFF)
+ -DUSE_OPENCV=$(usex opencv ON OFF)
+ -DUSE_OPENMP=$(usex openmp ON OFF)
+ -DUSE_TBB=OFF
+ -DUSE_PROF=OFF
+ -DUSE_QNNPACK=$(usex qnnpack ON OFF)
+ -DUSE_REDIS=$(usex redis ON OFF)
+ -DUSE_ROCKSDB=OFF
+ -DUSE_ZMQ=$(usex zeromq ON OFF)
+ -DUSE_MPI=$(usex mpi ON OFF)
+ -DUSE_GLOO=$(usex gloo ON OFF)
+ -DUSE_SYSTEM_EIGEN_INSTALL=ON
+ -DBUILD_NAMEDTENSOR=$(usex namedtensor ON OFF)
+ -DBLAS=$(usex blas Generic Eigen)
+ -DTP_BUILD_LIBUV=OFF
+ -Wno-dev
+ )
+
+ cmake_src_configure
+
+ if use python; then
+ CMAKE_BUILD_DIR="${BUILD_DIR}" distutils-r1_src_configure
+ fi
+
+ # do not rerun cmake and the build process in src_install
+ sed '/RERUN/,+1d' -i "${BUILD_DIR}"/build.ninja || die
+}
+
+src_compile() {
+ cmake_src_compile
+
+ if use python; then
+ CMAKE_BUILD_DIR=${BUILD_DIR} distutils-r1_src_compile
+ fi
+}
+
+src_install() {
+ cmake_src_install
+
+ local LIB=$(get_libdir)
+ if [[ ${LIB} != lib ]]; then
+ mv -fv "${ED}"/usr/lib/*.so "${ED}"/usr/${LIB}/ || die
+ fi
+
+ rm -rfv "${ED}/torch"
+ rm -rfv "${ED}/var"
+ rm -rfv "${ED}/usr/lib"
+
+ rm -fv "${ED}/usr/include/*.{h,hpp}"
+ rm -rfv "${ED}/usr/include/asmjit"
+ rm -rfv "${ED}/usr/include/c10d"
+ rm -rfv "${ED}/usr/include/fbgemm"
+ rm -rfv "${ED}/usr/include/fp16"
+ rm -rfv "${ED}/usr/include/gloo"
+ rm -rfv "${ED}/usr/include/include"
+ rm -rfv "${ED}/usr/include/var"
+
+ cp -rv "${WORKDIR}/${P}/third_party/pybind11/include/pybind11" "${ED}/usr/include/"
+
+ rm -fv "${ED}/usr/${LIB}/libtbb.so"
+ rm -rfv "${ED}/usr/${LIB}/cmake"
+
+ if use python; then
+ scanelf -r --fix "${BUILD_DIR}/caffe2/python"
+ CMAKE_BUILD_DIR=${BUILD_DIR} distutils-r1_src_install
+
+ python_foreach_impl python_optimize
+ fi
+
+ find "${ED}/usr/${LIB}" -name "*.a" -exec rm -fv {} \;
+
+ use test && rm -rfv "${ED}/usr/test" "${ED}"/usr/bin/test_{api,jit}
+
+ # Remove the empty directories by CMake Python:
+ find "${ED}" -type d -empty -delete || die
+}
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2021-01-30 15:39 Andrew Ammerlaan
0 siblings, 0 replies; 10+ messages in thread
From: Andrew Ammerlaan @ 2021-01-30 15:39 UTC (permalink / raw
To: gentoo-commits
commit: b58d722332ff8d22656fe38dcc7509b8194de3fa
Author: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
AuthorDate: Sat Jan 30 15:39:44 2021 +0000
Commit: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
CommitDate: Sat Jan 30 15:39:44 2021 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=b58d7223
sci-libs/pytorch: add missing RESTRICT="!test? ( test )"
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>
sci-libs/pytorch/files/get_third_parties | 0
sci-libs/pytorch/pytorch-1.7.1-r2.ebuild | 2 +-
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/sci-libs/pytorch/files/get_third_parties b/sci-libs/pytorch/files/get_third_parties
old mode 100755
new mode 100644
diff --git a/sci-libs/pytorch/pytorch-1.7.1-r2.ebuild b/sci-libs/pytorch/pytorch-1.7.1-r2.ebuild
index 77d314ca9..dff47d8da 100644
--- a/sci-libs/pytorch/pytorch-1.7.1-r2.ebuild
+++ b/sci-libs/pytorch/pytorch-1.7.1-r2.ebuild
@@ -56,7 +56,7 @@ SLOT="0"
KEYWORDS="~amd64"
IUSE="asan blas cuda +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkldnn mpi namedtensor +nnpack numa +observers opencl opencv +openmp +python +qnnpack redis rocm static test tools zeromq"
-
+RESTRICT="!test? ( test )"
REQUIRED_USE="
^^ ( cuda rocm )
"
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2021-12-22 14:33 Andrew Ammerlaan
0 siblings, 0 replies; 10+ messages in thread
From: Andrew Ammerlaan @ 2021-12-22 14:33 UTC (permalink / raw
To: gentoo-commits
commit: 65e0afb1b927e1da6d8e23565b7d0aa1eacfc013
Author: YiyangWu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Wed Dec 22 09:59:27 2021 +0000
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Wed Dec 22 12:42:23 2021 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=65e0afb1
sci-libs/pytorch: fix python and update rocm support
Other changes:
1. Pytorch seems to be work fine with different version of protobuf, so
no need to specify 0/30; however when protobuf version changed torch
should be rebuilt.
2. BUILD_NAMEDTENSOR is not an option now
3. Verbose mode for rm in src_install
Package-Manager: Portage-3.0.22, Repoman-3.0.3
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Closes: https://github.com/gentoo/sci/pull/1123
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
...ibrary-directory-according-to-CMake-build.patch | 32 +++++++++++++++
.../files/pytorch-1.9.1-fix-wrong-hipify.patch | 13 ++++++
sci-libs/pytorch/pytorch-1.10.1.ebuild | 47 +++++++++++++---------
3 files changed, 74 insertions(+), 18 deletions(-)
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 000000000..214267487
--- /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/files/pytorch-1.9.1-fix-wrong-hipify.patch b/sci-libs/pytorch/files/pytorch-1.9.1-fix-wrong-hipify.patch
new file mode 100644
index 000000000..4e37acd3f
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.9.1-fix-wrong-hipify.patch
@@ -0,0 +1,13 @@
+The hipify misadd a ) and causes compilation error
+
+--- orig/aten/src/ATen/native/sparse/hip/SparseHIPTensor.hip
++++ pytorch-1.9.1/aten/src/ATen/native/sparse/hip/SparseHIPTensor.hip
+@@ -282,7 +282,7 @@ Tensor sparse_mask_helper_cuda(
+ mask_indices_ti,
+ t_indices_pos_ti,
+ t_values_ti,
+- r_values_ti);
++ r_values_ti;
+ C10_HIP_KERNEL_LAUNCH_CHECK();
+ });
+ }
diff --git a/sci-libs/pytorch/pytorch-1.10.1.ebuild b/sci-libs/pytorch/pytorch-1.10.1.ebuild
index 5a745c28f..1750f40c9 100644
--- a/sci-libs/pytorch/pytorch-1.10.1.ebuild
+++ b/sci-libs/pytorch/pytorch-1.10.1.ebuild
@@ -58,7 +58,8 @@ LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
-IUSE="asan blas cuda +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkldnn mpi namedtensor +nnpack numa +observers opencl opencv +openmp +python +qnnpack redis rocm static tools zeromq"
+IUSE="asan blas cuda +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkldnn mpi namedtensor +nnpack numa +observers opencl opencv +openmp +python +qnnpack redis rocm static test tools zeromq"
+RESTRICT="!test? ( test )"
REQUIRED_USE="
?? ( cuda rocm )
"
@@ -68,17 +69,17 @@ RDEPEND="
blas? ( virtual/blas )
cuda? ( dev-libs/cudnn
dev-cpp/eigen[cuda] )
- rocm? ( >=dev-util/hip-4.0.0-r1
- >=dev-libs/rccl-4
- >=sci-libs/rocThrust-4
- >=sci-libs/hipCUB-4
- >=sci-libs/rocPRIM-4
- >=sci-libs/miopen-4
- >=sci-libs/rocBLAS-4
- >=sci-libs/rocRAND-4
- >=sci-libs/hipSPARSE-4
- >=sci-libs/rocFFT-4
- >=dev-util/roctracer-4 )
+ rocm? ( >=dev-util/hip-4.3
+ >=dev-libs/rccl-4.3
+ >=sci-libs/rocThrust-4.3
+ >=sci-libs/hipCUB-4.3
+ >=sci-libs/rocPRIM-4.3
+ >=sci-libs/miopen-4.3
+ >=sci-libs/rocBLAS-4.3
+ >=sci-libs/rocRAND-4.3
+ >=sci-libs/hipSPARSE-4.3
+ >=sci-libs/rocFFT-4.3
+ >=dev-util/roctracer-4.3 )
ffmpeg? ( media-video/ffmpeg )
gflags? ( dev-cpp/gflags )
glog? ( dev-cpp/glog[gflags] )
@@ -90,12 +91,12 @@ RDEPEND="
python? ( ${PYTHON_DEPS}
dev-python/pybind11[${PYTHON_USEDEP}]
dev-python/numpy[${PYTHON_USEDEP}]
- dev-python/protobuf-python:0/30
+ dev-python/protobuf-python:=
)
redis? ( dev-db/redis )
zeromq? ( net-libs/zeromq )
dev-cpp/eigen
- dev-libs/protobuf:0/30
+ dev-libs/protobuf:=
dev-libs/libuv
"
@@ -103,6 +104,7 @@ RDEPEND="
BDEPEND="dev-python/pyyaml"
DEPEND="${RDEPEND}
+ test? ( dev-python/pytest[${PYTHON_USEDEP}] )
dev-cpp/tbb
app-arch/zstd
dev-python/pybind11[${PYTHON_USEDEP}]
@@ -112,7 +114,7 @@ DEPEND="${RDEPEND}
"
PATCHES=(
- "${FILESDIR}"/${PN}-1.6.0-skip-tests.patch
+ "${FILESDIR}"/${PN}-1.9.0-Change-library-directory-according-to-CMake-build.patch
"${FILESDIR}"/${PN}-1.6.0-global-dlopen.patch
"${FILESDIR}"/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch
"${FILESDIR}"/${PN}-1.7.1-no-rpath.patch
@@ -213,12 +215,21 @@ src_prepare() {
ebegin "HIPifying cuda sources"
${EPYTHON} tools/amd_build/build_amd.py || die
+ eapply "${FILESDIR}"/${PN}-1.9.1-fix-wrong-hipify.patch
eend $?
- export PYTORCH_ROCM_ARCH=$(rocminfo | egrep -o "gfx[0-9]+" | uniq | awk -vORS=';' "{print $1}" | sed 's/;$/\n/') || die
+ local ROCM_VERSION="$(hipconfig -v)-"
+ export PYTORCH_ROCM_ARCH="${AMDGPU_TARGETS}"
sed -e "/set(roctracer_INCLUDE_DIRS/s,\${ROCTRACER_PATH}/include,${EPREFIX}/usr/include/roctracer," \
+ -e "/PYTORCH_HIP_HCC_LIBRARIES/s,\${HIP_PATH}/lib,${EPREFIX}/usr/lib/hip/lib," \
+ -e "s,\${ROCTRACER_PATH}/lib,${EPREFIX}/usr/lib64/roctracer," \
+ -e "/READ.*\.info\/version-dev/c\ set(ROCM_VERSION_DEV_RAW ${ROCM_VERSION})" \
-i cmake/public/LoadHIP.cmake || die
+ sed -r -e '/^if\(USE_ROCM/{:a;N;/\nendif/!ba; s,\{([^\{]*)_PATH\}(/include)?,\{\L\1_\UINCLUDE_DIRS\},g}' -i cmake/Dependencies.cmake || die
fi
+
+ # Set build dir for pytorch's setup
+ sed -e "/BUILD_DIR/s,build,${BUILD_DIR}," -i tools/setup_helpers/env.py || die
}
src_configure() {
@@ -262,13 +273,12 @@ src_configure() {
-DUSE_GLOO=$(usex gloo ON OFF)
-DUSE_SYSTEM_EIGEN_INSTALL=ON
-DUSE_SYSTEM_PYBIND11=ON
- -DBUILD_NAMEDTENSOR=$(usex namedtensor ON OFF)
-DBLAS=$(usex blas Generic Eigen)
-DTP_BUILD_LIBUV=OFF
-Wno-dev
)
- cmake_src_configure
+ HIP_PATH="${EPREFIX}/usr/lib/hip" cmake_src_configure
if use python; then
CMAKE_BUILD_DIR="${BUILD_DIR}" distutils-r1_src_configure
@@ -308,6 +318,7 @@ src_install() {
rm -rfv "${ED}/usr/include/var"
rm -r "${ED}/usr/${LIB}/cmake" || die
+ rm -rv "${ED}/usr/${LIB}/cmake" || die
if use python; then
scanelf -r --fix "${BUILD_DIR}/caffe2/python" || die
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2021-12-26 13:38 Benda XU
0 siblings, 0 replies; 10+ messages in thread
From: Benda XU @ 2021-12-26 13:38 UTC (permalink / raw
To: gentoo-commits
commit: 74376475a3dbb8124f5fedea9af4ba69a2a4b82f
Author: YiyangWu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Sat Dec 25 16:46:19 2021 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sun Dec 26 13:36:52 2021 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=74376475
sci-libs/pytorch: fix python build with >=setuptools-59.6
Reference: https://github.com/pytorch/pytorch/commit/07767569c964552702bf374da753212eb9cde327
Reference: https://github.com/gentoo/sci/pull/1123#issuecomment-999597677
Package-Manager: Portage-3.0.22, Repoman-3.0.3
Closes: https://github.com/gentoo/sci/pull/1130
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
.../files/pytorch-1.10.0-fix-distutils.patch | 93 ++++++++++++++++++++++
sci-libs/pytorch/pytorch-1.10.1.ebuild | 1 +
2 files changed, 94 insertions(+)
diff --git a/sci-libs/pytorch/files/pytorch-1.10.0-fix-distutils.patch b/sci-libs/pytorch/files/pytorch-1.10.0-fix-distutils.patch
new file mode 100644
index 000000000..334bcda6f
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.10.0-fix-distutils.patch
@@ -0,0 +1,93 @@
+This fix distutils-r1_src_install failure with setuptools-59
+
+From 9af2edb158b3603c44eff6e12896f1d215e8b898 Mon Sep 17 00:00:00 2001
+From: Nikita Shulga <nshulga@fb.com>
+Date: Tue, 14 Dec 2021 07:15:34 -0800
+Subject: [PATCH] Properly import LooseVersion
+
+This fixes regression introduced by https://github.com/pytorch/pytorch/pull/57040
+
+Somehow importing `distutils` from `setuptool` caused import of
+`distutils.versions`, which is not a documented dependency and got
+change with the release of
+[setuptools-59.6.0](https://github.com/pypa/setuptools/tree/v59.6.0)
+We should not rely on that, as
+`import distutils` never re-imports `distutils.version`, which one can
+see by observing
+https://github.com/python/cpython/blob/3.9/Lib/distutils/__init__.py
+or by running:
+```
+% python3 -c "import distutils;print(distutils.__version__, dir(distutils))"
+3.7.5 ['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', 'sys']
+% python3 -c "from setuptools import distutils;print(distutils.__version__, dir(distutils))"
+3.7.5 ['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', 'archive_util', 'ccompiler', 'cmd', 'config', 'core', 'debug', 'dep_util', 'dir_util', 'dist', 'errors', 'extension', 'fancy_getopt', 'file_util', 'filelist', 'log', 'spawn', 'sys', 'sysconfig', 'util', 'version']
+```
+---
+ test/run_test.py | 4 ++--
+ tools/setup_helpers/cmake.py | 8 ++++----
+ torch/testing/_internal/common_methods_invocations.py | 8 ++++----
+ 3 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/tools/setup_helpers/cmake.py b/tools/setup_helpers/cmake.py
+index 01e87b4bca879..686b5c4a34f4c 100644
+--- a/tools/setup_helpers/cmake.py
++++ b/tools/setup_helpers/cmake.py
+@@ -8,7 +8,7 @@
+ from subprocess import check_call, check_output, CalledProcessError
+ import sys
+ import sysconfig
+-from setuptools import distutils # type: ignore[import]
++from distutils.version import LooseVersion
+ from typing import IO, Any, Dict, List, Optional, Union, cast
+
+ from . import which
+@@ -120,10 +120,10 @@ def _get_cmake_command() -> str:
+ return cmake_command
+ cmake3 = which('cmake3')
+ cmake = which('cmake')
+- if cmake3 is not None and CMake._get_version(cmake3) >= distutils.version.LooseVersion("3.10.0"):
++ if cmake3 is not None and CMake._get_version(cmake3) >= LooseVersion("3.10.0"):
+ cmake_command = 'cmake3'
+ return cmake_command
+- elif cmake is not None and CMake._get_version(cmake) >= distutils.version.LooseVersion("3.10.0"):
++ elif cmake is not None and CMake._get_version(cmake) >= LooseVersion("3.10.0"):
+ return cmake_command
+ else:
+ raise RuntimeError('no cmake or cmake3 with version >= 3.10.0 found')
+@@ -134,7 +134,7 @@ def _get_version(cmd: str) -> Any:
+
+ for line in check_output([cmd, '--version']).decode('utf-8').split('\n'):
+ if 'version' in line:
+- return distutils.version.LooseVersion(line.strip().split(' ')[2])
++ return LooseVersion(line.strip().split(' ')[2])
+ raise RuntimeError('no version found')
+
+ def run(self, args: List[str], env: Dict[str, str]) -> None:
+diff --git a/torch/testing/_internal/common_methods_invocations.py b/torch/testing/_internal/common_methods_invocations.py
+index b66e6470b590c..6ec77c2b0ce2e 100644
+--- a/torch/testing/_internal/common_methods_invocations.py
++++ b/torch/testing/_internal/common_methods_invocations.py
+@@ -40,7 +40,7 @@
+ freeze_rng_state)
+ import torch.testing._internal.opinfo_helper as opinfo_helper
+
+-from setuptools import distutils
++from distutils.version import LooseVersion
+
+ has_scipy_fft = False
+ if TEST_SCIPY:
+@@ -14008,11 +14008,11 @@ def ref_pairwise_distance(input1, input2):
+ skips=(
+ # Reference: https://github.com/pytorch/pytorch/pull/49155#issuecomment-742664611
+ DecorateInfo(unittest.skip("Skipped!"), 'TestUnaryUfuncs', 'test_reference_numerics_extremal',
+- active_if=TEST_SCIPY and distutils.version.LooseVersion(scipy.__version__) < "1.4.0"),
++ active_if=TEST_SCIPY and LooseVersion(scipy.__version__) < "1.4.0"),
+ DecorateInfo(unittest.skip("Skipped!"), 'TestUnaryUfuncs', 'test_reference_numerics_hard',
+- active_if=TEST_SCIPY and distutils.version.LooseVersion(scipy.__version__) < "1.4.0"),
++ active_if=TEST_SCIPY and LooseVersion(scipy.__version__) < "1.4.0"),
+ DecorateInfo(unittest.skip("Skipped!"), 'TestUnaryUfuncs', 'test_reference_numerics_normal',
+- active_if=TEST_SCIPY and distutils.version.LooseVersion(scipy.__version__) < "1.4.0"),
++ active_if=TEST_SCIPY and LooseVersion(scipy.__version__) < "1.4.0"),
+ )),
+ UnaryUfuncInfo('lgamma',
+ ref=reference_lgamma if TEST_SCIPY else _NOTHING,
diff --git a/sci-libs/pytorch/pytorch-1.10.1.ebuild b/sci-libs/pytorch/pytorch-1.10.1.ebuild
index e3b49e630..2a11e6240 100644
--- a/sci-libs/pytorch/pytorch-1.10.1.ebuild
+++ b/sci-libs/pytorch/pytorch-1.10.1.ebuild
@@ -117,6 +117,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-1.7.1-no-rpath.patch
"${FILESDIR}"/${PN}-1.7.1-torch_shm_manager.patch
"${FILESDIR}"/${PN}-1.10.0-nonull.patch
+ "${FILESDIR}"/${PN}-1.10.0-fix-distutils.patch
)
distutils_enable_tests pytest
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2021-12-26 14:12 Andrew Ammerlaan
0 siblings, 0 replies; 10+ messages in thread
From: Andrew Ammerlaan @ 2021-12-26 14:12 UTC (permalink / raw
To: gentoo-commits
commit: a5bc890e5d880b2b99952060fe82170a4680eb81
Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 26 14:10:33 2021 +0000
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Sun Dec 26 14:12:03 2021 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=a5bc890e
sci-libs/pytorch: add clhpp patch, fix setuptools dep
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
sci-libs/pytorch/files/pytorch-1.10.0-clhpp2.patch | 52 ++++++++++++++++++++++
sci-libs/pytorch/pytorch-1.10.1.ebuild | 8 ++--
2 files changed, 57 insertions(+), 3 deletions(-)
diff --git a/sci-libs/pytorch/files/pytorch-1.10.0-clhpp2.patch b/sci-libs/pytorch/files/pytorch-1.10.0-clhpp2.patch
new file mode 100644
index 000000000..9c267dc6e
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.10.0-clhpp2.patch
@@ -0,0 +1,52 @@
+diff --git a/caffe2/contrib/opencl/OpenCL/cl.hpp b/caffe2/contrib/opencl/OpenCL/cl.hpp
+index 87cc4a1..7c27e33 100644
+--- a/caffe2/contrib/opencl/OpenCL/cl.hpp
++++ b/caffe2/contrib/opencl/OpenCL/cl.hpp
+@@ -76,7 +76,7 @@
+ * #if defined(__APPLE__) || defined(__MACOSX)
+ * #include <OpenCL/cl.hpp>
+ * #else
+- * #include <CL/cl.hpp>
++ * #include <CL/cl2.hpp>
+ * #endif
+ * #include <cstdio>
+ * #include <cstdlib>
+diff --git a/caffe2/contrib/opencl/context.h b/caffe2/contrib/opencl/context.h
+index b1e61c2..968d3c7 100644
+--- a/caffe2/contrib/opencl/context.h
++++ b/caffe2/contrib/opencl/context.h
+@@ -11,7 +11,7 @@
+ #if defined(__APPLE__) || defined(__MACOSX)
+ #include <OpenCL/cl.hpp>
+ #else
+-#include <CL/cl.hpp>
++#include <CL/cl2.hpp>
+ #endif
+
+ #define OPENCL_CHECK(expr) (void)expr
+diff --git a/caffe2/mobile/contrib/libopencl-stub/include/CL/cl.hpp b/caffe2/mobile/contrib/libopencl-stub/include/CL/cl.hpp
+index f3badf7..928c9f0 100644
+--- a/caffe2/mobile/contrib/libopencl-stub/include/CL/cl.hpp
++++ b/caffe2/mobile/contrib/libopencl-stub/include/CL/cl.hpp
+@@ -76,7 +76,7 @@
+ * #if defined(__APPLE__) || defined(__MACOSX)
+ * #include <OpenCL/cl.hpp>
+ * #else
+- * #include <CL/cl.hpp>
++ * #include <CL/cl2.hpp>
+ * #endif
+ * #include <cstdio>
+ * #include <cstdlib>
+diff --git a/third_party/tensorflow_cuda_bazel_build/cuda/BUILD b/third_party/tensorflow_cuda_bazel_build/cuda/BUILD
+index f7271af..334f4ec 100755
+--- a/third_party/tensorflow_cuda_bazel_build/cuda/BUILD
++++ b/third_party/tensorflow_cuda_bazel_build/cuda/BUILD
+@@ -188,7 +188,7 @@ CUDA_INCLUDES_FILES = [
+ "include/CL/cl_gl_ext.h",
+ "include/CL/cl_gl.h",
+ "include/CL/cl.h",
+- "include/CL/cl.hpp",
++ "include/CL/cl2.hpp",
+ "include/CL/cl_platform.h",
+ "include/CL/opencl.h",
+ "include/common_functions.h",
diff --git a/sci-libs/pytorch/pytorch-1.10.1.ebuild b/sci-libs/pytorch/pytorch-1.10.1.ebuild
index 2a11e6240..98afa9662 100644
--- a/sci-libs/pytorch/pytorch-1.10.1.ebuild
+++ b/sci-libs/pytorch/pytorch-1.10.1.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-DISTUTILS_USE_SETUPTOOLS=no
+DISTUTILS_USE_SETUPTOOLS=manual
PYTHON_COMPAT=( python3_{8..10} )
inherit cmake cuda distutils-r1 prefix
@@ -84,9 +84,10 @@ RDEPEND="
leveldb? ( dev-libs/leveldb )
lmdb? ( dev-db/lmdb )
mpi? ( virtual/mpi )
- opencl? ( dev-libs/clhpp virtual/opencl )
+ opencl? ( dev-libs/clhpp )
opencv? ( media-libs/opencv )
python? ( ${PYTHON_DEPS}
+ dev-python/setuptools[${PYTHON_USEDEP}]
dev-python/pybind11[${PYTHON_USEDEP}]
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/protobuf-python:=
@@ -118,9 +119,10 @@ PATCHES=(
"${FILESDIR}"/${PN}-1.7.1-torch_shm_manager.patch
"${FILESDIR}"/${PN}-1.10.0-nonull.patch
"${FILESDIR}"/${PN}-1.10.0-fix-distutils.patch
+ "${FILESDIR}"/${PN}-1.10.0-clhpp2.patch
)
-distutils_enable_tests pytest
+distutils_enable_tests --install pytest
src_prepare() {
cmake_src_prepare
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2021-12-27 11:50 Andrew Ammerlaan
0 siblings, 0 replies; 10+ messages in thread
From: Andrew Ammerlaan @ 2021-12-27 11:50 UTC (permalink / raw
To: gentoo-commits
commit: fad64b065493a4406304cf7cb4d4aa36a7876555
Author: Miezhiko <Miezhiko <AT> gmail <DOT> com>
AuthorDate: Mon Dec 27 10:56:29 2021 +0000
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Mon Dec 27 11:01:04 2021 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=fad64b06
sci-libs/pytorch: fixes for cuda USE flag, nccl update
Signed-off-by: Miezhiko <Miezhiko <AT> gmail.com>
Closes: https://github.com/gentoo/sci/pull/1132
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
.../files/pytorch-1.10.1-nccl-nvccflags.patch | 37 ++++++++++++++++++++++
sci-libs/pytorch/pytorch-1.10.1.ebuild | 7 ++--
2 files changed, 41 insertions(+), 3 deletions(-)
diff --git a/sci-libs/pytorch/files/pytorch-1.10.1-nccl-nvccflags.patch b/sci-libs/pytorch/files/pytorch-1.10.1-nccl-nvccflags.patch
new file mode 100644
index 000000000..0ac12a1e7
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.10.1-nccl-nvccflags.patch
@@ -0,0 +1,37 @@
+From 7b04cd503fa1a6265893e0320ee246bcc0bd98cf Mon Sep 17 00:00:00 2001
+From: Miezhiko <Miezhiko@gmail.com>
+Date: Mon, 27 Dec 2021 14:48:12 +0400
+Subject: [PATCH] neutral flags
+
+---
+ makefiles/common.mk | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/makefiles/common.mk b/makefiles/common.mk
+index 64f8d2dc6..7a979c90f 100644
+--- a/makefiles/common.mk
++++ b/makefiles/common.mk
+@@ -55,7 +55,7 @@ CXXFLAGS := -DCUDA_MAJOR=$(CUDA_MAJOR) -DCUDA_MINOR=$(CUDA_MINOR) -fPIC -fvisi
+ # Maxrregcount needs to be set accordingly to NCCL_MAX_NTHREADS (otherwise it will cause kernel launch errors)
+ # 512 : 120, 640 : 96, 768 : 80, 1024 : 60
+ # We would not have to set this if we used __launch_bounds__, but this only works on kernels, not on functions.
+-NVCUFLAGS := -ccbin $(CXX) $(NVCC_GENCODE) -std=c++11 --expt-extended-lambda -Xptxas -maxrregcount=96 -Xfatbin -compress-all
++NVCUFLAGS := $(NVCCFLAGS) $(NVCC_GENCODE) -std=c++11 --expt-extended-lambda -Xptxas -maxrregcount=96 -Xfatbin -compress-all
+ # Use addprefix so that we can specify more than one path
+ NVLDFLAGS := -L${CUDA_LIB} -lcudart -lrt
+
+@@ -69,14 +69,6 @@ NVLDFLAGS += ${GCOV_FLAGS:%=-Xcompiler %}
+ # $(warning GCOV_FLAGS=${GCOV_FLAGS})
+ ########## GCOV ##########
+
+-ifeq ($(DEBUG), 0)
+-NVCUFLAGS += -O3
+-CXXFLAGS += -O3 -g
+-else
+-NVCUFLAGS += -O0 -G -g
+-CXXFLAGS += -O0 -g -ggdb3
+-endif
+-
+ ifneq ($(VERBOSE), 0)
+ NVCUFLAGS += -Xptxas -v -Xcompiler -Wall,-Wextra,-Wno-unused-parameter
+ CXXFLAGS += -Wall -Wextra
diff --git a/sci-libs/pytorch/pytorch-1.10.1.ebuild b/sci-libs/pytorch/pytorch-1.10.1.ebuild
index a7bbb62ac..948d595a7 100644
--- a/sci-libs/pytorch/pytorch-1.10.1.ebuild
+++ b/sci-libs/pytorch/pytorch-1.10.1.ebuild
@@ -28,7 +28,7 @@ https://github.com/facebookincubator/gloo/archive/c22a5cfba94edf8ea4f53a174d38aa
https://github.com/google/googletest/archive/e2239ee6043f73722e7aa812a459f54a28552929.tar.gz -> googletest-e2239ee6043f73722e7aa812a459f54a28552929.tar.gz
https://github.com/intel/ideep/archive/9ca27bbfd88fa1469cbf0467bd6f14cd1738fa40.tar.gz -> ideep-9ca27bbfd88fa1469cbf0467bd6f14cd1738fa40.tar.gz
https://github.com/intel/mkl-dnn/archive/5ef631a0.tar.gz -> mkl-dnn-5ef631a0.tar.gz
-cuda? ( https://github.com/NVIDIA/nccl/archive/033d7995.tar.gz -> nccl-033d7995.tar.gz )
+cuda? ( https://github.com/NVIDIA/nccl/archive/c5790b36722d5b41ee2a9b2bad69e364180ffd22.tar.gz -> nccl-c5790b36722d5b41ee2a9b2bad69e364180ffd22.tar.gz )
https://github.com/Maratyszcza/NNPACK/archive/c07e3a0400713d546e0dea2d5466dd22ea389c73.tar.gz -> NNPACK-c07e3a0400713d546e0dea2d5466dd22ea389c73.tar.gz
https://github.com/onnx/onnx/archive/a82c6a70.tar.gz -> onnx-a82c6a70.tar.gz
https://github.com/onnx/onnx-tensorrt/archive/c153211418a7c57ce071d9ce2a41f8d1c85a878f.tar.gz -> onnx-tensorrt-c153211418a7c57ce071d9ce2a41f8d1c85a878f.tar.gz
@@ -168,7 +168,7 @@ src_prepare() {
rmdir third_party/ideep/mkl-dnn || die
ln -sv "${WORKDIR}"/mkl-dnn-5ef631a030a6f73131c77892041042805a06064f third_party/ideep/mkl-dnn || die
rmdir third_party/nccl/nccl || die
- ln -sv "${WORKDIR}"/nccl-033d799524fb97629af5ac2f609de367472b2696 third_party/nccl/nccl || die
+ ln -sv "${WORKDIR}"/nccl-c5790b36722d5b41ee2a9b2bad69e364180ffd22 third_party/nccl/nccl || die
rmdir third_party/NNPACK || die
ln -sv "${WORKDIR}"/NNPACK-c07e3a0400713d546e0dea2d5466dd22ea389c73 third_party/NNPACK || die
rmdir third_party/onnx || die
@@ -208,9 +208,10 @@ src_prepare() {
if use cuda; then
cd third_party/nccl/nccl || die
- eapply "${FILESDIR}"/${PN}-1.6.0-nccl-nvccflags.patch
+ eapply "${FILESDIR}"/${PN}-1.10.1-nccl-nvccflags.patch
cuda_src_prepare
export CUDAHOSTCXX=$(cuda_gccdir)/g++
+ cd "${S}"
fi
if use rocm; then
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
@ 2022-07-03 8:37 Andrew Ammerlaan
0 siblings, 0 replies; 10+ messages in thread
From: Andrew Ammerlaan @ 2022-07-03 8:37 UTC (permalink / raw
To: gentoo-commits
commit: c6c1ae168e2ebd9bb070c31b7468f44ee4884d0d
Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 3 08:36:55 2022 +0000
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Sun Jul 3 08:36:55 2022 +0000
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=c6c1ae16
sci-libs/pytorch: moved to ::gentoo
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
...-t-build-libtorch-again-for-PyTorch-1.4.0.patch | 30 --
...-t-build-libtorch-again-for-PyTorch-1.7.1.patch | 18 --
...path-to-caffe2-build-dir-made-by-libtorch.patch | 46 ---
...rpath-of-Caffe2-library-for-system-wide-i.patch | 104 -------
...ibrary-directory-according-to-CMake-build.patch | 31 --
...conversion-ambiguity-in-ternary-operators.patch | 38 ---
sci-libs/pytorch/files/get_third_parties | 20 --
sci-libs/pytorch/files/pytorch-1.10.0-clhpp2.patch | 52 ----
.../files/pytorch-1.10.0-fix-distutils.patch | 93 ------
sci-libs/pytorch/files/pytorch-1.10.0-nonull.patch | 12 -
.../files/pytorch-1.10.1-nccl-nvccflags.patch | 37 ---
sci-libs/pytorch/files/pytorch-1.2.0-setup.patch | 24 --
.../files/pytorch-1.4.0-nccl-nvccflags.patch | 28 --
.../pytorch/files/pytorch-1.4.0-skip-tests.patch | 28 --
sci-libs/pytorch/files/pytorch-1.4.0-sleef.patch | 15 -
.../files/pytorch-1.6.0-global-dlopen.patch | 15 -
.../files/pytorch-1.6.0-nccl-nvccflags.patch | 27 --
sci-libs/pytorch/files/pytorch-1.6.0-setup.patch | 14 -
.../pytorch/files/pytorch-1.6.0-skip-tests.patch | 14 -
.../pytorch-1.6.0-tensorpipe-unbundle-libuv.patch | 13 -
.../pytorch/files/pytorch-1.7.1-no-rpath.patch | 12 -
sci-libs/pytorch/files/pytorch-1.7.1-setup.patch | 12 -
.../pytorch-1.7.1-tensorpipe-unbundle-libuv.patch | 12 -
.../files/pytorch-1.7.1-torch_shm_manager.patch | 13 -
...ibrary-directory-according-to-CMake-build.patch | 32 --
.../files/pytorch-1.9.1-fix-wrong-hipify.patch | 13 -
sci-libs/pytorch/metadata.xml | 34 ---
sci-libs/pytorch/pytorch-1.10.2.ebuild | 339 ---------------------
28 files changed, 1126 deletions(-)
diff --git a/sci-libs/pytorch/files/0002-Don-t-build-libtorch-again-for-PyTorch-1.4.0.patch b/sci-libs/pytorch/files/0002-Don-t-build-libtorch-again-for-PyTorch-1.4.0.patch
deleted file mode 100644
index de9fe9a0d..000000000
--- a/sci-libs/pytorch/files/0002-Don-t-build-libtorch-again-for-PyTorch-1.4.0.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From e5003b88ad3a504eb04c0ba66c2f439149de2ee3 Mon Sep 17 00:00:00 2001
-From: Alexey Chernov <4ernov@gmail.com>
-Date: Tue, 5 Nov 2019 00:58:17 +0300
-Subject: [PATCH 2/7] Don't build `libtorch` again for PyTorch
-
-If starting with building of `libtorch` using CMake,
-don't build it again for the sake of running `setup.py`
-to build Python version (PyTorch).
----
- setup.py | 7 -------
- 1 file changed, 7 deletions(-)
-
-Index: pytorch-1.4.0_p0/setup.py
-===================================================================
---- pytorch-1.4.0_p0.orig/setup.py
-+++ pytorch-1.4.0_p0/setup.py
-@@ -303,13 +303,6 @@ def build_deps():
- check_pydep('yaml', 'pyyaml')
- check_pydep('typing', 'typing')
-
-- build_caffe2(version=version,
-- cmake_python_library=cmake_python_library,
-- build_python=True,
-- rerun_cmake=RERUN_CMAKE,
-- cmake_only=CMAKE_ONLY,
-- cmake=cmake)
--
- version_path = os.path.join(cwd, 'torch', 'version.py')
- with open(version_path, 'w') as f:
- f.write("__version__ = '{}'\n".format(version))
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 16d2c1f2e..000000000
--- 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
-@@ -307,13 +307,6 @@ def build_deps():
- check_pydep('yaml', 'pyyaml')
- check_pydep('typing', 'typing')
-
-- 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/0003-Change-path-to-caffe2-build-dir-made-by-libtorch.patch b/sci-libs/pytorch/files/0003-Change-path-to-caffe2-build-dir-made-by-libtorch.patch
deleted file mode 100644
index f71ba17bc..000000000
--- a/sci-libs/pytorch/files/0003-Change-path-to-caffe2-build-dir-made-by-libtorch.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From dbb0bac77986016217cdfe779499a2ccd0e10570 Mon Sep 17 00:00:00 2001
-From: Alexey Chernov <4ernov@gmail.com>
-Date: Wed, 6 Nov 2019 00:16:24 +0300
-Subject: [PATCH 3/4] Change path to `caffe2` build dir made by `libtorch`
-
-Setup and use properly `caffe2` build dir made while
-`libtorch` building with CMake, so that it was used
-by the Python installation.
----
- setup.py | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index f4bfdc99cd..60502b6add 100644
---- a/setup.py
-+++ b/setup.py
-@@ -236,7 +236,7 @@ else:
- cwd = os.path.dirname(os.path.abspath(__file__))
- lib_path = os.path.join(cwd, "torch", "lib")
- third_party_path = os.path.join(cwd, "third_party")
--caffe2_build_dir = os.path.join(cwd, "build")
-+caffe2_build_dir = os.environ.get("CMAKE_BUILD_DIR", os.path.join(cwd, "build"))
- # lib/pythonx.x/site-packages
- rel_site_packages = distutils.sysconfig.get_python_lib(prefix='')
- # full absolute path to the dir above
-@@ -279,7 +279,7 @@ elif sha != 'Unknown':
- version += '+' + sha[:7]
- report("Building wheel {}-{}".format(package_name, version))
-
--cmake = CMake()
-+cmake = CMake(caffe2_build_dir)
-
- # all the work we need to do _before_ setup runs
- def build_deps():
-@@ -445,7 +445,7 @@ class build_ext(setuptools.command.build_ext.build_ext):
- filename = self.get_ext_filename(fullname)
- report("\nCopying extension {}".format(ext.name))
-
-- src = os.path.join("torch", rel_site_packages, filename)
-+ src = os.path.join(caffe2_build_dir, filename)
- if not os.path.exists(src):
- report("{} does not exist".format(src))
- del self.extensions[i]
---
-2.23.0
-
diff --git a/sci-libs/pytorch/files/0004-Don-t-fill-rpath-of-Caffe2-library-for-system-wide-i.patch b/sci-libs/pytorch/files/0004-Don-t-fill-rpath-of-Caffe2-library-for-system-wide-i.patch
deleted file mode 100644
index c8f57d9e6..000000000
--- a/sci-libs/pytorch/files/0004-Don-t-fill-rpath-of-Caffe2-library-for-system-wide-i.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From a0ace7295b6895954d2a0f8d6fe311a34a7c4e85 Mon Sep 17 00:00:00 2001
-From: Alexey Chernov <4ernov@gmail.com>
-Date: Tue, 12 Nov 2019 02:01:36 +0300
-Subject: [PATCH 4/4] Don't fill rpath of Caffe2 library for system-wide
- install
-
-Don't fill in runtime path of Caffe2 library for the case of
-building for system-wide installation.
----
- CMakeLists.txt | 3 +++
- caffe2/CMakeLists.txt | 18 +++++++++++++++---
- cmake/Dependencies.cmake | 19 +++++++++++--------
- 3 files changed, 29 insertions(+), 11 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 20923c0544..45a882ae0e 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -193,6 +193,9 @@ option(USE_TBB "Use TBB" OFF)
- # Used when building Caffe2 through setup.py
- option(BUILDING_WITH_TORCH_LIBS "Tell cmake if Caffe2 is being built alongside torch libs" ON)
-
-+# Used when building Caffe2 for further system-wide installation
-+option(BUILDING_SYSTEM_WIDE "Tell cmake if Caffe2 is being built for system-wide installation" OFF)
-+
- # /Z7 override option
- # When generating debug symbols, CMake default to use the flag /Zi.
- # However, it is not compatible with sccache. So we rewrite it off.
-diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index 1f7d037243..30d5615cdb 100644
---- a/caffe2/CMakeLists.txt
-+++ b/caffe2/CMakeLists.txt
-@@ -1235,7 +1235,11 @@ if (BUILD_PYTHON)
- if (MSVC AND BUILD_SHARED_LIBS)
- install(FILES $<TARGET_PDB_FILE:caffe2_pybind11_state> DESTINATION "${PYTHON_LIB_REL_PATH}/caffe2/python" OPTIONAL)
- endif()
-- set_target_properties(caffe2_pybind11_state PROPERTIES INSTALL_RPATH "${caffe2_pybind11_rpath}")
-+ if (NOT BUILDING_SYSTEM_WIDE)
-+ set_target_properties(caffe2_pybind11_state PROPERTIES INSTALL_RPATH "${caffe2_pybind11_rpath}")
-+else()
-+ set_target_properties(caffe2_pybind11_state PROPERTIES SKIP_BUILD_RPATH ON)
-+ endif()
-
- if(USE_CUDA)
- add_library(caffe2_pybind11_state_gpu MODULE ${Caffe2_GPU_PYTHON_SRCS})
-@@ -1261,7 +1265,11 @@ if (BUILD_PYTHON)
- if (MSVC AND BUILD_SHARED_LIBS)
- install(FILES $<TARGET_PDB_FILE:caffe2_pybind11_state_gpu> DESTINATION "${PYTHON_LIB_REL_PATH}/caffe2/python" OPTIONAL)
- endif()
-- set_target_properties(caffe2_pybind11_state_gpu PROPERTIES INSTALL_RPATH "${caffe2_pybind11_rpath}")
-+ if (NOT BUILDING_SYSTEM_WIDE)
-+ set_target_properties(caffe2_pybind11_state_gpu PROPERTIES INSTALL_RPATH "${caffe2_pybind11_rpath}")
-+ else()
-+ set_target_properties(caffe2_pybind11_state_gpu PROPERTIES SKIP_BUILD_RPATH ON)
-+ endif()
- endif()
-
- if(USE_ROCM)
-@@ -1284,7 +1292,11 @@ if (BUILD_PYTHON)
- caffe2_pybind11_state_hip PROPERTIES LIBRARY_OUTPUT_DIRECTORY
- ${CMAKE_BINARY_DIR}/caffe2/python)
- install(TARGETS caffe2_pybind11_state_hip DESTINATION "${PYTHON_LIB_REL_PATH}/caffe2/python")
-- set_target_properties(caffe2_pybind11_state_hip PROPERTIES INSTALL_RPATH "${caffe2_pybind11_rpath}")
-+ if (NOT BUILDING_SYSTEM_WIDE)
-+ set_target_properties(caffe2_pybind11_state_hip PROPERTIES INSTALL_RPATH "${caffe2_pybind11_rpath}")
-+ else()
-+ set_target_properties(caffe2_pybind11_state_hip PROPERTIES SKIP_BUILD_RPATH ON)
-+ endif()
- endif()
-
- if (MSVC AND CMAKE_GENERATOR MATCHES "Visual Studio")
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index a8e9769536..6ef9d7b0e2 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -6,14 +6,17 @@ if (APPLE)
- else()
- set(_rpath_portable_origin $ORIGIN)
- endif(APPLE)
--# Use separate rpaths during build and install phases
--set(CMAKE_SKIP_BUILD_RPATH FALSE)
--# Don't use the install-rpath during the build phase
--set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
--set(CMAKE_INSTALL_RPATH "${_rpath_portable_origin}")
--# Automatically add all linked folders that are NOT in the build directory to
--# the rpath (per library?)
--set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-+
-+if (NOT BUILDING_SYSTEM_WIDE)
-+ # Use separate rpaths during build and install phases
-+ set(CMAKE_SKIP_BUILD_RPATH FALSE)
-+ # Don't use the install-rpath during the build phase
-+ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
-+ set(CMAKE_INSTALL_RPATH "${_rpath_portable_origin}")
-+ # Automatically add all linked folders that are NOT in the build directory to
-+ # the rpath (per library?)
-+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-+endif()
-
- # UBSAN triggers when compiling protobuf, so we need to disable it.
- set(UBSAN_FLAG "-fsanitize=undefined")
---
-2.23.0
-
diff --git a/sci-libs/pytorch/files/0005-Change-library-directory-according-to-CMake-build.patch b/sci-libs/pytorch/files/0005-Change-library-directory-according-to-CMake-build.patch
deleted file mode 100644
index 324b8f682..000000000
--- a/sci-libs/pytorch/files/0005-Change-library-directory-according-to-CMake-build.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-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
-
-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
-@@ -234,9 +234,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.environ.get("CMAKE_BUILD_DIR", os.path.join(cwd, "build"))
-+caffe2_build_dir = cmake_build_dir
- # lib/pythonx.x/site-packages
- rel_site_packages = distutils.sysconfig.get_python_lib(prefix='')
- # full absolute path to the dir above
---
-2.23.0
-
diff --git a/sci-libs/pytorch/files/0010-Remove-conversion-ambiguity-in-ternary-operators.patch b/sci-libs/pytorch/files/0010-Remove-conversion-ambiguity-in-ternary-operators.patch
deleted file mode 100644
index 49835d201..000000000
--- a/sci-libs/pytorch/files/0010-Remove-conversion-ambiguity-in-ternary-operators.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 0f3a0d9a948fdd8481a5f7751a255ecd9ed4d37a Mon Sep 17 00:00:00 2001
-From: Alexey Chernov <4ernov@gmail.com>
-Date: Mon, 20 Jan 2020 01:21:22 +0300
-Subject: [PATCH 3/3] Remove conversion ambiguity in ternary operators
-
-It fails to compile with recent versions of Clang
-(namely, version 10 used behind HCC compiler when
-being built with ROCm support) with the
-`conditional expression is ambiguous` error.
----
- caffe2/operators/relu_op.cu | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/caffe2/operators/relu_op.cu b/caffe2/operators/relu_op.cu
-index f6edf7105e..ab49540fc9 100644
---- a/caffe2/operators/relu_op.cu
-+++ b/caffe2/operators/relu_op.cu
-@@ -51,7 +51,7 @@ __global__ void ReluCUDAKernel<half2>(const int N, const half2* X, half2* Y) {
- #else
- const float2 xx = __half22float2(X[i]);
- Y[i] =
-- __floats2half2_rn(xx.x > 0.0f ? xx.x : 0.0f, xx.y > 0.0f ? xx.y : 0.0f);
-+ __floats2half2_rn(xx.x > 0.0f ? float(xx.x) : 0.0f, xx.y > 0.0f ? float(xx.y) : 0.0f);
- #endif
- }
- }
-@@ -101,7 +101,7 @@ __global__ void ReluGradientCUDAKernel<half2>(
- const float2 dy = __half22float2(dY[i]);
- const float2 yy = __half22float2(Y[i]);
- dX[i] =
-- __floats2half2_rn(yy.x > 0.0f ? dy.x : 0.0f, yy.y > 0.0f ? dy.y : 0.0f);
-+ __floats2half2_rn(yy.x > 0.0f ? float(dy.x) : 0.0f, yy.y > 0.0f ? float(dy.y) : 0.0f);
- #endif
- }
- }
---
-2.24.1
-
diff --git a/sci-libs/pytorch/files/get_third_parties b/sci-libs/pytorch/files/get_third_parties
deleted file mode 100644
index 8c38a9b73..000000000
--- a/sci-libs/pytorch/files/get_third_parties
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-path_url() {
- local dir=$(dirname $1)/
- git config --file $1 --get-regexp '(path|url)' | sed -r -e "N;s,[^ ]* ([^ ]*)\n[^ ]* ([^ ]*),${dir#./}\1 \2,"
-}
-
-join \
- <(for gm in $(find . -name '.gitmodules' | sort -r); do path_url $gm; done | sort -u) \
- <(git submodule status --recursive | awk '{print $2 " " $1}' | sort -u) | \
-while read path url hash; do
- [[ ${path} =~ (eigen|six|ios|neon2sse|protobuf|pybind11|python-enum|tbb|zstd|fbjni) ]] && continue
- u=${url%.git}
- hfull=${hash#-}
- h=${hfull:0:8}
- p=$(basename $u)
- echo "${u}/archive/${h}.tar.gz -> ${p}-${h}.tar.gz" >> SRC_URI
- [[ $p = fbgemm ]] && p=${p^^}
- echo "rmdir ${path} && ln -sv \"\${WORKDIR}\"/${p}-${hfull} ${path}" >> src_prepare
-done
diff --git a/sci-libs/pytorch/files/pytorch-1.10.0-clhpp2.patch b/sci-libs/pytorch/files/pytorch-1.10.0-clhpp2.patch
deleted file mode 100644
index 9c267dc6e..000000000
--- a/sci-libs/pytorch/files/pytorch-1.10.0-clhpp2.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff --git a/caffe2/contrib/opencl/OpenCL/cl.hpp b/caffe2/contrib/opencl/OpenCL/cl.hpp
-index 87cc4a1..7c27e33 100644
---- a/caffe2/contrib/opencl/OpenCL/cl.hpp
-+++ b/caffe2/contrib/opencl/OpenCL/cl.hpp
-@@ -76,7 +76,7 @@
- * #if defined(__APPLE__) || defined(__MACOSX)
- * #include <OpenCL/cl.hpp>
- * #else
-- * #include <CL/cl.hpp>
-+ * #include <CL/cl2.hpp>
- * #endif
- * #include <cstdio>
- * #include <cstdlib>
-diff --git a/caffe2/contrib/opencl/context.h b/caffe2/contrib/opencl/context.h
-index b1e61c2..968d3c7 100644
---- a/caffe2/contrib/opencl/context.h
-+++ b/caffe2/contrib/opencl/context.h
-@@ -11,7 +11,7 @@
- #if defined(__APPLE__) || defined(__MACOSX)
- #include <OpenCL/cl.hpp>
- #else
--#include <CL/cl.hpp>
-+#include <CL/cl2.hpp>
- #endif
-
- #define OPENCL_CHECK(expr) (void)expr
-diff --git a/caffe2/mobile/contrib/libopencl-stub/include/CL/cl.hpp b/caffe2/mobile/contrib/libopencl-stub/include/CL/cl.hpp
-index f3badf7..928c9f0 100644
---- a/caffe2/mobile/contrib/libopencl-stub/include/CL/cl.hpp
-+++ b/caffe2/mobile/contrib/libopencl-stub/include/CL/cl.hpp
-@@ -76,7 +76,7 @@
- * #if defined(__APPLE__) || defined(__MACOSX)
- * #include <OpenCL/cl.hpp>
- * #else
-- * #include <CL/cl.hpp>
-+ * #include <CL/cl2.hpp>
- * #endif
- * #include <cstdio>
- * #include <cstdlib>
-diff --git a/third_party/tensorflow_cuda_bazel_build/cuda/BUILD b/third_party/tensorflow_cuda_bazel_build/cuda/BUILD
-index f7271af..334f4ec 100755
---- a/third_party/tensorflow_cuda_bazel_build/cuda/BUILD
-+++ b/third_party/tensorflow_cuda_bazel_build/cuda/BUILD
-@@ -188,7 +188,7 @@ CUDA_INCLUDES_FILES = [
- "include/CL/cl_gl_ext.h",
- "include/CL/cl_gl.h",
- "include/CL/cl.h",
-- "include/CL/cl.hpp",
-+ "include/CL/cl2.hpp",
- "include/CL/cl_platform.h",
- "include/CL/opencl.h",
- "include/common_functions.h",
diff --git a/sci-libs/pytorch/files/pytorch-1.10.0-fix-distutils.patch b/sci-libs/pytorch/files/pytorch-1.10.0-fix-distutils.patch
deleted file mode 100644
index 334bcda6f..000000000
--- a/sci-libs/pytorch/files/pytorch-1.10.0-fix-distutils.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-This fix distutils-r1_src_install failure with setuptools-59
-
-From 9af2edb158b3603c44eff6e12896f1d215e8b898 Mon Sep 17 00:00:00 2001
-From: Nikita Shulga <nshulga@fb.com>
-Date: Tue, 14 Dec 2021 07:15:34 -0800
-Subject: [PATCH] Properly import LooseVersion
-
-This fixes regression introduced by https://github.com/pytorch/pytorch/pull/57040
-
-Somehow importing `distutils` from `setuptool` caused import of
-`distutils.versions`, which is not a documented dependency and got
-change with the release of
-[setuptools-59.6.0](https://github.com/pypa/setuptools/tree/v59.6.0)
-We should not rely on that, as
-`import distutils` never re-imports `distutils.version`, which one can
-see by observing
-https://github.com/python/cpython/blob/3.9/Lib/distutils/__init__.py
-or by running:
-```
-% python3 -c "import distutils;print(distutils.__version__, dir(distutils))"
-3.7.5 ['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', 'sys']
-% python3 -c "from setuptools import distutils;print(distutils.__version__, dir(distutils))"
-3.7.5 ['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', 'archive_util', 'ccompiler', 'cmd', 'config', 'core', 'debug', 'dep_util', 'dir_util', 'dist', 'errors', 'extension', 'fancy_getopt', 'file_util', 'filelist', 'log', 'spawn', 'sys', 'sysconfig', 'util', 'version']
-```
----
- test/run_test.py | 4 ++--
- tools/setup_helpers/cmake.py | 8 ++++----
- torch/testing/_internal/common_methods_invocations.py | 8 ++++----
- 3 files changed, 10 insertions(+), 10 deletions(-)
-
-diff --git a/tools/setup_helpers/cmake.py b/tools/setup_helpers/cmake.py
-index 01e87b4bca879..686b5c4a34f4c 100644
---- a/tools/setup_helpers/cmake.py
-+++ b/tools/setup_helpers/cmake.py
-@@ -8,7 +8,7 @@
- from subprocess import check_call, check_output, CalledProcessError
- import sys
- import sysconfig
--from setuptools import distutils # type: ignore[import]
-+from distutils.version import LooseVersion
- from typing import IO, Any, Dict, List, Optional, Union, cast
-
- from . import which
-@@ -120,10 +120,10 @@ def _get_cmake_command() -> str:
- return cmake_command
- cmake3 = which('cmake3')
- cmake = which('cmake')
-- if cmake3 is not None and CMake._get_version(cmake3) >= distutils.version.LooseVersion("3.10.0"):
-+ if cmake3 is not None and CMake._get_version(cmake3) >= LooseVersion("3.10.0"):
- cmake_command = 'cmake3'
- return cmake_command
-- elif cmake is not None and CMake._get_version(cmake) >= distutils.version.LooseVersion("3.10.0"):
-+ elif cmake is not None and CMake._get_version(cmake) >= LooseVersion("3.10.0"):
- return cmake_command
- else:
- raise RuntimeError('no cmake or cmake3 with version >= 3.10.0 found')
-@@ -134,7 +134,7 @@ def _get_version(cmd: str) -> Any:
-
- for line in check_output([cmd, '--version']).decode('utf-8').split('\n'):
- if 'version' in line:
-- return distutils.version.LooseVersion(line.strip().split(' ')[2])
-+ return LooseVersion(line.strip().split(' ')[2])
- raise RuntimeError('no version found')
-
- def run(self, args: List[str], env: Dict[str, str]) -> None:
-diff --git a/torch/testing/_internal/common_methods_invocations.py b/torch/testing/_internal/common_methods_invocations.py
-index b66e6470b590c..6ec77c2b0ce2e 100644
---- a/torch/testing/_internal/common_methods_invocations.py
-+++ b/torch/testing/_internal/common_methods_invocations.py
-@@ -40,7 +40,7 @@
- freeze_rng_state)
- import torch.testing._internal.opinfo_helper as opinfo_helper
-
--from setuptools import distutils
-+from distutils.version import LooseVersion
-
- has_scipy_fft = False
- if TEST_SCIPY:
-@@ -14008,11 +14008,11 @@ def ref_pairwise_distance(input1, input2):
- skips=(
- # Reference: https://github.com/pytorch/pytorch/pull/49155#issuecomment-742664611
- DecorateInfo(unittest.skip("Skipped!"), 'TestUnaryUfuncs', 'test_reference_numerics_extremal',
-- active_if=TEST_SCIPY and distutils.version.LooseVersion(scipy.__version__) < "1.4.0"),
-+ active_if=TEST_SCIPY and LooseVersion(scipy.__version__) < "1.4.0"),
- DecorateInfo(unittest.skip("Skipped!"), 'TestUnaryUfuncs', 'test_reference_numerics_hard',
-- active_if=TEST_SCIPY and distutils.version.LooseVersion(scipy.__version__) < "1.4.0"),
-+ active_if=TEST_SCIPY and LooseVersion(scipy.__version__) < "1.4.0"),
- DecorateInfo(unittest.skip("Skipped!"), 'TestUnaryUfuncs', 'test_reference_numerics_normal',
-- active_if=TEST_SCIPY and distutils.version.LooseVersion(scipy.__version__) < "1.4.0"),
-+ active_if=TEST_SCIPY and LooseVersion(scipy.__version__) < "1.4.0"),
- )),
- UnaryUfuncInfo('lgamma',
- ref=reference_lgamma if TEST_SCIPY else _NOTHING,
diff --git a/sci-libs/pytorch/files/pytorch-1.10.0-nonull.patch b/sci-libs/pytorch/files/pytorch-1.10.0-nonull.patch
deleted file mode 100644
index adc258556..000000000
--- a/sci-libs/pytorch/files/pytorch-1.10.0-nonull.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/torch/csrc/jit/frontend/ir_emitter.cpp 2021-10-15 05:35:23.000000000 +0400
-+++ b/torch/csrc/jit/frontend/ir_emitter.cpp 2021-10-15 05:35:23.000000000 +0400
-@@ -1678,7 +1678,7 @@
- << "Union type annotation `" << type_hint->repr_str()
- << "` can hold " << vector_repr.str() << ", but none of "
- << "those list types can hold the types of the given dict"
-- << " elements, which were unified to " << candidate->repr_str();
-+ << " elements, which were unified";
- } else {
- refined_type_hint = candidate;
- }
-
diff --git a/sci-libs/pytorch/files/pytorch-1.10.1-nccl-nvccflags.patch b/sci-libs/pytorch/files/pytorch-1.10.1-nccl-nvccflags.patch
deleted file mode 100644
index 0ac12a1e7..000000000
--- a/sci-libs/pytorch/files/pytorch-1.10.1-nccl-nvccflags.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 7b04cd503fa1a6265893e0320ee246bcc0bd98cf Mon Sep 17 00:00:00 2001
-From: Miezhiko <Miezhiko@gmail.com>
-Date: Mon, 27 Dec 2021 14:48:12 +0400
-Subject: [PATCH] neutral flags
-
----
- makefiles/common.mk | 10 +---------
- 1 file changed, 1 insertion(+), 9 deletions(-)
-
-diff --git a/makefiles/common.mk b/makefiles/common.mk
-index 64f8d2dc6..7a979c90f 100644
---- a/makefiles/common.mk
-+++ b/makefiles/common.mk
-@@ -55,7 +55,7 @@ CXXFLAGS := -DCUDA_MAJOR=$(CUDA_MAJOR) -DCUDA_MINOR=$(CUDA_MINOR) -fPIC -fvisi
- # Maxrregcount needs to be set accordingly to NCCL_MAX_NTHREADS (otherwise it will cause kernel launch errors)
- # 512 : 120, 640 : 96, 768 : 80, 1024 : 60
- # We would not have to set this if we used __launch_bounds__, but this only works on kernels, not on functions.
--NVCUFLAGS := -ccbin $(CXX) $(NVCC_GENCODE) -std=c++11 --expt-extended-lambda -Xptxas -maxrregcount=96 -Xfatbin -compress-all
-+NVCUFLAGS := $(NVCCFLAGS) $(NVCC_GENCODE) -std=c++11 --expt-extended-lambda -Xptxas -maxrregcount=96 -Xfatbin -compress-all
- # Use addprefix so that we can specify more than one path
- NVLDFLAGS := -L${CUDA_LIB} -lcudart -lrt
-
-@@ -69,14 +69,6 @@ NVLDFLAGS += ${GCOV_FLAGS:%=-Xcompiler %}
- # $(warning GCOV_FLAGS=${GCOV_FLAGS})
- ########## GCOV ##########
-
--ifeq ($(DEBUG), 0)
--NVCUFLAGS += -O3
--CXXFLAGS += -O3 -g
--else
--NVCUFLAGS += -O0 -G -g
--CXXFLAGS += -O0 -g -ggdb3
--endif
--
- ifneq ($(VERBOSE), 0)
- NVCUFLAGS += -Xptxas -v -Xcompiler -Wall,-Wextra,-Wno-unused-parameter
- CXXFLAGS += -Wall -Wextra
diff --git a/sci-libs/pytorch/files/pytorch-1.2.0-setup.patch b/sci-libs/pytorch/files/pytorch-1.2.0-setup.patch
deleted file mode 100644
index 85e796a60..000000000
--- a/sci-libs/pytorch/files/pytorch-1.2.0-setup.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Index: pytorch-1.4.0_p0/setup.py
-===================================================================
---- pytorch-1.4.0_p0.orig/setup.py
-+++ pytorch-1.4.0_p0/setup.py
-@@ -288,9 +288,7 @@ def build_deps():
- sys.exit(1)
-
- check_file(os.path.join(third_party_path, "gloo", "CMakeLists.txt"))
-- check_file(os.path.join(third_party_path, "pybind11", "CMakeLists.txt"))
- check_file(os.path.join(third_party_path, 'cpuinfo', 'CMakeLists.txt'))
-- check_file(os.path.join(third_party_path, 'tbb', 'Makefile'))
- check_file(os.path.join(third_party_path, 'onnx', 'CMakeLists.txt'))
- check_file(os.path.join(third_party_path, 'foxi', 'CMakeLists.txt'))
- check_file(os.path.join(third_party_path, 'QNNPACK', 'CMakeLists.txt'))
-@@ -341,9 +339,6 @@ def build_deps():
- if not same:
- shutil.copyfile(orig_file, sym_file)
-
-- dir_util.copy_tree('third_party/pybind11/include/pybind11/',
-- 'torch/include/pybind11')
--
- ################################################################################
- # Building dependent libraries
- ################################################################################
diff --git a/sci-libs/pytorch/files/pytorch-1.4.0-nccl-nvccflags.patch b/sci-libs/pytorch/files/pytorch-1.4.0-nccl-nvccflags.patch
deleted file mode 100644
index 165e79dd4..000000000
--- a/sci-libs/pytorch/files/pytorch-1.4.0-nccl-nvccflags.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Index: nccl-7c72dee660e4d055b81721dd6b03e4e1c0a983cf/makefiles/common.mk
-===================================================================
---- nccl-7c72dee660e4d055b81721dd6b03e4e1c0a983cf.orig/makefiles/common.mk
-+++ nccl-7c72dee660e4d055b81721dd6b03e4e1c0a983cf/makefiles/common.mk
-@@ -46,7 +46,7 @@ endif
- CXXFLAGS := -DCUDA_MAJOR=$(CUDA_MAJOR) -DCUDA_MINOR=$(CUDA_MINOR) -fPIC -fvisibility=hidden
- CXXFLAGS += -Wall -Wno-unused-function -Wno-sign-compare -std=c++11 -Wvla
- CXXFLAGS += -I $(CUDA_INC)
--NVCUFLAGS := -ccbin $(CXX) $(NVCC_GENCODE) -lineinfo -std=c++11 -Xptxas -maxrregcount=96 -Xfatbin -compress-all
-+NVCUFLAGS := $(NVCCFLAGS) $(NVCC_GENCODE) -lineinfo -std=c++11 -Xptxas -maxrregcount=96 -Xfatbin -compress-all
- # Use addprefix so that we can specify more than one path
- NVLDFLAGS := -L${CUDA_LIB} -lcudart -lrt
-
-@@ -60,14 +60,6 @@ NVLDFLAGS += ${GCOV_FLAGS:%=-Xcompiler
- # $(warning GCOV_FLAGS=${GCOV_FLAGS})
- ########## GCOV ##########
-
--ifeq ($(DEBUG), 0)
--NVCUFLAGS += -O3
--CXXFLAGS += -O3 -g
--else
--NVCUFLAGS += -O0 -G -g
--CXXFLAGS += -O0 -g -ggdb3
--endif
--
- ifneq ($(VERBOSE), 0)
- NVCUFLAGS += -Xptxas -v -Xcompiler -Wall,-Wextra,-Wno-unused-parameter
- CXXFLAGS += -Wall -Wextra
diff --git a/sci-libs/pytorch/files/pytorch-1.4.0-skip-tests.patch b/sci-libs/pytorch/files/pytorch-1.4.0-skip-tests.patch
deleted file mode 100644
index 3682469d7..000000000
--- a/sci-libs/pytorch/files/pytorch-1.4.0-skip-tests.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Disable expected test failures.
-
-TCPStoreTest is too slow to run.
-
-Reference: https://github.com/pytorch/pytorch/issues/13746
-Reference: https://github.com/pytorch/pytorch/issues/21873
-
-Index: pytorch-1.4.0_p0/torch/lib/c10d/test/CMakeLists.txt
-===================================================================
---- pytorch-1.4.0_p0.orig/torch/lib/c10d/test/CMakeLists.txt
-+++ pytorch-1.4.0_p0/torch/lib/c10d/test/CMakeLists.txt
-@@ -14,7 +14,6 @@ function(c10d_add_test test_src)
- endfunction()
-
- c10d_add_test(FileStoreTest.cpp c10d)
--c10d_add_test(TCPStoreTest.cpp c10d)
-
- if(USE_CUDA)
- if(USE_C10D_GLOO)
-Index: pytorch-1.4.0_p0/caffe2/share/contrib/depthwise/CMakeLists.txt
-===================================================================
---- pytorch-1.4.0_p0.orig/caffe2/share/contrib/depthwise/CMakeLists.txt
-+++ pytorch-1.4.0_p0/caffe2/share/contrib/depthwise/CMakeLists.txt
-@@ -6,4 +6,3 @@ set(Caffe2_CONTRIB_DEPTHWISE3x3_TEST_CPU
- )
-
- set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS} ${Caffe2_CONTRIB_DEPTHWISE3x3_CPU_SRC} PARENT_SCOPE)
--set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${Caffe2_CONTRIB_DEPTHWISE3x3_TEST_CPU_SRC} PARENT_SCOPE)
diff --git a/sci-libs/pytorch/files/pytorch-1.4.0-sleef.patch b/sci-libs/pytorch/files/pytorch-1.4.0-sleef.patch
deleted file mode 100644
index 222a0f73e..000000000
--- a/sci-libs/pytorch/files/pytorch-1.4.0-sleef.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Give the location of sleef.h.
-
-Reference: https://github.com/pytorch/pytorch/issues/26555
-Index: pytorch-1.4.0/caffe2/CMakeLists.txt
-===================================================================
---- pytorch-1.4.0.orig/caffe2/CMakeLists.txt
-+++ pytorch-1.4.0/caffe2/CMakeLists.txt
-@@ -1062,6 +1062,7 @@ if (BUILD_TEST)
- add_executable(${test_name} "${test_src}")
- target_link_libraries(${test_name} ${Caffe2_MAIN_LIBS} gtest_main)
- target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-+ target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
- target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
- add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
- if (INSTALL_TEST)
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
deleted file mode 100644
index 1e9388ff1..000000000
--- a/sci-libs/pytorch/files/pytorch-1.6.0-global-dlopen.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-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.6.0-nccl-nvccflags.patch b/sci-libs/pytorch/files/pytorch-1.6.0-nccl-nvccflags.patch
deleted file mode 100644
index 052474ee4..000000000
--- a/sci-libs/pytorch/files/pytorch-1.6.0-nccl-nvccflags.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff -uprN nccl-5949d96f36d050e59d05872f8bbffd2549318e95/makefiles/common.mk nccl-patched/makefiles/common.mk
---- nccl-5949d96f36d050e59d05872f8bbffd2549318e95/makefiles/common.mk 2020-06-09 00:31:44.000000000 +0800
-+++ nccl-patched/makefiles/common.mk 2020-08-06 21:25:57.784279738 +0800
-@@ -54,7 +54,7 @@ CXXFLAGS := -DCUDA_MAJOR=$(CUDA_MAJOR)
- # Maxrregcount needs to be set accordingly to NCCL_MAX_NTHREADS (otherwise it will cause kernel launch errors)
- # 512 : 120, 640 : 96, 768 : 80, 1024 : 60
- # We would not have to set this if we used __launch_bounds__, but this only works on kernels, not on functions.
--NVCUFLAGS := -ccbin $(CXX) $(NVCC_GENCODE) -std=c++11 -Xptxas -maxrregcount=96 -Xfatbin -compress-all
-+NVCUFLAGS := $(NVCCFLAGS) $(NVCC_GENCODE) -std=c++11 -Xptxas -maxrregcount=96 -Xfatbin -compress-all
- # Use addprefix so that we can specify more than one path
- NVLDFLAGS := -L${CUDA_LIB} -lcudart -lrt
-
-@@ -68,14 +68,6 @@ NVLDFLAGS += ${GCOV_FLAGS:%=-Xcompiler
- # $(warning GCOV_FLAGS=${GCOV_FLAGS})
- ########## GCOV ##########
-
--ifeq ($(DEBUG), 0)
--NVCUFLAGS += -O3
--CXXFLAGS += -O3 -g
--else
--NVCUFLAGS += -O0 -G -g
--CXXFLAGS += -O0 -g -ggdb3
--endif
--
- ifneq ($(VERBOSE), 0)
- NVCUFLAGS += -Xptxas -v -Xcompiler -Wall,-Wextra,-Wno-unused-parameter
- CXXFLAGS += -Wall -Wextra
diff --git a/sci-libs/pytorch/files/pytorch-1.6.0-setup.patch b/sci-libs/pytorch/files/pytorch-1.6.0-setup.patch
deleted file mode 100644
index 6a197a907..000000000
--- a/sci-libs/pytorch/files/pytorch-1.6.0-setup.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Index: pytorch-1.4.0_p0/setup.py
-===================================================================
---- pytorch-1.4.0_p0.orig/setup.py
-+++ pytorch-1.4.0_p0/setup.py
-@@ -288,9 +288,7 @@ def build_deps():
- sys.exit(1)
-
- check_file(os.path.join(third_party_path, "gloo", "CMakeLists.txt"))
-- check_file(os.path.join(third_party_path, "pybind11", "CMakeLists.txt"))
- check_file(os.path.join(third_party_path, 'cpuinfo', 'CMakeLists.txt'))
-- check_file(os.path.join(third_party_path, 'tbb', 'Makefile'))
- check_file(os.path.join(third_party_path, 'onnx', 'CMakeLists.txt'))
- check_file(os.path.join(third_party_path, 'foxi', 'CMakeLists.txt'))
- check_file(os.path.join(third_party_path, 'QNNPACK', 'CMakeLists.txt'))
diff --git a/sci-libs/pytorch/files/pytorch-1.6.0-skip-tests.patch b/sci-libs/pytorch/files/pytorch-1.6.0-skip-tests.patch
deleted file mode 100644
index 3ef2c533f..000000000
--- a/sci-libs/pytorch/files/pytorch-1.6.0-skip-tests.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Disable expected test failures.
-
-Reference: https://github.com/pytorch/pytorch/issues/13746
-Reference: https://github.com/pytorch/pytorch/issues/21873
-
-Index: pytorch-1.4.0_p0/caffe2/share/contrib/depthwise/CMakeLists.txt
-===================================================================
---- pytorch-1.4.0_p0.orig/caffe2/share/contrib/depthwise/CMakeLists.txt
-+++ pytorch-1.4.0_p0/caffe2/share/contrib/depthwise/CMakeLists.txt
-@@ -6,4 +6,3 @@ set(Caffe2_CONTRIB_DEPTHWISE3x3_TEST_CPU
- )
-
- set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS} ${Caffe2_CONTRIB_DEPTHWISE3x3_CPU_SRC} PARENT_SCOPE)
--set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${Caffe2_CONTRIB_DEPTHWISE3x3_TEST_CPU_SRC} PARENT_SCOPE)
diff --git a/sci-libs/pytorch/files/pytorch-1.6.0-tensorpipe-unbundle-libuv.patch b/sci-libs/pytorch/files/pytorch-1.6.0-tensorpipe-unbundle-libuv.patch
deleted file mode 100644
index a4ba38322..000000000
--- a/sci-libs/pytorch/files/pytorch-1.6.0-tensorpipe-unbundle-libuv.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: tensorpipe/cmake/pytorch.cmake
-===================================================================
---- tensorpipe.orig/cmake/pytorch.cmake
-+++ tensorpipe/cmake/pytorch.cmake
-@@ -138,7 +138,7 @@ endif()
-
- add_library(tensorpipe ${TENSORPIPE_SRC})
-
--set(TP_BUILD_LIBUV ON)
-+set(TP_BUILD_LIBUV OFF)
- find_package(uv REQUIRED)
- target_link_libraries(tensorpipe PRIVATE uv::uv)
-
diff --git a/sci-libs/pytorch/files/pytorch-1.7.1-no-rpath.patch b/sci-libs/pytorch/files/pytorch-1.7.1-no-rpath.patch
deleted file mode 100644
index eabda092e..000000000
--- a/sci-libs/pytorch/files/pytorch-1.7.1-no-rpath.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index b3a892cf88..2c8622870c 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -4,7 +4,6 @@ if(APPLE)
- set(CMAKE_MACOSX_RPATH ON)
- set(_rpath_portable_origin "@loader_path")
- else()
-- set(_rpath_portable_origin $ORIGIN)
- endif(APPLE)
- # Use separate rpaths during build and install phases
- set(CMAKE_SKIP_BUILD_RPATH FALSE)
diff --git a/sci-libs/pytorch/files/pytorch-1.7.1-setup.patch b/sci-libs/pytorch/files/pytorch-1.7.1-setup.patch
deleted file mode 100644
index 28db5692c..000000000
--- a/sci-libs/pytorch/files/pytorch-1.7.1-setup.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 2db381644c..01a2e57aea 100644
---- a/setup.py
-+++ b/setup.py
-@@ -294,7 +294,6 @@ def build_deps():
-
- check_file(os.path.join(third_party_path, "gloo", "CMakeLists.txt"))
- check_file(os.path.join(third_party_path, 'cpuinfo', 'CMakeLists.txt'))
-- check_file(os.path.join(third_party_path, 'tbb', 'Makefile'))
- check_file(os.path.join(third_party_path, 'onnx', 'CMakeLists.txt'))
- check_file(os.path.join(third_party_path, 'foxi', 'CMakeLists.txt'))
- check_file(os.path.join(third_party_path, 'QNNPACK', 'CMakeLists.txt'))
diff --git a/sci-libs/pytorch/files/pytorch-1.7.1-tensorpipe-unbundle-libuv.patch b/sci-libs/pytorch/files/pytorch-1.7.1-tensorpipe-unbundle-libuv.patch
deleted file mode 100644
index 960ae3618..000000000
--- a/sci-libs/pytorch/files/pytorch-1.7.1-tensorpipe-unbundle-libuv.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index d1e4bdaed6..85821a78df 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -1308,7 +1308,6 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
- if(MSVC)
- message(WARNING "Tensorpipe cannot be used on Windows.")
- else()
-- set(TP_BUILD_LIBUV ON CACHE BOOL "" FORCE)
- set(TP_ENABLE_SHM OFF CACHE BOOL "" FORCE)
- set(TP_ENABLE_CMA OFF CACHE BOOL "" FORCE)
- set(TP_STATIC_OR_SHARED STATIC CACHE STRING "" FORCE)
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
deleted file mode 100644
index 44b27cac3..000000000
--- a/sci-libs/pytorch/files/pytorch-1.7.1-torch_shm_manager.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-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"@GENTOO_PORTAGE_EPREFIX@/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
deleted file mode 100644
index 214267487..000000000
--- a/sci-libs/pytorch/files/pytorch-1.9.0-Change-library-directory-according-to-CMake-build.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-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/files/pytorch-1.9.1-fix-wrong-hipify.patch b/sci-libs/pytorch/files/pytorch-1.9.1-fix-wrong-hipify.patch
deleted file mode 100644
index 4e37acd3f..000000000
--- a/sci-libs/pytorch/files/pytorch-1.9.1-fix-wrong-hipify.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-The hipify misadd a ) and causes compilation error
-
---- orig/aten/src/ATen/native/sparse/hip/SparseHIPTensor.hip
-+++ pytorch-1.9.1/aten/src/ATen/native/sparse/hip/SparseHIPTensor.hip
-@@ -282,7 +282,7 @@ Tensor sparse_mask_helper_cuda(
- mask_indices_ti,
- t_indices_pos_ti,
- t_values_ti,
-- r_values_ti);
-+ r_values_ti;
- C10_HIP_KERNEL_LAUNCH_CHECK();
- });
- }
diff --git a/sci-libs/pytorch/metadata.xml b/sci-libs/pytorch/metadata.xml
deleted file mode 100644
index df07ea4be..000000000
--- a/sci-libs/pytorch/metadata.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <maintainer type="person">
- <email>4ernov@gmail.com</email>
- <name>Alexey Chernov</name>
- </maintainer>
- <maintainer type="person">
- <email>heroxbd@gentoo.org</email>
- <name>Benda Xu</name>
- </maintainer>
- <use>
- <flag name="asan">Build with address sanitizer (ASAN)</flag>
- <flag name="cuda">Enable support for nVidia CUDA</flag>
- <flag name="fbgemm">Enable FBGEMM (Facebook GEneral Matrix Multiplication) support</flag>
- <flag name="gflags">Build with gflags</flag>
- <flag name="glog">Build with glog support</flag>
- <flag name="gloo">Build gloo distributed communication backend support</flag>
- <flag name="leveldb">Enable support for LevelDB</flag>
- <flag name="lmdb">Enable support for LMDB</flag>
- <flag name="mkldnn">Build with Intel MKL-DNN support</flag>
- <flag name="namedtensor">Enable support for named tensors</flag>
- <flag name="nnpack">Enable NNPACK support</flag>
- <flag name="numa">Enable support for NUMA</flag>
- <flag name="observers">Build observers</flag>
- <flag name="opencv">Enable support for OpenCV</flag>
- <flag name="opencl">Enable support for OpenCL</flag>
- <flag name="qnnpack">Enable QNNPACK support</flag>
- <flag name="redis">Enable support for Redis</flag>
- <flag name="rocm">Enable AMD ROCm</flag>
- <flag name="tools">Build binary tools</flag>
- <flag name="zeromq">Enable support for ZeroMQ</flag>
- </use>
-</pkgmetadata>
diff --git a/sci-libs/pytorch/pytorch-1.10.2.ebuild b/sci-libs/pytorch/pytorch-1.10.2.ebuild
deleted file mode 100644
index 8ba76f1bd..000000000
--- a/sci-libs/pytorch/pytorch-1.10.2.ebuild
+++ /dev/null
@@ -1,339 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_SETUPTOOLS=manual
-DISTUTILS_SINGLE_IMPL=1
-PYTHON_COMPAT=( python3_{8..10} )
-
-inherit cmake cuda distutils-r1 prefix
-
-DESCRIPTION="Tensors and Dynamic neural networks in Python with strong GPU acceleration"
-HOMEPAGE="https://pytorch.org/"
-SRC_URI="https://github.com/pytorch/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
-https://github.com/google/benchmark/archive/e991355c02b93fe17713efe04cbc2e278e00fdbd.tar.gz -> benchmark-e991355c02b93fe17713efe04cbc2e278e00fdbd.tar.gz
-https://github.com/pytorch/cpuinfo/archive/63b25457.tar.gz -> cpuinfo-63b25457.tar.gz
-https://github.com/NVlabs/cub/archive/d106ddb991a56c3df1b6d51b2409e36ba8181ce4.tar.gz -> cub-d106ddb991a56c3df1b6d51b2409e36ba8181ce4.tar.gz
-https://github.com/pytorch/fbgemm/archive/7588d9d804826b428fc0e4fd418e9cc3f7a72e52.tar.gz -> fbgemm-7588d9d804826b428fc0e4fd418e9cc3f7a72e52.tar.gz
-https://github.com/asmjit/asmjit/archive/d0d14ac774977d0060a351f66e35cb57ba0bf59c.tar.gz -> asmjit-d0d14ac774977d0060a351f66e35cb57ba0bf59c.tar.gz
-https://github.com/pytorch/cpuinfo/archive/5916273f79a21551890fd3d56fc5375a78d1598d.tar.gz -> cpuinfo-5916273f79a21551890fd3d56fc5375a78d1598d.tar.gz
-https://github.com/google/googletest/archive/0fc5466d.tar.gz -> googletest-0fc5466d.tar.gz
-https://github.com/fmtlib/fmt/archive/cd4af11efc9c622896a3e4cb599fa28668ca3d05.tar.gz -> fmt-cd4af11efc9c622896a3e4cb599fa28668ca3d05.tar.gz
-https://github.com/houseroad/foxi/archive/c278588e34e535f0bb8f00df3880d26928038cad.tar.gz -> foxi-c278588e34e535f0bb8f00df3880d26928038cad.tar.gz
-https://github.com/Maratyszcza/FP16/archive/4dfe081cf6bcd15db339cf2680b9281b8451eeb3.tar.gz -> FP16-4dfe081cf6bcd15db339cf2680b9281b8451eeb3.tar.gz
-https://github.com/Maratyszcza/FXdiv/archive/b408327ac2a15ec3e43352421954f5b1967701d1.tar.gz -> FXdiv-b408327ac2a15ec3e43352421954f5b1967701d1.tar.gz
-https://github.com/google/gemmlowp/archive/3fb5c176.tar.gz -> gemmlowp-3fb5c176.tar.gz
-https://github.com/facebookincubator/gloo/archive/c22a5cfba94edf8ea4f53a174d38aa0c629d070f.tar.gz -> gloo-c22a5cfba94edf8ea4f53a174d38aa0c629d070f.tar.gz
-https://github.com/google/googletest/archive/e2239ee6043f73722e7aa812a459f54a28552929.tar.gz -> googletest-e2239ee6043f73722e7aa812a459f54a28552929.tar.gz
-https://github.com/intel/ideep/archive/9ca27bbfd88fa1469cbf0467bd6f14cd1738fa40.tar.gz -> ideep-9ca27bbfd88fa1469cbf0467bd6f14cd1738fa40.tar.gz
-https://github.com/intel/mkl-dnn/archive/5ef631a0.tar.gz -> mkl-dnn-5ef631a0.tar.gz
-cuda? ( https://github.com/NVIDIA/nccl/archive/c5790b36722d5b41ee2a9b2bad69e364180ffd22.tar.gz -> nccl-c5790b36722d5b41ee2a9b2bad69e364180ffd22.tar.gz )
-https://github.com/Maratyszcza/NNPACK/archive/c07e3a0400713d546e0dea2d5466dd22ea389c73.tar.gz -> NNPACK-c07e3a0400713d546e0dea2d5466dd22ea389c73.tar.gz
-https://github.com/onnx/onnx/archive/a82c6a70.tar.gz -> onnx-a82c6a70.tar.gz
-https://github.com/onnx/onnx-tensorrt/archive/c153211418a7c57ce071d9ce2a41f8d1c85a878f.tar.gz -> onnx-tensorrt-c153211418a7c57ce071d9ce2a41f8d1c85a878f.tar.gz
-https://github.com/onnx/onnx/archive/29e7aa7048809784465d06e897f043a4600642b2.tar.gz -> onnx-29e7aa7048809784465d06e897f043a4600642b2.tar.gz
-https://github.com/google/benchmark/archive/e776aa02.tar.gz -> benchmark-e776aa02.tar.gz
-https://github.com/google/benchmark/archive/5b7683f4.tar.gz -> benchmark-5b7683f4.tar.gz
-https://github.com/google/googletest/archive/5ec7f0c4.tar.gz -> googletest-5ec7f0c4.tar.gz
-https://github.com/Maratyszcza/psimd/archive/072586a71b55b7f8c584153d223e95687148a90.tar.gz -> psimd-072586a71b55b7f8c584153d223e95687148a90.tar.gz
-https://github.com/Maratyszcza/pthreadpool/archive/a134dd5d4cee80cce15db81a72e7f929d71dd413.tar.gz -> pthreadpool-a134dd5d4cee80cce15db81a72e7f929d71dd413.tar.gz
-https://github.com/Maratyszcza/PeachPy/archive/07d8fde8ac45d7705129475c0f94ed8925b93473.tar.gz -> PeachPy-07d8fde8ac45d7705129475c0f94ed8925b93473.tar.gz
-https://github.com/pytorch/QNNPACK/archive/7d2a4e9931a82adc3814275b6219a03e24e36b4c.tar.gz -> QNNPACK-7d2a4e9931a82adc3814275b6219a03e24e36b4c.tar.gz
-https://github.com/shibatch/sleef/archive/e0a003ee838b75d11763aa9c3ef17bf71a725bff.tar.gz -> sleef-e0a003ee838b75d11763aa9c3ef17bf71a725bff.tar.gz
-https://github.com/pytorch/tensorpipe/archive/d2aa3485e8229c98891dfd604b514a39d45a5c99.tar.gz -> tensorpipe-d2aa3485e8229c98891dfd604b514a39d45a5c99.tar.gz
-https://github.com/google/googletest/archive/2fe3bd99.tar.gz -> googletest-2fe3bd99.tar.gz
-https://github.com/google/libnop/archive/aa95422e.tar.gz -> libnop-aa95422e.tar.gz
-https://github.com/libuv/libuv/archive/48e04275332f5753427d21a52f17ec6206451f2c.tar.gz -> libuv-48e04275332f5753427d21a52f17ec6206451f2c.tar.gz
-https://github.com/google/XNNPACK/archive/79cd5f9e18ad0925ac9a050b00ea5a36230072db.tar.gz -> XNNPACK-79cd5f9e18ad0925ac9a050b00ea5a36230072db.tar.gz
-https://github.com/pytorch/kineto/archive/879a203d9bf554e95541679ddad6e0326f272dc1.tar.gz -> kineto-879a203d9bf554e95541679ddad6e0326f272dc1.tar.gz
-https://github.com/driazati/breakpad/archive/edbb99f95c75be27d038fffb1d969cdacf705db2.tar.gz -> breakpad-edbb99f95c75be27d038fffb1d969cdacf705db2.tar.gz
-https://github.com/mikey/linux-syscall-support/archive/e1e7b0ad8ee99a875b272c8e33e308472e897660.tar.gz -> lss-e1e7b0ad8ee99a875b272c8e33e308472e897660.tar.gz
-"
-
-# git clone git@github.com:pytorch/pytorch.git && cd pytorch
-# git submodules update --init --recursive
-# ${FILESDIR}/get_third_paries
-# cat SRC_URI src_prepare
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64"
-
-IUSE="asan blas cuda +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkldnn mpi namedtensor +nnpack numa +observers opencl opencv +openmp +python +qnnpack redis rocm static tools zeromq"
-REQUIRED_USE=" ?? ( cuda rocm )"
-
-RDEPEND="
- $(python_gen_cond_dep '
- dev-python/pyyaml[${PYTHON_USEDEP}]
- ')
- blas? ( virtual/blas )
- cuda? ( dev-libs/cudnn
- dev-cpp/eigen[cuda] )
- rocm? ( >=dev-util/hip-4.3
- >=dev-libs/rccl-4.3
- >=sci-libs/rocThrust-4.3
- >=sci-libs/hipCUB-4.3
- >=sci-libs/rocPRIM-4.3
- >=sci-libs/miopen-4.3
- >=sci-libs/rocBLAS-4.3
- >=sci-libs/rocRAND-4.3
- >=sci-libs/hipSPARSE-4.3
- >=sci-libs/rocFFT-4.3
- >=dev-util/roctracer-4.3 )
- ffmpeg? ( media-video/ffmpeg )
- gflags? ( dev-cpp/gflags )
- glog? ( dev-cpp/glog[gflags] )
- leveldb? ( dev-libs/leveldb )
- lmdb? ( dev-db/lmdb )
- mpi? ( virtual/mpi )
- opencl? ( dev-libs/clhpp )
- opencv? ( media-libs/opencv )
- python? ( ${PYTHON_DEPS}
- $(python_gen_cond_dep '
- dev-python/setuptools[${PYTHON_USEDEP}]
- dev-python/pybind11[${PYTHON_USEDEP}]
- dev-python/numpy[${PYTHON_USEDEP}]
- dev-python/protobuf-python:=[${PYTHON_USEDEP}]
- ')
- )
- redis? ( dev-db/redis )
- zeromq? ( net-libs/zeromq )
- dev-cpp/eigen
- dev-libs/protobuf:=
- dev-libs/libuv
-"
-
-#ATen code generation
-BDEPEND="dev-python/pyyaml"
-
-DEPEND="${RDEPEND}
- dev-cpp/tbb
- app-arch/zstd
- $(python_gen_cond_dep '
- dev-python/pybind11[${PYTHON_USEDEP}]
- dev-python/typing-extensions[${PYTHON_USEDEP}]
- ')
- sys-cluster/rdma-core
- sys-process/numactl
-"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-1.9.0-Change-library-directory-according-to-CMake-build.patch
- "${FILESDIR}"/${PN}-1.6.0-global-dlopen.patch
- "${FILESDIR}"/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch
- "${FILESDIR}"/${PN}-1.7.1-no-rpath.patch
- "${FILESDIR}"/${PN}-1.7.1-torch_shm_manager.patch
- "${FILESDIR}"/${PN}-1.10.0-nonull.patch
- "${FILESDIR}"/${PN}-1.10.0-fix-distutils.patch
- "${FILESDIR}"/${PN}-1.10.0-clhpp2.patch
-)
-
-distutils_enable_tests --install pytest
-
-src_prepare() {
- cmake_src_prepare
- eprefixify torch/__init__.py
-
- rmdir third_party/benchmark || die
- ln -sv "${WORKDIR}"/benchmark-e991355c02b93fe17713efe04cbc2e278e00fdbd third_party/benchmark || die
- rmdir third_party/cpuinfo || die
- ln -sv "${WORKDIR}"/cpuinfo-5916273f79a21551890fd3d56fc5375a78d1598d third_party/cpuinfo || die
- rmdir third_party/cub || die
- ln -sv "${WORKDIR}"/cub-d106ddb991a56c3df1b6d51b2409e36ba8181ce4 third_party/cub || die
- rmdir third_party/fbgemm || die
- ln -sv "${WORKDIR}"/FBGEMM-7588d9d804826b428fc0e4fd418e9cc3f7a72e52 third_party/fbgemm || die
- rmdir third_party/fbgemm/third_party/asmjit || die
- ln -sv "${WORKDIR}"/asmjit-d0d14ac774977d0060a351f66e35cb57ba0bf59c third_party/fbgemm/third_party/asmjit || die
- rmdir third_party/fbgemm/third_party/cpuinfo || die
- ln -sv "${WORKDIR}"/cpuinfo-d5e37adf1406cf899d7d9ec1d317c47506ccb970 third_party/fbgemm/third_party/cpuinfo || die
- rmdir third_party/fbgemm/third_party/googletest || die
- ln -sv "${WORKDIR}"/googletest-0fc5466dbb9e623029b1ada539717d10bd45e99e third_party/fbgemm/third_party/googletest || die
- rmdir third_party/fmt || die
- ln -sv "${WORKDIR}"/fmt-cd4af11efc9c622896a3e4cb599fa28668ca3d05 third_party/fmt || die
- rmdir third_party/foxi || die
- ln -sv "${WORKDIR}"/foxi-c278588e34e535f0bb8f00df3880d26928038cad third_party/foxi || die
- rmdir third_party/FP16 || die
- ln -sv "${WORKDIR}"/FP16-4dfe081cf6bcd15db339cf2680b9281b8451eeb3 third_party/FP16 || die
- rmdir third_party/FXdiv
- ln -sv "${WORKDIR}"/FXdiv-b408327ac2a15ec3e43352421954f5b1967701d1 third_party/FXdiv || die
- rmdir third_party/gemmlowp/gemmlowp || die
- ln -sv "${WORKDIR}"/gemmlowp-3fb5c176c17c765a3492cd2f0321b0dab712f350 third_party/gemmlowp/gemmlowp || die
- rmdir third_party/gloo || die
- ln -sv "${WORKDIR}"/gloo-c22a5cfba94edf8ea4f53a174d38aa0c629d070f third_party/gloo || die
- rmdir third_party/googletest || die
- ln -sv "${WORKDIR}"/googletest-e2239ee6043f73722e7aa812a459f54a28552929 third_party/googletest || die
- rmdir third_party/ideep || die
- ln -sv "${WORKDIR}"/ideep-9ca27bbfd88fa1469cbf0467bd6f14cd1738fa40 third_party/ideep || die
- rmdir third_party/ideep/mkl-dnn || die
- ln -sv "${WORKDIR}"/mkl-dnn-5ef631a030a6f73131c77892041042805a06064f third_party/ideep/mkl-dnn || die
- rmdir third_party/nccl/nccl || die
- ln -sv "${WORKDIR}"/nccl-c5790b36722d5b41ee2a9b2bad69e364180ffd22 third_party/nccl/nccl || die
- rmdir third_party/NNPACK || die
- ln -sv "${WORKDIR}"/NNPACK-c07e3a0400713d546e0dea2d5466dd22ea389c73 third_party/NNPACK || die
- rmdir third_party/onnx || die
- ln -sv "${WORKDIR}"/onnx-29e7aa7048809784465d06e897f043a4600642b2 third_party/onnx || die
- rmdir third_party/onnx-tensorrt || die
- ln -sv "${WORKDIR}"/onnx-tensorrt-c153211418a7c57ce071d9ce2a41f8d1c85a878f third_party/onnx-tensorrt || die
- rmdir third_party/onnx-tensorrt/third_party/onnx || die
- ln -sv "${WORKDIR}"/onnx-765f5ee823a67a866f4bd28a9860e81f3c811ce8 third_party/onnx-tensorrt/third_party/onnx || die
- rmdir third_party/onnx/third_party/benchmark || die
- ln -sv "${WORKDIR}"/benchmark-e776aa0275e293707b6a0901e0e8d8a8a3679508 third_party/onnx/third_party/benchmark || die
- rmdir third_party/psimd || die
- ln -sv "${WORKDIR}"/psimd-072586a71b55b7f8c584153d223e95687148a900 third_party/psimd || die
- rmdir third_party/pthreadpool || die
- ln -sv "${WORKDIR}"/pthreadpool-a134dd5d4cee80cce15db81a72e7f929d71dd413 third_party/pthreadpool || die
- rmdir third_party/python-peachpy || die
- ln -sv "${WORKDIR}"/PeachPy-07d8fde8ac45d7705129475c0f94ed8925b93473 third_party/python-peachpy || die
- rmdir third_party/QNNPACK || die
- ln -sv "${WORKDIR}"/QNNPACK-7d2a4e9931a82adc3814275b6219a03e24e36b4c third_party/QNNPACK || die
- rmdir third_party/sleef || die
- ln -sv "${WORKDIR}"/sleef-e0a003ee838b75d11763aa9c3ef17bf71a725bff third_party/sleef || die
- rmdir third_party/tensorpipe || die
- ln -sv "${WORKDIR}"/tensorpipe-d2aa3485e8229c98891dfd604b514a39d45a5c99 third_party/tensorpipe || die
- rmdir third_party/tensorpipe/third_party/googletest || die
- ln -sv "${WORKDIR}"/googletest-2fe3bd994b3189899d93f1d5a881e725e046fdc2 third_party/tensorpipe/third_party/googletest || die
- rmdir third_party/tensorpipe/third_party/libnop || die
- ln -sv "${WORKDIR}"/libnop-aa95422ea8c409e3f078d2ee7708a5f59a8b9fa2 third_party/tensorpipe/third_party/libnop || die
- rmdir third_party/tensorpipe/third_party/libuv || die
- ln -sv "${WORKDIR}"/libuv-48e04275332f5753427d21a52f17ec6206451f2c third_party/tensorpipe/third_party/libuv || die
- rmdir third_party/XNNPACK || die
- ln -sv "${WORKDIR}"/XNNPACK-79cd5f9e18ad0925ac9a050b00ea5a36230072db third_party/XNNPACK || die
- rmdir third_party/kineto || die
- ln -sv "${WORKDIR}"/kineto-879a203d9bf554e95541679ddad6e0326f272dc1 third_party/kineto || die
- rmdir third_party/breakpad || die
- ln -sv "${WORKDIR}"/breakpad-edbb99f95c75be27d038fffb1d969cdacf705db2 third_party/breakpad || die
- rmdir third_party/breakpad/src/third_party/lss || die
- ln -sv "${WORKDIR}"/linux-syscall-support-e1e7b0ad8ee99a875b272c8e33e308472e897660 third_party/breakpad/src/third_party/lss || die
-
- if use cuda; then
- cd third_party/nccl/nccl || die
- eapply "${FILESDIR}"/${PN}-1.10.1-nccl-nvccflags.patch
- cuda_src_prepare
- export CUDAHOSTCXX=$(cuda_gccdir)/g++
- cd "${S}"
- fi
-
- if use rocm; then
- #Allow escaping sandbox
- addread /dev/kfd
- addread /dev/dri
- addpredict /dev/kfd
- addpredict /dev/dri
-
- ebegin "HIPifying cuda sources"
- ${EPYTHON} tools/amd_build/build_amd.py || die
- eapply "${FILESDIR}"/${PN}-1.9.1-fix-wrong-hipify.patch
- eend $?
-
- local ROCM_VERSION="$(hipconfig -v)-"
- export PYTORCH_ROCM_ARCH="${AMDGPU_TARGETS}"
- sed -e "/set(roctracer_INCLUDE_DIRS/s,\${ROCTRACER_PATH}/include,${EPREFIX}/usr/include/roctracer," \
- -e "/PYTORCH_HIP_HCC_LIBRARIES/s,\${HIP_PATH}/lib,${EPREFIX}/usr/lib/hip/lib," \
- -e "/set(roctracer_INCLUDE_DIRS/a\ set(thrust_INCLUDE_DIRS ${EPREFIX}/usr/include/rocthrust)" \
- -e "s,\${ROCTRACER_PATH}/lib,${EPREFIX}/usr/lib64/roctracer," \
- -e "/READ.*\.info\/version-dev/c\ set(ROCM_VERSION_DEV_RAW ${ROCM_VERSION})" \
- -i cmake/public/LoadHIP.cmake || die
- sed -r -e '/^if\(USE_ROCM/{:a;N;/\nendif/!ba; s,\{([^\{]*)_PATH\}(/include)?,\{\L\1_\UINCLUDE_DIRS\},g}' -i cmake/Dependencies.cmake || die
- fi
-
- # Set build dir for pytorch's setup
- sed -e "/BUILD_DIR/s,build,${BUILD_DIR}," -i tools/setup_helpers/env.py || die
-}
-
-src_configure() {
- local mycmakeargs=(
- -DWERROR=OFF
- -DTORCH_BUILD_VERSION=${PV}
- -DTORCH_INSTALL_LIB_DIR=$(get_libdir)
- -DBUILD_BINARY=$(usex tools ON OFF)
- -DBUILD_CUSTOM_PROTOBUF=OFF
- -DBUILD_PYTHON=$(usex python ON OFF)
- -DBUILD_SHARED_LIBS=$(usex static OFF ON)
- -DBUILD_TEST=$(usex test ON OFF)
- -DUSE_ASAN=$(usex asan ON OFF)
- -DUSE_CUDA=$(usex cuda ON OFF)
- -DUSE_NCCL=$(usex cuda ON OFF)
- -DUSE_SYSTEM_NCCL=OFF
- -DUSE_ROCM=$(usex rocm ON OFF)
- -DUSE_FBGEMM=$(usex fbgemm ON OFF)
- -DUSE_FFMPEG=$(usex ffmpeg ON OFF)
- -DUSE_GFLAGS=$(usex gflags ON OFF)
- -DUSE_GLOG=$(usex glog ON OFF)
- -DUSE_LEVELDB=$(usex leveldb ON OFF)
- -DUSE_LITE_PROTO=OFF
- -DUSE_LMDB=$(usex lmdb ON OFF)
- -DUSE_MKLDNN=$(usex mkldnn ON OFF)
- -DUSE_MKLDNN_CBLAS=OFF
- -DUSE_NNPACK=$(usex nnpack ON OFF)
- -DUSE_NUMPY=$(usex python ON OFF)
- -DUSE_NUMA=$(usex numa ON OFF)
- -DUSE_OBSERVERS=$(usex observers ON OFF)
- -DUSE_OPENCL=$(usex opencl ON OFF)
- -DUSE_OPENCV=$(usex opencv ON OFF)
- -DUSE_OPENMP=$(usex openmp ON OFF)
- -DUSE_TBB=OFF
- -DUSE_PROF=OFF
- -DUSE_QNNPACK=$(usex qnnpack ON OFF)
- -DUSE_REDIS=$(usex redis ON OFF)
- -DUSE_ROCKSDB=OFF
- -DUSE_ZMQ=$(usex zeromq ON OFF)
- -DUSE_MPI=$(usex mpi ON OFF)
- -DUSE_GLOO=$(usex gloo ON OFF)
- -DUSE_SYSTEM_EIGEN_INSTALL=ON
- -DUSE_SYSTEM_PYBIND11=ON
- -DBLAS=$(usex blas Generic Eigen)
- -DTP_BUILD_LIBUV=OFF
- -Wno-dev
- )
-
- HIP_PATH="${EPREFIX}/usr/lib/hip" cmake_src_configure
-
- if use python; then
- CMAKE_BUILD_DIR="${BUILD_DIR}" distutils-r1_src_configure
- fi
-
- # do not rerun cmake and the build process in src_install
- sed '/RERUN/,+1d' -i "${BUILD_DIR}"/build.ninja || die
-}
-
-src_compile() {
- cmake_src_compile
-
- if use python; then
- USE_SYSTEM_LIBS=ON CMAKE_BUILD_DIR=${BUILD_DIR} distutils-r1_src_compile
- fi
-}
-
-src_install() {
- cmake_src_install
-
- local LIB=$(get_libdir)
- if [[ ${LIB} != lib ]]; then
- mv -fv "${ED}"/usr/lib/*.so "${ED}"/usr/${LIB}/ || die
- fi
-
- rm -r "${ED}/usr/lib" || die
-
- rm -r "${ED}/usr/include/asmjit" || die
- rm -r "${ED}/usr/include/c10d" || die
- rm -r "${ED}/usr/include/fbgemm" || die
- rm -r "${ED}/usr/include/fp16" || die
- rm -r "${ED}/usr/include/gloo" || die
-
- if use python; then
- scanelf -r --fix "${BUILD_DIR}/caffe2/python" || die
- USE_SYSTEM_LIBS=ON CMAKE_BUILD_DIR=${BUILD_DIR} distutils-r1_src_install
-
- python_optimize
- fi
-
- find "${ED}/usr/${LIB}" -name "*.a" -exec rm -fv {} \; || die
-
- if use test; then
- rm -r "${ED}/usr/test" "${ED}"/usr/bin/test_{api,jit} || die
- fi
-
- # Remove the empty directories by CMake Python:
- find "${ED}" -type d -empty -delete || die
-}
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-07-03 8:37 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-30 15:39 [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/ Andrew Ammerlaan
-- strict thread matches above, loose matches on Subject: below --
2022-07-03 8:37 Andrew Ammerlaan
2021-12-27 11:50 Andrew Ammerlaan
2021-12-26 14:12 Andrew Ammerlaan
2021-12-26 13:38 Benda XU
2021-12-22 14:33 Andrew Ammerlaan
2021-01-24 13:38 Benda XU
2020-08-11 13:44 Benda XU
2020-08-07 12:56 Benda XU
2020-08-06 1:10 Benda XU
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox