public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Alfredo Tupone" <tupone@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-ml/caffe2/
Date: Thu, 20 Mar 2025 22:06:29 +0000 (UTC)	[thread overview]
Message-ID: <1742508376.5884bcb1fc524663d88eb2b1e0448ee7854f74c4.tupone@gentoo> (raw)

commit:     5884bcb1fc524663d88eb2b1e0448ee7854f74c4
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 20 22:01:31 2025 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Thu Mar 20 22:06:16 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5884bcb1

sci-ml/caffe2: enable mem efficient attention via use

Closes: https://bugs.gentoo.org/947932
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 sci-ml/caffe2/caffe2-2.5.1-r8.ebuild | 13 +++++++++++--
 sci-ml/caffe2/caffe2-2.6.0.ebuild    | 13 +++++++++++--
 sci-ml/caffe2/metadata.xml           |  1 +
 3 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/sci-ml/caffe2/caffe2-2.5.1-r8.ebuild b/sci-ml/caffe2/caffe2-2.5.1-r8.ebuild
index 848c743feb57..902bee88e3f5 100644
--- a/sci-ml/caffe2/caffe2-2.5.1-r8.ebuild
+++ b/sci-ml/caffe2/caffe2-2.5.1-r8.ebuild
@@ -20,7 +20,8 @@ S="${WORKDIR}"/${MYP}
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64"
-IUSE="cuda distributed fbgemm flash gloo mkl mpi nnpack +numpy onednn openblas opencl openmp qnnpack rocm xnnpack"
+IUSE="cuda distributed fbgemm flash gloo memefficient mkl mpi nnpack +numpy
+	onednn openblas opencl openmp qnnpack rocm xnnpack"
 RESTRICT="test"
 REQUIRED_USE="
 	${PYTHON_REQUIRED_USE}
@@ -149,6 +150,14 @@ src_prepare() {
 		c10/CMakeLists.txt \
 		c10/hip/CMakeLists.txt \
 		|| die
+	sed -i \
+		-e 's:pocketfft_hdronly.h:pocketfft/pocketfft_hdronly.h:' \
+		aten/src/ATen/native/mkl/SpectralOps.cpp \
+		die
+	sed -i \
+		-e '/Using pocketfft in directory:/d' \
+		cmake/Dependencies.cmake \
+		|| die
 
 	cmake_src_prepare
 	pushd torch/csrc/jit/serialization || die
@@ -213,7 +222,7 @@ src_configure() {
 		-DUSE_ITT=OFF
 		-DUSE_KINETO=OFF # TODO
 		-DUSE_MAGMA=OFF # TODO: In GURU as sci-libs/magma
-		-DUSE_MEM_EFF_ATTENTION=OFF
+		-DUSE_MEM_EFF_ATTENTION=$(usex memefficient)
 		-DUSE_MKLDNN=$(usex onednn)
 		-DUSE_MPI=$(usex mpi)
 		-DUSE_NCCL=OFF

diff --git a/sci-ml/caffe2/caffe2-2.6.0.ebuild b/sci-ml/caffe2/caffe2-2.6.0.ebuild
index b7d62a0ae814..1cd499d32116 100644
--- a/sci-ml/caffe2/caffe2-2.6.0.ebuild
+++ b/sci-ml/caffe2/caffe2-2.6.0.ebuild
@@ -20,7 +20,8 @@ S="${WORKDIR}"/${MYP}
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64"
-IUSE="cuda distributed fbgemm flash gloo mkl mpi nnpack +numpy onednn openblas opencl openmp qnnpack rocm xnnpack"
+IUSE="cuda distributed fbgemm flash gloo memefficient mkl mpi nnpack +numpy
+	onednn openblas opencl openmp qnnpack rocm xnnpack"
 RESTRICT="test"
 REQUIRED_USE="
 	${PYTHON_REQUIRED_USE}
@@ -149,6 +150,14 @@ src_prepare() {
 		c10/CMakeLists.txt \
 		c10/hip/CMakeLists.txt \
 		|| die
+	sed -i \
+		-e 's:pocketfft_hdronly.h:pocketfft/pocketfft_hdronly.h:' \
+		aten/src/ATen/native/mkl/SpectralOps.cpp \
+		die
+	sed -i \
+		-e '/Using pocketfft in directory:/d' \
+		cmake/Dependencies.cmake \
+		|| die
 
 	cmake_src_prepare
 	pushd torch/csrc/jit/serialization || die
@@ -213,7 +222,7 @@ src_configure() {
 		-DUSE_ITT=OFF
 		-DUSE_KINETO=OFF # TODO
 		-DUSE_MAGMA=OFF # TODO: In GURU as sci-libs/magma
-		-DUSE_MEM_EFF_ATTENTION=OFF
+		-DUSE_MEM_EFF_ATTENTION=$(usex memefficient)
 		-DUSE_MKLDNN=$(usex onednn)
 		-DUSE_MPI=$(usex mpi)
 		-DUSE_NCCL=OFF

diff --git a/sci-ml/caffe2/metadata.xml b/sci-ml/caffe2/metadata.xml
index 0754850fe24c..2483e58ed39e 100644
--- a/sci-ml/caffe2/metadata.xml
+++ b/sci-ml/caffe2/metadata.xml
@@ -10,6 +10,7 @@
 		<flag name="fbgemm">Use <pkg>sci-ml/FBGEMM</pkg></flag>
 		<flag name="flash">Enable flash attention</flag>
 		<flag name="gloo">Use <pkg>sci-ml/gloo</pkg></flag>
+		<flag name="memefficient">Enable mem efficient attention</flag>
 		<flag name="mkl">Use <pkg>sci-libs/mkl</pkg> for blas, lapack and sparse blas routines</flag>
 		<flag name="nnpack">Use <pkg>sci-ml/NNPACK</pkg></flag>
 		<flag name="numpy">Add support for math operations through numpy</flag>


             reply	other threads:[~2025-03-20 22:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-20 22:06 Alfredo Tupone [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-05-05  6:29 [gentoo-commits] repo/gentoo:master commit in: sci-ml/caffe2/ Alfredo Tupone
2025-03-21 22:12 Alfredo Tupone
2025-03-21 21:15 Alfredo Tupone
2025-03-15 18:12 Alfredo Tupone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1742508376.5884bcb1fc524663d88eb2b1e0448ee7854f74c4.tupone@gentoo \
    --to=tupone@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox