repo/gentoo:master commit in: sci-ml/pytorch/files/, sci-ml/pytorch/

"Alfredo Tupone" <[email protected]> Wed, 05 Aug 2026 12:53:48 +0000 (UTC)
Newsgroups gmane.linux.gentoo.cvs
Message-ID <1785934294.2c5a8f287a5654f7baff49b63ef1b83d508359a7.tupone@gentoo>
commit:     2c5a8f287a5654f7baff49b63ef1b83d508359a7
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  5 12:50:26 2026 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Wed Aug  5 12:51:34 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c5a8f28

sci-ml/pytorch: Fix xnnpack with FXdiv

Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 .../files/pytorch-2.13.0-unbundle_fxdiv.patch        | 20 ++++++++++++++++++++
 sci-ml/pytorch/pytorch-2.13.0-r1.ebuild              |  1 +
 2 files changed, 21 insertions(+)

diff --git a/sci-ml/pytorch/files/pytorch-2.13.0-unbundle_fxdiv.patch b/sci-ml/pytorch/files/pytorch-2.13.0-unbundle_fxdiv.patch
new file mode 100644
index 000000000000..8967ee435955
--- /dev/null
+++ b/sci-ml/pytorch/files/pytorch-2.13.0-unbundle_fxdiv.patch
@@ -0,0 +1,20 @@
+--- a/caffe2/CMakeLists.txt	2026-08-05 09:32:50.189849728 +0200
++++ b/caffe2/CMakeLists.txt	2026-08-05 09:34:02.015073194 +0200
+@@ -90,7 +90,7 @@
+ # Note: the folders that are being commented out have not been properly
+ # addressed yet.
+ 
+-if(NOT MSVC AND USE_XNNPACK)
++if(FALSE)
+   if(NOT TARGET fxdiv)
+     set(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
+     set(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
+@@ -1220,7 +1220,7 @@
+   endif()
+ endif()
+ 
+-if(NOT MSVC AND USE_XNNPACK)
++if(FALSE)
+   TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv)
+ endif()
+ 

diff --git a/sci-ml/pytorch/pytorch-2.13.0-r1.ebuild b/sci-ml/pytorch/pytorch-2.13.0-r1.ebuild
index 9014ee301cc8..3c39801b3546 100644
--- a/sci-ml/pytorch/pytorch-2.13.0-r1.ebuild
+++ b/sci-ml/pytorch/pytorch-2.13.0-r1.ebuild
@@ -166,6 +166,7 @@ PATCHES=(
 	"${FILESDIR}"/${P}-unbundle_fbgemm.patch
 	"${FILESDIR}"/${P}-unbundle_flatbuffers.patch
 	"${FILESDIR}"/${P}-unbundle_fmt.patch
+	"${FILESDIR}"/${P}-unbundle_fxdiv.patch
 	"${FILESDIR}"/${P}-unbundle_kineto.patch
 	"${FILESDIR}"/${P}-unbundle_mkldnn.patch
 	"${FILESDIR}"/${P}-unbundle_nnpack.patch