summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Tupone <tupone@gentoo.org>2023-05-05 22:19:16 +0200
committerAlfredo Tupone <tupone@gentoo.org>2023-05-06 19:27:39 +0200
commitd8ee6c1a21bd0be7cc254b7539f544083347c34c (patch)
tree06ee426d8f5298fb4b57177e5fa64c2d36f0437e /sci-libs
parentdev-python/pylint: add 2.17.4 (diff)
downloadgentoo-d8ee6c1a21bd0be7cc254b7539f544083347c34c.tar.gz
gentoo-d8ee6c1a21bd0be7cc254b7539f544083347c34c.tar.bz2
gentoo-d8ee6c1a21bd0be7cc254b7539f544083347c34c.zip
sci-libs/caffe2: fix fbgemm use and add gloo
Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
Diffstat (limited to 'sci-libs')
-rw-r--r--sci-libs/caffe2/caffe2-1.13.1-r5.ebuild (renamed from sci-libs/caffe2/caffe2-1.13.1-r4.ebuild)13
-rw-r--r--sci-libs/caffe2/caffe2-2.0.0-r3.ebuild (renamed from sci-libs/caffe2/caffe2-2.0.0-r2.ebuild)10
-rw-r--r--sci-libs/caffe2/files/caffe2-1.13.0-gentoo.patch61
-rw-r--r--sci-libs/caffe2/files/caffe2-2.0.0-gentoo.patch61
-rw-r--r--sci-libs/caffe2/metadata.xml1
5 files changed, 95 insertions, 51 deletions
diff --git a/sci-libs/caffe2/caffe2-1.13.1-r4.ebuild b/sci-libs/caffe2/caffe2-1.13.1-r5.ebuild
index efb497856e53..7fc257acd3ab 100644
--- a/sci-libs/caffe2/caffe2-1.13.1-r4.ebuild
+++ b/sci-libs/caffe2/caffe2-1.13.1-r5.ebuild
@@ -17,13 +17,14 @@ SRC_URI="https://github.com/pytorch/${MYPN}/archive/refs/tags/v${PV}.tar.gz
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
-IUSE="cuda distributed ffmpeg mpi nnpack +numpy opencl opencv openmp qnnpack tensorpipe xnnpack"
+IUSE="cuda distributed fbgemm ffmpeg gloo mpi nnpack +numpy opencl opencv openmp qnnpack tensorpipe xnnpack"
RESTRICT="test"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
ffmpeg? ( opencv )
mpi? ( distributed )
tensorpipe? ( distributed )
+ gloo? ( distributed )
" # ?? ( cuda rocm )
# CUDA 12 not supported yet: https://github.com/pytorch/pytorch/issues/91122
@@ -44,7 +45,9 @@ RDEPEND="
dev-libs/cudnn-frontend:0/8
<dev-util/nvidia-cuda-toolkit-12:=[profiler]
)
+ fbgemm? ( dev-libs/FBGEMM )
ffmpeg? ( media-video/ffmpeg:= )
+ gloo? ( sci-libs/gloo )
mpi? ( sys-cluster/openmpi )
nnpack? ( sci-libs/NNPACK )
numpy? ( $(python_gen_cond_dep '
@@ -84,6 +87,10 @@ PATCHES=(
src_prepare() {
filter-lto #bug 862672
+ sed -i \
+ -e "/third_party\/gloo/d" \
+ cmake/Dependencies.cmake \
+ || die
cmake_src_prepare
pushd torch/csrc/jit/serialization || die
flatc --cpp --gen-mutable --scoped-enums mobile_bytecode.fbs || die
@@ -116,11 +123,11 @@ src_configure() {
-DUSE_DISTRIBUTED=$(usex distributed)
-DUSE_MPI=$(usex mpi)
-DUSE_FAKELOWP=OFF
- -DUSE_FBGEMM=OFF # TODO
+ -DUSE_FBGEMM=$(usex fbgemm)
-DUSE_FFMPEG=$(usex ffmpeg)
-DUSE_GFLAGS=ON
-DUSE_GLOG=ON
- -DUSE_GLOO=OFF
+ -DUSE_GLOO=$(usex gloo)
-DUSE_KINETO=OFF # TODO
-DUSE_LEVELDB=OFF
-DUSE_MAGMA=OFF # TODO: In GURU as sci-libs/magma
diff --git a/sci-libs/caffe2/caffe2-2.0.0-r2.ebuild b/sci-libs/caffe2/caffe2-2.0.0-r3.ebuild
index 7667c7bbee17..42b8dae69229 100644
--- a/sci-libs/caffe2/caffe2-2.0.0-r2.ebuild
+++ b/sci-libs/caffe2/caffe2-2.0.0-r3.ebuild
@@ -17,13 +17,14 @@ SRC_URI="https://github.com/pytorch/${MYPN}/archive/refs/tags/v${PV}.tar.gz
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
-IUSE="cuda distributed fbgemm ffmpeg mpi nnpack +numpy opencl opencv openmp qnnpack tensorpipe xnnpack"
+IUSE="cuda distributed fbgemm ffmpeg gloo mpi nnpack +numpy opencl opencv openmp qnnpack tensorpipe xnnpack"
RESTRICT="test"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
ffmpeg? ( opencv )
mpi? ( distributed )
tensorpipe? ( distributed )
+ gloo? ( distributed )
" # ?? ( cuda rocm )
# CUDA 12 not supported yet: https://github.com/pytorch/pytorch/issues/91122
@@ -46,6 +47,7 @@ RDEPEND="
)
fbgemm? ( dev-libs/FBGEMM )
ffmpeg? ( media-video/ffmpeg:= )
+ gloo? ( sci-libs/gloo )
mpi? ( sys-cluster/openmpi )
nnpack? ( sci-libs/NNPACK )
numpy? ( $(python_gen_cond_dep '
@@ -86,6 +88,10 @@ PATCHES=(
src_prepare() {
filter-lto #bug 862672
+ sed -i \
+ -e "/third_party\/gloo/d" \
+ cmake/Dependencies.cmake \
+ || die
cmake_src_prepare
pushd torch/csrc/jit/serialization || die
flatc --cpp --gen-mutable --scoped-enums mobile_bytecode.fbs || die
@@ -123,7 +129,7 @@ src_configure() {
-DUSE_FFMPEG=$(usex ffmpeg)
-DUSE_GFLAGS=ON
-DUSE_GLOG=ON
- -DUSE_GLOO=OFF
+ -DUSE_GLOO=$(usex gloo)
-DUSE_KINETO=OFF # TODO
-DUSE_LEVELDB=OFF
-DUSE_MAGMA=OFF # TODO: In GURU as sci-libs/magma
diff --git a/sci-libs/caffe2/files/caffe2-1.13.0-gentoo.patch b/sci-libs/caffe2/files/caffe2-1.13.0-gentoo.patch
index a2771e3319d8..f72d44f475fa 100644
--- a/sci-libs/caffe2/files/caffe2-1.13.0-gentoo.patch
+++ b/sci-libs/caffe2/files/caffe2-1.13.0-gentoo.patch
@@ -1,6 +1,41 @@
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
-@@ -1557,7 +1557,6 @@
+@@ -481,7 +481,7 @@ endif()
+ list(APPEND Caffe2_DEPENDENCY_LIBS cpuinfo)
+
+ # ---[ QNNPACK
+-if(USE_QNNPACK)
++if(FALSE)
+ set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
+
+ if(NOT DEFINED QNNPACK_SOURCE_DIR)
+@@ -537,7 +537,7 @@ if(USE_QNNPACK)
+ endif()
+
+ # ---[ Caffe2 Int8 operators (enabled by USE_QNNPACK) depend on gemmlowp and neon2sse headers
+-if(USE_QNNPACK)
++if(FALSE)
+ set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
+ include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/gemmlowp")
+ include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/neon2sse")
+@@ -789,7 +789,7 @@
+ endif()
+
+ # ---[ FBGEMM
+-if(USE_FBGEMM)
++if(FALSE)
+ set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
+ if(NOT DEFINED FBGEMM_SOURCE_DIR)
+ set(FBGEMM_SOURCE_DIR "${CAFFE2_THIRD_PARTY_ROOT}/fbgemm" CACHE STRING "FBGEMM source directory")
+@@ -834,6 +834,7 @@
+ endif()
+
+ if(USE_FBGEMM)
++ list(APPEND Caffe2_DEPENDENCY_LIBS fbgemm)
+ caffe2_update_option(USE_FBGEMM ON)
+ else()
+ caffe2_update_option(USE_FBGEMM OFF)
+@@ -1557,7 +1558,6 @@
if(NOT USE_SYSTEM_ONNX)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/onnx EXCLUDE_FROM_ALL)
endif()
@@ -8,7 +43,7 @@
add_definitions(-DONNX_NAMESPACE=${ONNX_NAMESPACE})
if(NOT USE_SYSTEM_ONNX)
-@@ -1850,7 +1849,6 @@
+@@ -1850,7 +1850,6 @@
#
set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
@@ -16,7 +51,7 @@
# Disable compiler feature checks for `fmt`.
#
-@@ -1859,9 +1857,7 @@
+@@ -1859,9 +1858,7 @@
# CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know
# `fmt` is compatible with a superset of the compilers that PyTorch is, it
# shouldn't be too bad to just disable the checks.
@@ -168,26 +203,6 @@
if(NOT USE_SYSTEM_PTHREADPOOL AND USE_INTERNAL_PTHREADPOOL_IMPL)
set(NNPACK_CUSTOM_THREADPOOL ON CACHE BOOL "")
endif()
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -481,7 +481,7 @@ endif()
- list(APPEND Caffe2_DEPENDENCY_LIBS cpuinfo)
-
- # ---[ QNNPACK
--if(USE_QNNPACK)
-+if(FALSE)
- set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
-
- if(NOT DEFINED QNNPACK_SOURCE_DIR)
-@@ -537,7 +537,7 @@ if(USE_QNNPACK)
- endif()
-
- # ---[ Caffe2 Int8 operators (enabled by USE_QNNPACK) depend on gemmlowp and neon2sse headers
--if(USE_QNNPACK)
-+if(FALSE)
- set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
- include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/gemmlowp")
- include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/neon2sse")
--- a/torch/csrc/Exceptions.cpp 2023-02-13 12:46:54.447013004 +0100
+++ b/torch/csrc/Exceptions.cpp 2023-02-13 12:50:18.433791791 +0100
@@ -1,11 +1,10 @@
diff --git a/sci-libs/caffe2/files/caffe2-2.0.0-gentoo.patch b/sci-libs/caffe2/files/caffe2-2.0.0-gentoo.patch
index 021a06e343e4..fce7a395023e 100644
--- a/sci-libs/caffe2/files/caffe2-2.0.0-gentoo.patch
+++ b/sci-libs/caffe2/files/caffe2-2.0.0-gentoo.patch
@@ -1,6 +1,41 @@
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
-@@ -1554,7 +1554,6 @@
+@@ -486,7 +486,7 @@ endif()
+ list(APPEND Caffe2_DEPENDENCY_LIBS cpuinfo)
+
+ # ---[ QNNPACK
+-if(USE_QNNPACK)
++if(FALSE)
+ set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
+
+ if(NOT DEFINED QNNPACK_SOURCE_DIR)
+@@ -542,7 +542,7 @@ if(USE_QNNPACK)
+ endif()
+
+ # ---[ Caffe2 Int8 operators (enabled by USE_QNNPACK) depend on gemmlowp and neon2sse headers
+-if(USE_QNNPACK)
++if(FALSE)
+ set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
+ include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/gemmlowp")
+ include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/neon2sse")
+@@ -802,7 +802,7 @@
+ endif()
+
+ # ---[ FBGEMM
+-if(USE_FBGEMM)
++if(FALSE)
+ set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
+ if(NOT DEFINED FBGEMM_SOURCE_DIR)
+ set(FBGEMM_SOURCE_DIR "${CAFFE2_THIRD_PARTY_ROOT}/fbgemm" CACHE STRING "FBGEMM source directory")
+@@ -847,6 +847,7 @@
+ endif()
+
+ if(USE_FBGEMM)
++ list(APPEND Caffe2_DEPENDENCY_LIBS fbgemm)
+ caffe2_update_option(USE_FBGEMM ON)
+ else()
+ caffe2_update_option(USE_FBGEMM OFF)
+@@ -1554,7 +1555,6 @@
set_target_properties(onnx_proto PROPERTIES CXX_STANDARD 17)
endif()
endif()
@@ -8,7 +43,7 @@
add_definitions(-DONNX_NAMESPACE=${ONNX_NAMESPACE})
if(NOT USE_SYSTEM_ONNX)
-@@ -1819,7 +1818,6 @@
+@@ -1819,7 +1819,6 @@
#
set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
@@ -16,7 +51,7 @@
# Disable compiler feature checks for `fmt`.
#
-@@ -1828,9 +1826,7 @@
+@@ -1828,9 +1827,7 @@
# CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know
# `fmt` is compatible with a superset of the compilers that PyTorch is, it
# shouldn't be too bad to just disable the checks.
@@ -167,23 +202,3 @@
if(NOT USE_SYSTEM_PTHREADPOOL AND USE_INTERNAL_PTHREADPOOL_IMPL)
set(NNPACK_CUSTOM_THREADPOOL ON CACHE BOOL "")
endif()
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -486,7 +486,7 @@ endif()
- list(APPEND Caffe2_DEPENDENCY_LIBS cpuinfo)
-
- # ---[ QNNPACK
--if(USE_QNNPACK)
-+if(FALSE)
- set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
-
- if(NOT DEFINED QNNPACK_SOURCE_DIR)
-@@ -542,7 +542,7 @@ if(USE_QNNPACK)
- endif()
-
- # ---[ Caffe2 Int8 operators (enabled by USE_QNNPACK) depend on gemmlowp and neon2sse headers
--if(USE_QNNPACK)
-+if(FALSE)
- set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
- include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/gemmlowp")
- include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/neon2sse")
diff --git a/sci-libs/caffe2/metadata.xml b/sci-libs/caffe2/metadata.xml
index f58d3b5e97ab..703eedf5322a 100644
--- a/sci-libs/caffe2/metadata.xml
+++ b/sci-libs/caffe2/metadata.xml
@@ -14,6 +14,7 @@
<flag name="distributed">Support distributed applications</flag>
<flag name="fbgemm">Use FBGEMM</flag>
<flag name="ffmpeg">Add support for video processing operators</flag>
+ <flag name="gloo">Use sci-libs/gloo</flag>
<flag name="nnpack">Use NNPACK</flag>
<flag name="numpy">Add support for math operations through numpy</flag>
<flag name="opencl">Use OpenCL</flag>