sci-ml/pytorch: apply mimalloc patch from caffe2

Closes: https://bugs.gentoo.org/980675
Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
This commit is contained in:
Alfredo Tupone
2026-08-14 12:28:44 +02:00
parent 038902e990
commit 6820ec6b79
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
--- a/c10/CMakeLists.txt 2026-02-01 09:22:55.398151644 +0100
+++ b/c10/CMakeLists.txt 2026-02-01 09:30:46.720495230 +0100
@@ -120,8 +120,9 @@
endif()
if(USE_MIMALLOC)
- target_link_libraries(c10 PRIVATE "mimalloc-static")
- add_dependencies(c10 mimalloc-static)
+ find_package(mimalloc REQUIRED)
+ target_link_libraries(c10 PRIVATE "mimalloc")
+ add_dependencies(c10 mimalloc)
endif()
if(LINUX)
--- a/CMakeLists.txt 2026-02-03 16:47:46.949580063 +0100
+++ b/CMakeLists.txt 2026-02-03 16:48:57.348716061 +0100
@@ -404,7 +404,6 @@
# on Windows and AArch64.
option(USE_MIMALLOC_ON_MKL "Use mimalloc on MKL" OFF)
if(WIN32 OR (CPU_AARCH64 AND NOT APPLE))
- set(USE_MIMALLOC ON)
# Disable OPT flags for mimalloc on aarch64 as it breaks ARMv8.0
# Not enable USE_MIMALLOC_ON_MKL due to it caused issue:
# See https://github.com/pytorch/pytorch/issues/174344

View File

@@ -163,6 +163,7 @@ BDEPEND="dev-build/cmake"
PATCHES=(
"${FILESDIR}"/${P}-aotriton-fixes.patch
"${FILESDIR}"/${P}-glog.patch
"${FILESDIR}"/${P}-mimalloc.patch
"${FILESDIR}"/${P}-removekineto-pr178960.patch
"${FILESDIR}"/${P}-rocm-assert-fix.patch
"${FILESDIR}"/${P}-unbundle_fbgemm.patch