From ec583b0435e040155d9f0d4e11ac231cb801432c Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Thu, 21 Aug 2025 07:25:51 -0700 Subject: [PATCH 01/22] Disable aarch64 on EPEL Signed-off-by: Tom Rix --- python-torch.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python-torch.spec b/python-torch.spec index 6034593..de807e5 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -114,7 +114,14 @@ Patch11: 0001-Add-cmake-variable-USE_ROCM_CK.patch # Patch12: 0001-Use-horrible-dynamo-stub.patch Patch12: 0001-Fix-compilation-and-import-torch-issues-for-cpython-.patch -ExclusiveArch: x86_64 aarch64 +# 2.8 has this problem on aarch64 +# /builddir/build/BUILD/pytorch-v2.8.0/c10/util/FunctionRef.h:45:3: error: unrecognizable insn: +# (insn 3196 3195 3197 78 (set (reg:VNx8BF 1368 [ _494 ]) +# (unspec:VNx8BF [ +# (reg:VNx8BF 1374) +# (reg:VNx8BF 1375) +# ] UNSPEC_IORF)) "/builddir/build/BUILD/pytorch-v2.8.0/aten/src/ATen/cpu/vec/sve/vec_bfloat16.h":228:31 discrim 1 -1 +ExclusiveArch: x86_64 %global toolchain gcc %global _lto_cflags %nil From a62f1f295a83d991668b7bcc6bdb9183ef97d8b5 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Fri, 23 Jan 2026 12:04:31 -0800 Subject: [PATCH 02/22] Workaround a broken sympy Signed-off-by: Tom Rix --- python-torch.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python-torch.spec b/python-torch.spec index 5318e07..86b62fc 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -61,6 +61,10 @@ %bcond_with setuptools %endif +# 1/23/26 +# nothing provides (python3.14dist(mpmath) < 1.4~~ with python3.14dist(mpmath) >= 1.1) needed by python3-sympy-1.14.0-10.fc44.noarch from fedora +%bcond_with sympy + Name: python-%{pypi_name} %if %{with gitcommit} Version: %{pypi_version}^git%{date0}.%{shortcommit0} @@ -180,6 +184,9 @@ BuildRequires: python3dist(pyyaml) %if %{with setuptools} BuildRequires: python3dist(setuptools) %endif +%if %{with sympy} +BuildRequires: python3dist(sympy) +%endif BuildRequires: python3dist(typing-extensions) # Packages missing for RHEL/EPEL @@ -187,7 +194,6 @@ BuildRequires: python3dist(typing-extensions) BuildRequires: python3-pybind11 BuildRequires: python3dist(fsspec) BuildRequires: python3dist(sphinx) -BuildRequires: python3dist(sympy) # New for 2.9 / EPEL 10.2 BuildRequires: ninja-build %endif From eb7a834955cd0a8588e3507cb64745b5679663b1 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Tue, 27 Jan 2026 08:23:07 -0800 Subject: [PATCH 03/22] Work around runtime sympy Signed-off-by: Tom Rix --- python-torch.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python-torch.spec b/python-torch.spec index 86b62fc..15c058a 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -374,12 +374,16 @@ sed -i -e 's@"gfx1100", "gfx1101", "gfx1200", "gfx1201", "gfx908",@"gfx1100", "g %if 0%{?rhel} # In RHEL but too old sed -i -e '/typing-extensions/d' setup.py -# Need to pip these -sed -i -e '/sympy/d' setup.py +# Need to pip this sed -i -e '/fsspec/d' setup.py -%else +%endif + +%if %{with sympy} # for 2.5.0 sed -i -e 's@sympy==1.13.1@sympy>=1.13.1@' setup.py +%else +# Need to pip this +sed -i -e '/sympy/d' setup.py %endif # A new dependency From 98fe36fa367c8c6f1a23a5f983e588fc745cb87e Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Thu, 29 Jan 2026 13:58:40 -0800 Subject: [PATCH 04/22] Start using sympy again Signed-off-by: Tom Rix --- python-torch.spec | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/python-torch.spec b/python-torch.spec index 15c058a..ce13fc0 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -54,16 +54,14 @@ %bcond_without onnx %bcond_without protobuf %bcond_without setuptools +%bcond_without sympy %else %bcond_with eigen3 %bcond_with onnx %bcond_with protobuf %bcond_with setuptools -%endif - -# 1/23/26 -# nothing provides (python3.14dist(mpmath) < 1.4~~ with python3.14dist(mpmath) >= 1.1) needed by python3-sympy-1.14.0-10.fc44.noarch from fedora %bcond_with sympy +%endif Name: python-%{pypi_name} %if %{with gitcommit} From 6fcef74daffec536c4ea870d82d255c2d31cc827 Mon Sep 17 00:00:00 2001 From: "Alexander F. Lent" Date: Wed, 21 Jan 2026 23:16:27 -0500 Subject: [PATCH 05/22] Switch to clang on aarch64 GCC 16 + PyTorch 2.9.1 has problems, see the bug for more info. This is a temporary measure until we can diagnose and fix the underlying issue. Signed-off-by: Alexander F. Lent --- python-torch.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/python-torch.spec b/python-torch.spec index ce13fc0..741f505 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -131,7 +131,13 @@ Source110: https://github.com/pypa/setuptools/archive/refs/tags/v%{st_ver}. %global pt_arches x86_64 aarch64 ExclusiveArch: %pt_arches +# Switch to clang temporarily on aarch64, GCC 16 + PyTorch 2.9.1 has problems +# See rhbz#2431943 for more info +%ifarch aarch64 +%global toolchain clang +%else %global toolchain gcc +%endif %global _lto_cflags %nil BuildRequires: cmake @@ -142,8 +148,14 @@ BuildRequires: eigen3-devel BuildRequires: flexiblas-devel BuildRequires: fmt-devel BuildRequires: foxi-devel +%if "%{toolchain}" == "gcc" BuildRequires: gcc-c++ BuildRequires: gcc-gfortran +%endif +%if "%{toolchain}" == "clang" +BuildRequires: clang +BuildRequires: flang +%endif %if %{with gloo} BuildRequires: gloo-devel From c210424fd7ef0396dc2af8124fbca19c5184db1d Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Tue, 17 Feb 2026 11:36:34 -0800 Subject: [PATCH 06/22] Update to 2.10 Signed-off-by: Tom Rix --- .gitignore | 1 + ...n-torch-check-if-tuning_cache-exists.patch | 40 +++++++++++++++++++ python-torch.spec | 8 +++- sources | 1 + 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 0001-python-torch-check-if-tuning_cache-exists.patch diff --git a/.gitignore b/.gitignore index 1ef9c4f..a0671f3 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ /pytorch-v2.9.1.tar.gz /v3.19.6.tar.gz /v80.9.0.tar.gz +/pytorch-v2.10.0.tar.gz diff --git a/0001-python-torch-check-if-tuning_cache-exists.patch b/0001-python-torch-check-if-tuning_cache-exists.patch new file mode 100644 index 0000000..d314764 --- /dev/null +++ b/0001-python-torch-check-if-tuning_cache-exists.patch @@ -0,0 +1,40 @@ +From 4a58e5ebe5263d5dd5e5c44f28bce0ce256438f9 Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Tue, 17 Feb 2026 08:11:25 -0800 +Subject: [PATCH] python-torch check if tuning_cache exists + +--- + tools/amd_build/build_amd.py | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/tools/amd_build/build_amd.py b/tools/amd_build/build_amd.py +index b2c2461a0888..2570730ce498 100755 +--- a/tools/amd_build/build_amd.py ++++ b/tools/amd_build/build_amd.py +@@ -225,9 +225,9 @@ fbgemm_dir = ( + / "third_party/fbgemm/fbgemm_gpu/experimental/gen_ai/src/quantize/common/include/fbgemm_gpu/quantize" + ) + +-if not buck_build: +- fbgemm_original = fbgemm_dir / "tuning_cache.cuh" ++fbgemm_original = fbgemm_dir / "tuning_cache.cuh" + ++if not buck_build and os.path.exists(fbgemm_original): + extra_files.append(fbgemm_original.as_posix()) + + hipify_python.hipify( +@@ -240,8 +240,9 @@ hipify_python.hipify( + hip_clang_launch=is_hip_clang(), + ) + +-if not buck_build: +- fbgemm_move_src = fbgemm_dir / "hip/tuning_cache.cuh" ++fbgemm_move_src = fbgemm_dir / "hip/tuning_cache.cuh" ++ ++if not buck_build and os.path.exists(fbgemm_move_src): + fbgemm_move_dst = fbgemm_dir / "tuning_cache_hip.cuh" + + # only update the file if it changes or doesn't exist +-- +2.52.0 + diff --git a/python-torch.spec b/python-torch.spec index 741f505..c1f4892 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -16,7 +16,7 @@ %global pybind11_version 2.13.6 %global rc_tag -rc9 %else -%global pypi_version 2.9.1 +%global pypi_version 2.10.0 %global flatbuffers_version 24.12.23 %global miniz_version 3.0.2 %global pybind11_version 2.13.6 @@ -129,6 +129,12 @@ Source100: https://github.com/protocolbuffers/protobuf/archive/refs/tags/v% %global st_ver 80.9.0 Source110: https://github.com/pypa/setuptools/archive/refs/tags/v%{st_ver}.tar.gz +# FileNotFoundError: [Errno 2] No such file or directory: +# '.../third_party/fbgemm/fbgemm_gpu/experimental/gen_ai/src/quantize/common/ +# include/fbgemm_gpu/quantize/tuning_cache.cuh' +# https://github.com/pytorch/pytorch/issues/175160 +Patch: 0001-python-torch-check-if-tuning_cache-exists.patch + %global pt_arches x86_64 aarch64 ExclusiveArch: %pt_arches # Switch to clang temporarily on aarch64, GCC 16 + PyTorch 2.9.1 has problems diff --git a/sources b/sources index e184e73..868a803 100644 --- a/sources +++ b/sources @@ -19,3 +19,4 @@ SHA512 (pytorch-v2.9.0.tar.gz) = ae989e3a7fe30f9ea90944dc25e21ca92f2a94ee40d8de9 SHA512 (pytorch-v2.9.1.tar.gz) = 88de0289fa2760abd69bef505b5ae3b6d7ff176b415cbb31bbc89ce5476a3800b322a97c4490f270f8b89657aff931bf9a5516202b268e0bb8b1f63dbb87b34a SHA512 (v3.19.6.tar.gz) = 8f92242f2be8e1bbfba41341c87709ad91ad83b8b3e3df88bb430411541d3399295f49291fd52b50e3487b0fce33181cb4d175685fd25aac72adfaee26a612d4 SHA512 (v80.9.0.tar.gz) = e67c6c5e74691e65ecbf24fd19c1da545434ac1674f37c917f5ecc282a00bffc62d64164a885d19f177e99a3fa53db196e2be1cf0aa6811027e61d05119682da +SHA512 (pytorch-v2.10.0.tar.gz) = 64f5c62ac9ec7189ab27a787271e2d993d3230638b43792bbf6576e8ada840323d86ebfc4262d951266281623518cca5ba87f77ca61e165fef6a670fdf5b3c50 From f05176ef7ff012ca10fa2f71c3718d85d721a004 Mon Sep 17 00:00:00 2001 From: "Alexander F. Lent" Date: Thu, 19 Feb 2026 03:38:40 -0500 Subject: [PATCH 07/22] Fix build on aarch64 by changing USE_MIMALLOC default Signed-off-by: Alexander F. Lent --- python-torch.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python-torch.spec b/python-torch.spec index c1f4892..67fe444 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -443,6 +443,15 @@ sed -i -e 's@ checkout_nccl()@ True@' tools/build_pytorch_libs.py # Disable the use of check_submodule's in the setup.py, we are a tarball, not a git repo sed -i -e 's@check_submodules()$@#check_submodules()@' setup.py +# Disable the USE_MIMALLOC option, which is now default on AArch64 +# The comments in setup.py say that the env var is respected. +# This seems to be wrong on AArch64, where the default is overriden to ON. +# TODO: File an upstream bug about this misbehavior. +# TODO: Consider unbundling mimalloc since upstream says it's faster. +%ifarch aarch64 +sed -i -e 's@set(USE_MIMALLOC ON)@set(USE_MIMALLOC OFF)@' CMakeLists.txt +%endif + # Release comes fully loaded with third party src # Remove what we can # From 4a35d61997a56572d10f7120dda0ff1de9b94e50 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Sun, 15 Mar 2026 09:53:13 -0700 Subject: [PATCH 08/22] Increase memory per cpu Resolves an issue building on high core, low memory system. Signed-off-by: Tom Rix --- python-torch.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-torch.spec b/python-torch.spec index 67fe444..d5fc8d2 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -413,7 +413,7 @@ sed -i -e 's@HIP_CLANG_FLAGS -fno-gpu-rdc@HIP_CLANG_FLAGS -fno-gpu-rdc -Wno-unus sed -i -e 's@HIP_CLANG_FLAGS -fno-gpu-rdc@HIP_CLANG_FLAGS -fno-gpu-rdc -Wno-unused-result@' cmake/Dependencies.cmake sed -i -e 's@HIP_CLANG_FLAGS -fno-gpu-rdc@HIP_CLANG_FLAGS -fno-gpu-rdc -Wno-deprecated-declarations@' cmake/Dependencies.cmake # Use parallel jobs -sed -i -e 's@HIP_CLANG_FLAGS -fno-gpu-rdc@HIP_CLANG_FLAGS -fno-gpu-rdc -parallel-jobs=4@' cmake/Dependencies.cmake +sed -i -e 's@HIP_CLANG_FLAGS -fno-gpu-rdc@HIP_CLANG_FLAGS -fno-gpu-rdc -parallel-jobs=2@' cmake/Dependencies.cmake # Need to link with librocm_smi64 sed -i -e 's@hiprtc::hiprtc@hiprtc::hiprtc rocm_smi64@' cmake/Dependencies.cmake @@ -600,7 +600,7 @@ if [ ${COMPILE_JOBS}x = x ]; then COMPILE_JOBS=1 fi # Take into account memmory usage per core, do not thrash real memory -BUILD_MEM=2 +BUILD_MEM=4 MEM_KB=0 MEM_KB=`cat /proc/meminfo | grep MemTotal | awk '{ print $2 }'` MEM_MB=`eval "expr ${MEM_KB} / 1024"` From f3daf832af446257b5513e60f88d524afcd71390 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Wed, 8 Apr 2026 05:48:40 -0700 Subject: [PATCH 09/22] Update to 2.11 Signed-off-by: Tom Rix --- .gitignore | 4 +++ python-torch.spec | 66 +++++++++++++++++++++++------------------------ sources | 4 +++ 3 files changed, 41 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index a0671f3..1fdd1be 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,7 @@ /v3.19.6.tar.gz /v80.9.0.tar.gz /pytorch-v2.10.0.tar.gz +/pytorch-v2.11.0.tar.gz +/MSLK-3d332d1.tar.gz +/cpp-httplib-bd95e67.tar.gz +/kineto-7a731b6.tar.gz diff --git a/python-torch.spec b/python-torch.spec index d5fc8d2..f1567c6 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -6,17 +6,17 @@ # So pre releases can be tried %bcond_with gitcommit %if %{with gitcommit} -# v2.9.0-rc9 -%global commit0 0fabc3ba44823f257e70ce397d989c8de5e362c1 +# v2.11.0-rc6 (really v2.11) +%global commit0 70d99e998b4955e0049d13a98d77ae1b14db1f45 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) -%global date0 20251008 -%global pypi_version 2.9.0 +%global date0 20260320 +%global pypi_version 2.11.0 %global flatbuffers_version 24.12.23 %global miniz_version 3.0.2 -%global pybind11_version 2.13.6 -%global rc_tag -rc9 +%global pybind11_version 3.0.1 +%global rc_tag -rc6 %else -%global pypi_version 2.10.0 +%global pypi_version 2.11.0 %global flatbuffers_version 24.12.23 %global miniz_version 3.0.2 %global pybind11_version 2.13.6 @@ -44,9 +44,10 @@ %endif # These came in 2.4 and not yet in Fedora -%bcond_with opentelemetry %bcond_with httplib %bcond_with kineto +# These came in 2.11 +%bcond_with mslk # In fedora, not in rhel/epel or requires a newer version %if 0%{?fedora} @@ -101,13 +102,13 @@ Source60: https://github.com/open-telemetry/opentelemetry-cpp/archive/refs %endif %if %{without httplib} -%global hl_commit 3b6597bba913d51161383657829b7e644e59c006 +%global hl_commit bd95e67c234930cd6d6bb11309588c5462c63cec %global hl_scommit %(c=%{hl_commit}; echo ${c:0:7}) Source70: https://github.com/yhirose/cpp-httplib/archive/%{hl_commit}/cpp-httplib-%{hl_scommit}.tar.gz %endif %if %{without kineto} -%global ki_commit 5e7501833f1021ce6f618572d3baf657b6319658 +%global ki_commit 7a731b6ae01cfc2b1fc75d83a91f84e682e43fd7 %global ki_scommit %(c=%{ki_commit}; echo ${c:0:7}) Source80: https://github.com/pytorch/kineto/archive/%{ki_commit}/kineto-%{ki_scommit}.tar.gz %endif @@ -129,11 +130,12 @@ Source100: https://github.com/protocolbuffers/protobuf/archive/refs/tags/v% %global st_ver 80.9.0 Source110: https://github.com/pypa/setuptools/archive/refs/tags/v%{st_ver}.tar.gz -# FileNotFoundError: [Errno 2] No such file or directory: -# '.../third_party/fbgemm/fbgemm_gpu/experimental/gen_ai/src/quantize/common/ -# include/fbgemm_gpu/quantize/tuning_cache.cuh' -# https://github.com/pytorch/pytorch/issues/175160 -Patch: 0001-python-torch-check-if-tuning_cache-exists.patch +# mslk +%if %{without mslk} +%global mslk_commit 3d332d1c0c0ac7765852c97b3979c9ef913e037f +%global mslk_scommit %(c=%{mslk_commit}; echo ${c:0:7}) +Source120: https://github.com/meta-pytorch/MSLK/archive/%{mslk_commit}/MSLK-%{mslk_scommit}.tar.gz +%endif %global pt_arches x86_64 aarch64 ExclusiveArch: %pt_arches @@ -354,12 +356,6 @@ sed -i '/#include ' third_party/tensorpipe/tens sed -i '/#include ' third_party/tensorpipe/tensorpipe/common/memory.h %endif -%if %{without opentelemtry} -tar xf %{SOURCE60} -rm -rf third_party/opentelemetry-cpp/* -cp -r opentelemetry-cpp-*/* third_party/opentelemetry-cpp/ -%endif - %if %{without httplib} tar xf %{SOURCE70} rm -rf third_party/cpp-httplib/* @@ -384,6 +380,12 @@ rm -rf third_party/protobuf/* cp -r protobuf-*/* third_party/protobuf/ %endif +%if %{without mslk} +tar xf %{SOURCE120} +rm -rf third_party/mslk/* +cp -r MSLK-*/* third_party/mslk/ +%endif + # Adjust for the hipblaslt's we build sed -i -e 's@"gfx1100", "gfx1101", "gfx1200", "gfx1201", "gfx908",@"gfx1100", "gfx1101", "gfx1200", "gfx1201", "gfx1151",@' aten/src/ATen/native/cuda/Blas.cpp @@ -474,10 +476,6 @@ mv third_party/pybind11 . mv third_party/tensorpipe . %endif -%if %{without opentelemetry} -mv third_party/opentelemetry-cpp . -%endif - %if %{without httplib} mv third_party/cpp-httplib . %endif @@ -494,6 +492,10 @@ mv third_party/onnx . mv third_party/protobuf . %endif +%if %{without mslk} +mv third_party/mslk . +%endif + %if %{with test} mv third_party/googletest . %endif @@ -510,10 +512,6 @@ mv pybind11 third_party mv tensorpipe third_party %endif -%if %{without opentelemetry} -mv opentelemetry-cpp third_party -%endif - %if %{without httplib} mv cpp-httplib third_party %endif @@ -530,6 +528,10 @@ mv onnx third_party mv protobuf third_party %endif +%if %{without mslk} +mv mslk third_party +%endif + %if %{with test} mv googletest third_party %endif @@ -553,9 +555,6 @@ sed -i -e 's@list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)@#list(APPEND Caffe2 # cmake version changed sed -i -e 's@cmake_minimum_required(VERSION 3.4)@cmake_minimum_required(VERSION 3.5)@' third_party/tensorpipe/third_party/libuv/CMakeLists.txt sed -i -e 's@cmake_minimum_required(VERSION 3.4)@cmake_minimum_required(VERSION 3.5)@' libuv*/CMakeLists.txt -%if %{without opentelemtry} -sed -i -e 's@cmake_minimum_required(VERSION 3.1)@cmake_minimum_required(VERSION 3.5)@' third_party/opentelemetry-cpp/CMakeLists.txt -%endif %if %{with rocm} # hipify @@ -633,8 +632,8 @@ export CMAKE_BUILD_TYPE=RelWithDebInfo export CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON export CAFFE2_LINK_LOCAL_PROTOBUF=OFF export INTERN_BUILD_MOBILE=OFF -export USE_DISTRIBUTED=OFF export USE_CUDA=OFF +export USE_DISTRIBUTED=OFF export USE_FAKELOWP=OFF export USE_FBGEMM=OFF export USE_FLASH_ATTENTION=OFF @@ -648,6 +647,7 @@ export USE_MAGMA=OFF export USE_MEM_EFF_ATTENTION=OFF export USE_MKLDNN=OFF export USE_MPI=OFF +export USE_MSLK=OFF export USE_NCCL=OFF export USE_NNPACK=OFF export USE_NUMPY=ON diff --git a/sources b/sources index 868a803..bff0700 100644 --- a/sources +++ b/sources @@ -20,3 +20,7 @@ SHA512 (pytorch-v2.9.1.tar.gz) = 88de0289fa2760abd69bef505b5ae3b6d7ff176b415cbb3 SHA512 (v3.19.6.tar.gz) = 8f92242f2be8e1bbfba41341c87709ad91ad83b8b3e3df88bb430411541d3399295f49291fd52b50e3487b0fce33181cb4d175685fd25aac72adfaee26a612d4 SHA512 (v80.9.0.tar.gz) = e67c6c5e74691e65ecbf24fd19c1da545434ac1674f37c917f5ecc282a00bffc62d64164a885d19f177e99a3fa53db196e2be1cf0aa6811027e61d05119682da SHA512 (pytorch-v2.10.0.tar.gz) = 64f5c62ac9ec7189ab27a787271e2d993d3230638b43792bbf6576e8ada840323d86ebfc4262d951266281623518cca5ba87f77ca61e165fef6a670fdf5b3c50 +SHA512 (pytorch-v2.11.0.tar.gz) = e67d68245a19e65737c19f97b6d4ddd72051303abb17a734e09f1ba7ecfb3bf6a5546c826820890ad0ddfb2916b1f798175f341bda0cc3c8a83b3b852b077f3b +SHA512 (MSLK-3d332d1.tar.gz) = f6bd99ec7a79321692c088e622dd2ea8f1355b137014b33e75cb7ff83922fdd07ebacf5920e2e343a48fccd74315c11861ac5c2fff29e2f2481875ecb1ae57cf +SHA512 (cpp-httplib-bd95e67.tar.gz) = 17c7b1d1a3750b85ebfefcc31a2fe2cb538373b140a31058d5003a018601bbde96e82bd73b99708856c0ebecd910ac4aee5420b829cb444e3aac3ee5764dcff7 +SHA512 (kineto-7a731b6.tar.gz) = f15347cdb210b887c1c9c9e9d91556f48b5b3fc662dce0bfa6086bce38673c568f0fc385cdd1b16a742cc709d4db5798a18c6400f24bd57f6a1b4a2eaf303d47 From 99657d7a73b5418c473804972c643966b9c08bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Mon, 18 May 2026 13:38:17 +0200 Subject: [PATCH 10/22] Use protobuf in version 3.x only This is part of https://fedoraproject.org/wiki/Changes/Protobuf_5.x/6.x This package does not sucessfully build with new protobuf per https://copr.fedorainfracloud.org/coprs/mochaa/protobuf/monitor/ so limiting to protobuf version 3. Once the protobuf is rebase this will automatically pick up compat package protobuf3 I am not bumping release as this does not need a rebuild now. --- python-torch.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-torch.spec b/python-torch.spec index f1567c6..94dd90e 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -180,7 +180,7 @@ BuildRequires: onnx-devel BuildRequires: openmpi-devel %endif %if %{with protobuf} -BuildRequires: protobuf-devel +BuildRequires: protobuf-devel < 4 %endif BuildRequires: sleef-devel BuildRequires: valgrind-devel From 149a86c9ab0fb4a10b8f8031d1abc4ec2b8aadfa Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 5 Jun 2026 22:58:26 +0200 Subject: [PATCH 11/22] Rebuilt for Python 3.15 From 52842c0aeae82e6663475686a482a5b705b638bf Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Fri, 19 Jun 2026 10:10:06 -0700 Subject: [PATCH 12/22] Update gitcommit to 2.12 Signed-off-by: Tom Rix --- ...duce-polyfill-signature-mismatch-on-.patch | 110 ++++++++++++++++++ ...polyfill-signature-mismatch-on-Pytho.patch | 64 ++++++++++ inject.py | 44 +++++++ pyproject.toml | 102 +++++++++------- python-torch.spec | 50 ++++++-- 5 files changed, 323 insertions(+), 47 deletions(-) create mode 100644 0001-Fix-functools.reduce-polyfill-signature-mismatch-on-.patch create mode 100644 0001-Fix-struct.pack-polyfill-signature-mismatch-on-Pytho.patch create mode 100755 inject.py diff --git a/0001-Fix-functools.reduce-polyfill-signature-mismatch-on-.patch b/0001-Fix-functools.reduce-polyfill-signature-mismatch-on-.patch new file mode 100644 index 0000000..52748b4 --- /dev/null +++ b/0001-Fix-functools.reduce-polyfill-signature-mismatch-on-.patch @@ -0,0 +1,110 @@ +From a377729dc7fb711e43c0f59829580cc9c3f0522e Mon Sep 17 00:00:00 2001 +From: jassad095 +Date: Mon, 1 Jun 2026 05:06:50 +0000 +Subject: [PATCH] Fix functools.reduce polyfill signature mismatch on Python + 3.15 (#185682) + +## Summary + +Python 3.15 will expose an introspectable signature for `functools.reduce` using a PEP 661 sentinel default: `(function, iterable, /, initial=functools._initial_missing)`. The CPython change is [#149591](https://github.com/python/cpython/pull/149591), which merged into CPython main on 2026-05-10, after 3.15.0b1 was tagged. So on 3.15.0b1 the default is still `` and `inspect.signature()` raises `ValueError`, which `substitute_in_graph` swallows and skips the check. From 3.15.0b2 the check will run. + +When it runs, it compares positional parameter names, keyword-only names, and default values. The polyfill declares its own local sentinel: + +```python +_initial_missing = object() + +@substitute_in_graph(functools.reduce) +def reduce(function, iterable, initial=_initial_missing, /): + ... +``` + +That local `object()` is a different instance from `functools._initial_missing`, so the defaults dict compares unequal and `substitute_in_graph` raises: + +``` +File ".../torch/_dynamo/polyfills/functools.py", line N, in + @substitute_in_graph(functools.reduce) +TypeError: Signature mismatch between and : + (function, iterable, /, initial=_initial_missing) + != (function, iterable, initial=, /) +``` + +The polyfills loader imports every polyfill module, so this will break `import torch._dynamo` entirely on Python 3.15.0b2+. Same failure mode as #185403's `struct.pack` fix, just one step ahead of the next beta. + +The fix imports `functools._initial_missing` instead of declaring a local one. The polyfill's internal `if initial is _initial_missing` identity check still works because both sides now reference the same object. No behavior change on any Python version. `functools._initial_missing` has existed in `functools` since well before 3.10 (it's used by the pure-Python `functools.reduce` fallback), so the import is safe on every supported version. + +Part of #184352 (Python 3.15 support). Similar to #185403. + +## Test plan + +Verified on a locally-built Python 3.15-dev (CPython main at `heads/3.15:863c7e0`, which includes [#149591](https://github.com/python/cpython/pull/149591)). The upstream signature is exposed natively: + +``` +$ python3.15 -c "import functools, inspect; print(inspect.signature(functools.reduce))" +(function, iterable, /, initial=_initial_missing) +$ python3.15 -c "import functools, inspect; sig = inspect.signature(functools.reduce); print(sig.parameters['initial'].default is functools._initial_missing)" +True +``` + +Extracted the actual `substitute_in_graph` from `torch/_dynamo/decorators.py` and ran it against both polyfill versions with no monkey-patching. + +Unmodified polyfill (`_initial_missing = object()` declared locally): + +``` +TypeError: Signature mismatch between and : + (function, iterable, /, initial=_initial_missing) + != (function, iterable, initial=, /) +``` + +Fixed polyfill (`from functools import _initial_missing`): no `TypeError` at the signature check. + +Regression on Python 3.12.13 (oldest currently supported): + +``` +$ python3 -c "import inspect, functools; inspect.signature(functools.reduce)" +ValueError: no signature found for builtin +``` + +The signature check is silently skipped on Python <= 3.14, so the fix is a no-op there. `functools._initial_missing` is confirmed present on 3.12.13. Eager-vs-polyfill parity verified on every input shape: + +``` +reduce(lambda a, b: a+b, [1,2,3,4]) == 10 (matches functools.reduce) +reduce(lambda a, b: a+b, [1,2,3], 100) == 106 (matches) +reduce(lambda a, b: a+b, []) -> TypeError("reduce() of empty iterable with no initial value") (matches) +reduce(lambda a, b: a+b, [], 99) == 99 (matches) +``` + +Pre-commit checks: `python3 -m py_compile torch/_dynamo/polyfills/functools.py` and `git diff --staged --check` both clean. + +Pull Request resolved: https://github.com/pytorch/pytorch/pull/185682 +Approved by: https://github.com/ezyang + +Co-authored-by: Edward Z. Yang via mergedog +--- + torch/_dynamo/polyfills/functools.py | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/torch/_dynamo/polyfills/functools.py b/torch/_dynamo/polyfills/functools.py +index 6458b8080f93..9ba14888056b 100644 +--- a/torch/_dynamo/polyfills/functools.py ++++ b/torch/_dynamo/polyfills/functools.py +@@ -4,6 +4,7 @@ Python polyfills for functools + + import functools + from collections.abc import Callable, Iterable ++from functools import _initial_missing # type: ignore[attr-defined] + from typing import TypeVar + + from ..decorators import substitute_in_graph +@@ -16,9 +17,6 @@ _T = TypeVar("_T") + _U = TypeVar("_U") + + +-_initial_missing = object() +- +- + # Reference: https://docs.python.org/3/library/functools.html#functools.reduce + @substitute_in_graph(functools.reduce) + def reduce( +-- +2.53.0 + diff --git a/0001-Fix-struct.pack-polyfill-signature-mismatch-on-Pytho.patch b/0001-Fix-struct.pack-polyfill-signature-mismatch-on-Pytho.patch new file mode 100644 index 0000000..8f20a7b --- /dev/null +++ b/0001-Fix-struct.pack-polyfill-signature-mismatch-on-Pytho.patch @@ -0,0 +1,64 @@ +From 7b9106b6c4c1da71e30e7e63b2248b01c61a3210 Mon Sep 17 00:00:00 2001 +From: Klaus Zimmermann +Date: Fri, 29 May 2026 17:56:12 +0000 +Subject: [PATCH] Fix struct.pack polyfill signature mismatch on Python 3.15 + (#185403) + +## Summary + +Python 3.15 gives the builtin `struct.pack` an introspectable signature, `(format, /, *values)`. `substitute_in_graph` validates that a polyfill's signature matches the original builtin's, comparing positional-only parameter names. The `struct.pack` polyfill declared its positional-only parameter as `fmt`, mismatching `format`, so `substitute_in_graph` raised `TypeError` at import time: + +``` +File ".../torch/_dynamo/polyfills/struct.py", line 20, in + @substitute_in_graph(struct.pack, can_constant_fold_through=True) +TypeError: Signature mismatch between and : + (format, /, *values) != (fmt: 'bytes | str', /, *v: 'Any') -> 'bytes' +``` + +The polyfills loader eagerly imports every polyfill module, so this broke `import torch._dynamo` entirely on 3.15, failing every py3.15/3.15t binary test job (the smoke test imports `torch._dynamo`). On Python <= 3.14 the builtin has no introspectable signature, so the check is skipped and the mismatch went unnoticed. + +The fix renames the parameter to `format` to match the builtin. The sibling `unpack` polyfill already uses `format`. The var-positional name (`*v`) is irrelevant here because `substitute_in_graph` ignores `VAR_POSITIONAL` parameter names. + +Part of #184352 (Python 3.15 support). + +## Test plan + +Local introspection confirms there is no regression on older Pythons and that `format` is the canonical name where a signature is exposed: + +``` +$ python --version +Python 3.10.19 +$ python -c "import inspect, struct; print(inspect.signature(struct.pack))" +ValueError: no signature found for builtin +$ python -c "import inspect, struct; print(inspect.signature(struct.unpack))" +(format, buffer, /) +``` + +On <= 3.14 `struct.pack` has no signature, so the `substitute_in_graph` check is skipped and the rename is a no-op there. The 3.15 failure reproduces only in the py3.15 binary smoke test (`manywheel-py3_15-*-test`); needs `ciflow/binaries` to validate. + +Authored by Claude. + +Pull Request resolved: https://github.com/pytorch/pytorch/pull/185403 +Approved by: https://github.com/guilhermeleobas, https://github.com/rtimpe +--- + torch/_dynamo/polyfills/struct.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/torch/_dynamo/polyfills/struct.py b/torch/_dynamo/polyfills/struct.py +index f4522a12f732..4077a7f05788 100644 +--- a/torch/_dynamo/polyfills/struct.py ++++ b/torch/_dynamo/polyfills/struct.py +@@ -18,8 +18,8 @@ __all__ = [ + + + @substitute_in_graph(struct.pack, can_constant_fold_through=True) # type: ignore[arg-type] +-def pack(fmt: bytes | str, /, *v: Any) -> bytes: +- return struct.pack(fmt, *v) ++def pack(format: bytes | str, /, *v: Any) -> bytes: ++ return struct.pack(format, *v) + + + @substitute_in_graph(struct.unpack, can_constant_fold_through=True) # type: ignore[arg-type] +-- +2.53.0 + diff --git a/inject.py b/inject.py new file mode 100755 index 0000000..94da392 --- /dev/null +++ b/inject.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +""" +inject_build_options.py + +Runtime stub for injecting PyTorch CMake build flags. +Designed to be called pre-build (e.g., via a wrapper script or sitecustomize.py). +""" +import os +from typing import Dict, Any + +def read_environment() -> Dict[str, str]: + """Reads and prints environment variables in dictionary format.""" + # Using double quotes to match the MOCK_DEFAULTS dictionary style exactly + print("# Current Environment Variables (Formatted for injection):") + use_variables: Dict[str, Any] = {} + + for key in sorted(os.environ.keys()): + if key.startswith("USE_") or key.startswith("CMAKE_") : + value = os.environ[key] + print(f' "{key}": "{value}",') + use_variables[key] = value + return use_variables + +def build_options(build_options: Dict[str, Any]) -> Dict[str, Any] : + """ + Injects build configuration into the PyTorch CMake build process. + + """ + options = read_environment() + build_options.update(options) + return build_options + +if __name__ == "__main__": + MOCK_DEFAULTS = { + # Core CMake + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_FIND_PACKAGE_PREFER_CONFIG": "ON", + "CAFFE2_LINK_LOCAL_PROTOBUF": "OFF", + } + + new_options = build_options(MOCK_DEFAULTS) + + for key in new_options: + print(f"{key}: {new_options[key]}") diff --git a/pyproject.toml b/pyproject.toml index 925742b..73867a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = [ # 70.1.0: min version for integrated bdist_wheel command from wheel package # 77.0.0: min version for SPDX expression support for project.license - "setuptools>=70.1.0,<80.0", + "setuptools>=70.1.0,<82", "cmake>=3.27", "ninja", "numpy", @@ -45,7 +45,7 @@ dev = [ "optree>=0.13.0", "psutil", "sympy>=1.13.3", - "typing-extensions>=4.13.2", + "typing-extensions>=4.15.0", "wheel", ] @@ -115,6 +115,10 @@ multi_line_output = 3 include_trailing_comma = true combine_as_imports = true +[tool.usort] +preserve_inline_comments = true +collapse_blank_lines_in_category = false + [tool.usort.known] first_party = ["caffe2", "torch", "torchgen", "functorch", "test"] standard_library = ["typing_extensions"] @@ -122,6 +126,10 @@ standard_library = ["typing_extensions"] [tool.ruff] line-length = 88 src = ["caffe2", "torch", "torchgen", "functorch", "test"] +extend-exclude = ["third_party", "test/dynamo/cpython"] + +[tool.ruff.per-file-target-version] +"**/py312_intrinsics.py" = "py312" [tool.ruff.format] docstring-code-format = true @@ -130,21 +138,29 @@ quote-style = "double" [tool.ruff.lint] # NOTE: Synchoronize the ignores with .flake8 external = [ - "B001", - "B902", - "B950", - "E121", - "E122", - "E128", - "E131", - "E704", - "E723", - "F723", - "F812", + # Codes from flake8-only plugins that ruff doesn't implement. "P201", "P204", "T484", "TOR901", + # Codes that are preview-only in ruff, so flake8 is still the enforcer. + # As ruff promotes these out of preview, move them to flake8's ignore list. + "B901", + "B909", + "E115", + "E201", + "E221", + "E225", + "E226", + "E227", + "E231", + "E241", + "E261", + "E262", + "E265", + "E266", + "E272", + "E306", ] ignore = [ # these ignores are from flake8-bugbear; please fix! @@ -155,13 +171,10 @@ ignore = [ "E402", "C408", # C408 ignored because we like the dict keyword argument syntax "E501", # E501 is not flexible enough, we're using B950 instead - "E721", "E741", "EXE001", "F405", "FURB122", # writelines - # these ignores are from flake8-logging-format; please fix! - "G101", # these ignores are from ruff NPY; please fix! "NPY002", # these ignores are from ruff PERF; please fix! @@ -175,22 +188,14 @@ ignore = [ "SIM102", "SIM103", "SIM112", # flake8-simplify code styles "SIM105", # these ignores are from flake8-simplify. please fix or ignore with commented reason "SIM108", # SIM108 ignored because we prefer if-else-block instead of ternary expression - "SIM110", + "SIM110", # Checks for for loops that can be replaced with a builtin function, like any or all. "SIM114", # Combine `if` branches using logical `or` operator - "SIM115", "SIM116", # Disable Use a dictionary instead of consecutive `if` statements "SIM117", - "SIM118", - "UP007", # keep-runtime-typing - "UP045", # keep-runtime-typing + "SIM300", # Yoda condition detected "TC006", # TODO: Remove Python-3.10 specific suppressions "B905", - "UP035", - "UP036", - "UP038", - "UP041", - "FURB161", ] select = [ "B", @@ -200,8 +205,7 @@ select = [ "E", "EXE", "F", - "SIM1", - "SIM911", + "SIM", "W", # Not included in flake8 "FURB", @@ -209,21 +213,19 @@ select = [ "NPY", "PERF", "PGH004", - "PIE790", - "PIE794", - "PIE800", - "PIE804", - "PIE807", - "PIE810", + "PIE", "PLC0131", # type bivariance "PLC0132", # type param mismatch + "PLC1802", # len({expression}) used as condition without comparison "PLC0205", # string as __slots__ "PLC3002", # unnecessary-direct-lambda-call + "PLC0414", # Import alias does not rename original package "PLE", "PLR0133", # constant comparison "PLR0206", # property with params "PLR1722", # use sys exit "PLR1736", # unnecessary list index + "PLW0127", # Self-assignment of variable "PLW0129", # assert on string literal "PLW0131", # named expr without context "PLW0133", # useless exception statement @@ -246,6 +248,7 @@ select = [ "Q003", # avoidable escaped quote "Q004", # unnecessary escaped quote "RSE", + "RUF007", # pairwise over zip "RUF008", # mutable dataclass default "RUF013", # ban implicit optional "RUF015", # access first ele in constant time @@ -269,12 +272,9 @@ select = [ "TRY401", # verbose-log-message "UP", "YTT", + "S101", ] -[tool.ruff.lint.pyupgrade] -# Preserve types, even if a file imports `from __future__ import annotations`. -keep-runtime-typing = true - [tool.ruff.lint.per-file-ignores] "__init__.py" = [ "F401", @@ -284,11 +284,11 @@ keep-runtime-typing = true "PYI021", # docstring-in-stub "PYI053", # string-or-bytes-too-long ] -"functorch/notebooks/**" = [ +"functorch/docs/source/tutorials/**" = [ "F401", ] "test/export/**" = [ - "PGH004" + "PGH004", ] "test/typing/**" = [ "PGH004" @@ -349,5 +349,27 @@ keep-runtime-typing = true "LOG015" # please fix ] +# torch/ folders still needing S101 migration +"torch/_dynamo/**" = ["S101"] +"torch/_inductor/**" = ["S101"] + [tool.codespell] ignore-words = "tools/linter/dictionary.txt" + +[tool.spin] +package = 'torch' + +[tool.spin.commands] +"Build" = [ + ".spin/cmds.py:clean", + ".spin/cmds.py:lint", + ".spin/cmds.py:fixlint", + ".spin/cmds.py:quicklint", + ".spin/cmds.py:quickfix", +] +"Regenerate" = [ + ".spin/cmds.py:regenerate_version", + ".spin/cmds.py:regenerate_type_stubs", + ".spin/cmds.py:regenerate_clangtidy_files", + ".spin/cmds.py:regenerate_github_workflows", +] diff --git a/python-torch.spec b/python-torch.spec index 94dd90e..879d843 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -6,15 +6,14 @@ # So pre releases can be tried %bcond_with gitcommit %if %{with gitcommit} -# v2.11.0-rc6 (really v2.11) -%global commit0 70d99e998b4955e0049d13a98d77ae1b14db1f45 +# v2.12.0 (really v2.12) +%global commit0 0d62256a2b23365f8e1604297eb23a6545102aa8 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) -%global date0 20260320 -%global pypi_version 2.11.0 +%global date0 20260511 +%global pypi_version 2.12.0 %global flatbuffers_version 24.12.23 %global miniz_version 3.0.2 %global pybind11_version 3.0.1 -%global rc_tag -rc6 %else %global pypi_version 2.11.0 %global flatbuffers_version 24.12.23 @@ -53,8 +52,12 @@ %if 0%{?fedora} %bcond_without eigen3 %bcond_without onnx +%if %{with gitcommit} +%bcond_with protobuf +%else %bcond_without protobuf -%bcond_without setuptools +%endif +%bcond_with setuptools %bcond_without sympy %else %bcond_with eigen3 @@ -79,6 +82,12 @@ URL: https://pytorch.org/ %if %{with gitcommit} Source0: %{forgeurl}/archive/%{commit0}/pytorch-%{shortcommit0}.tar.gz Source1000: pyproject.toml +Source1001: inject.py + +# Problems with python 3.15 +Patch1: 0001-Fix-functools.reduce-polyfill-signature-mismatch-on-.patch +Patch2: 0001-Fix-struct.pack-polyfill-signature-mismatch-on-Pytho.patch + %else Source0: %{forgeurl}/releases/download/v%{version}/pytorch-v%{version}.tar.gz %endif @@ -108,7 +117,11 @@ Source70: https://github.com/yhirose/cpp-httplib/archive/%{hl_commit}/cpp- %endif %if %{without kineto} +%if %{with gitcommit} +%global ki_commit b2103f78d13fde4937af010c0ef8e24313568bc5 +%else %global ki_commit 7a731b6ae01cfc2b1fc75d83a91f84e682e43fd7 +%endif %global ki_scommit %(c=%{ki_commit}; echo ${c:0:7}) Source80: https://github.com/pytorch/kineto/archive/%{ki_commit}/kineto-%{ki_scommit}.tar.gz %endif @@ -217,6 +230,9 @@ BuildRequires: ninja-build %endif %if %{with rocm} +%if %{with gitcommit} +BuildRequires: amdsmi-devel +%endif BuildRequires: hipblas-devel BuildRequires: hipblaslt-devel BuildRequires: hipcub-devel @@ -313,6 +329,21 @@ Requires: python3-%{pypi_name}%{?_isa} = %{version}-%{release} # Overwrite with a git checkout of the pyproject.toml cp %{SOURCE1000} . +# to fix handling of environment variable +# comment out broken +sed -i -e 's@include(cmake/EnvVarForwarding.cmake)@#include(cmake/EnvVarForwarding.cmake)@' CMakeLists.txt +# copy new environment reading function in +cp %{SOURCE1001} tools/setup_helpers/ +# patch in the function +sed -i '/import sysconfig.*/afrom . import inject' tools/setup_helpers/cmake.py +# patch in the call +sed -i -E 's@# NVSHMEM .*@inject.build_options(build_options)@' tools/setup_helpers/cmake.py + +# System setuptools is too new +sed -i -e 's@setuptools>=70.1.0,<82@setuptools@' pyproject.toml +sed -i -e 's@setuptools>=70.1.0,<82@setuptools@' requirements-build.txt +sed -i -e 's@setuptools<82@setuptools@' setup.py + %else %autosetup -p1 -n pytorch-v%{version} @@ -577,6 +608,9 @@ sed -i -e 's@HIP 1.0@HIP MODULE@' cmake/public/LoadHIP.cmake # moodycamel include path needs adjusting to use the system's sed -i -e 's@${PROJECT_SOURCE_DIR}/third_party/concurrentqueue@/usr/include/concurrentqueue@' cmake/Dependencies.cmake +# Do not default on MSLK +sed -i -e 's@USE_MSLK_DEFAULT ON@USE_MSLK_DEFAULT OFF@' CMakeLists.txt + %build # Export the arches @@ -651,6 +685,7 @@ export USE_MSLK=OFF export USE_NCCL=OFF export USE_NNPACK=OFF export USE_NUMPY=ON +export USE_NVSHMEM=OFF export USE_OPENMP=ON export USE_PYTORCH_QNNPACK=OFF export USE_ROCM=OFF @@ -705,7 +740,8 @@ export ROCM_PATH=`hipconfig -R` # pytorch uses clang, not hipcc export HIP_CLANG_PATH=%{rocmllvm_bindir} -export PYTORCH_ROCM_ARCH=%{rocm_gpu_list_default} +# export PYTORCH_ROCM_ARCH=%{rocm_gpu_list_default} +export PYTORCH_ROCM_ARCH=gfx1151 %endif From c9049e8b46a002a490eecdaf238b7026d1eb99b0 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Sun, 21 Jun 2026 06:29:00 -0700 Subject: [PATCH 13/22] Update to v2.12 Signed-off-by: Tom Rix --- .gitignore | 3 +++ python-torch.spec | 25 +++++++++++++------------ sources | 3 +++ 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 1fdd1be..f21a902 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,6 @@ /MSLK-3d332d1.tar.gz /cpp-httplib-bd95e67.tar.gz /kineto-7a731b6.tar.gz +/kineto-b2103f7.tar.gz +/pytorch-v2.12.0.tar.gz +/v3.0.1.tar.gz diff --git a/python-torch.spec b/python-torch.spec index 879d843..195044e 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -15,10 +15,10 @@ %global miniz_version 3.0.2 %global pybind11_version 3.0.1 %else -%global pypi_version 2.11.0 +%global pypi_version 2.12.0 %global flatbuffers_version 24.12.23 %global miniz_version 3.0.2 -%global pybind11_version 2.13.6 +%global pybind11_version 3.0.1 %endif # For -test subpackage @@ -52,11 +52,7 @@ %if 0%{?fedora} %bcond_without eigen3 %bcond_without onnx -%if %{with gitcommit} %bcond_with protobuf -%else -%bcond_without protobuf -%endif %bcond_with setuptools %bcond_without sympy %else @@ -90,6 +86,13 @@ Patch2: 0001-Fix-struct.pack-polyfill-signature-mismatch-on-Pytho.patch %else Source0: %{forgeurl}/releases/download/v%{version}/pytorch-v%{version}.tar.gz + +Source1001: inject.py + +# Problems with python 3.15 +Patch1: 0001-Fix-functools.reduce-polyfill-signature-mismatch-on-.patch +Patch2: 0001-Fix-struct.pack-polyfill-signature-mismatch-on-Pytho.patch + %endif Source1: https://github.com/google/flatbuffers/archive/refs/tags/v%{flatbuffers_version}.tar.gz Source2: https://github.com/pybind/pybind11/archive/refs/tags/v%{pybind11_version}.tar.gz @@ -120,7 +123,7 @@ Source70: https://github.com/yhirose/cpp-httplib/archive/%{hl_commit}/cpp- %if %{with gitcommit} %global ki_commit b2103f78d13fde4937af010c0ef8e24313568bc5 %else -%global ki_commit 7a731b6ae01cfc2b1fc75d83a91f84e682e43fd7 +%global ki_commit b2103f78d13fde4937af010c0ef8e24313568bc5 %endif %global ki_scommit %(c=%{ki_commit}; echo ${c:0:7}) Source80: https://github.com/pytorch/kineto/archive/%{ki_commit}/kineto-%{ki_scommit}.tar.gz @@ -230,9 +233,7 @@ BuildRequires: ninja-build %endif %if %{with rocm} -%if %{with gitcommit} BuildRequires: amdsmi-devel -%endif BuildRequires: hipblas-devel BuildRequires: hipblaslt-devel BuildRequires: hipcub-devel @@ -329,6 +330,9 @@ Requires: python3-%{pypi_name}%{?_isa} = %{version}-%{release} # Overwrite with a git checkout of the pyproject.toml cp %{SOURCE1000} . +%else +%autosetup -p1 -n pytorch-v%{version} + # to fix handling of environment variable # comment out broken sed -i -e 's@include(cmake/EnvVarForwarding.cmake)@#include(cmake/EnvVarForwarding.cmake)@' CMakeLists.txt @@ -344,9 +348,6 @@ sed -i -e 's@setuptools>=70.1.0,<82@setuptools@' pyproject.toml sed -i -e 's@setuptools>=70.1.0,<82@setuptools@' requirements-build.txt sed -i -e 's@setuptools<82@setuptools@' setup.py -%else -%autosetup -p1 -n pytorch-v%{version} - # GitHub release tarballs identify the version as an alpha, so replace that echo "%{pypi_version}" > version.txt diff --git a/sources b/sources index bff0700..29a2107 100644 --- a/sources +++ b/sources @@ -24,3 +24,6 @@ SHA512 (pytorch-v2.11.0.tar.gz) = e67d68245a19e65737c19f97b6d4ddd72051303abb17a7 SHA512 (MSLK-3d332d1.tar.gz) = f6bd99ec7a79321692c088e622dd2ea8f1355b137014b33e75cb7ff83922fdd07ebacf5920e2e343a48fccd74315c11861ac5c2fff29e2f2481875ecb1ae57cf SHA512 (cpp-httplib-bd95e67.tar.gz) = 17c7b1d1a3750b85ebfefcc31a2fe2cb538373b140a31058d5003a018601bbde96e82bd73b99708856c0ebecd910ac4aee5420b829cb444e3aac3ee5764dcff7 SHA512 (kineto-7a731b6.tar.gz) = f15347cdb210b887c1c9c9e9d91556f48b5b3fc662dce0bfa6086bce38673c568f0fc385cdd1b16a742cc709d4db5798a18c6400f24bd57f6a1b4a2eaf303d47 +SHA512 (kineto-b2103f7.tar.gz) = 27d9f6a8b27434e83d26ed182df1fecec1d02fc26906995e44155562a730f998f527aad3d6c8a37212255c5e2f86a607a9648edf62861f56eb2ea512c4452908 +SHA512 (pytorch-v2.12.0.tar.gz) = 00f900945c3a7dc33fe61ece65341d7995c13f6134b714bc246f43b06f7d091b5952e8cb3febda6931cb769c96189e6b646c179ea59601ead834fb007f0788f2 +SHA512 (v3.0.1.tar.gz) = c17e6d6a78c38e760864b390ac2aa7df6a94ca53acb2e8be71f0d63d611b738fa20a16946c98a93fbfcad56cb0346ebf247bbe41c6f5171c6ce68397b1e5c4db From 56f9795aa652354da805296cb1834c9290684bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= Date: Thu, 25 Jun 2026 12:41:11 +0200 Subject: [PATCH 14/22] Rebuilt for fmt/spdlog From d1b41e0c1ffc64fe4650f92f0e0ebf9c54142689 Mon Sep 17 00:00:00 2001 From: Diego Herrera Date: Mon, 29 Jun 2026 03:29:13 -0400 Subject: [PATCH 15/22] Disable system onnx --- python-torch.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-torch.spec b/python-torch.spec index 195044e..72e4a26 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -51,7 +51,7 @@ # In fedora, not in rhel/epel or requires a newer version %if 0%{?fedora} %bcond_without eigen3 -%bcond_without onnx +%bcond_with onnx %bcond_with protobuf %bcond_with setuptools %bcond_without sympy From 993871cd73ec72a3975867ba1d1c29c5141b5961 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jul 2026 22:17:56 +0000 Subject: [PATCH 16/22] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild From 4dfad38b183d07629624ae86622e0fc3e1916188 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 17 Jul 2026 06:12:12 +0100 Subject: [PATCH 17/22] Rebuilt for onnx 1.21.0 https://bodhi.fedoraproject.org/updates/FEDORA-2026-916652ebea From 33eff2db686721633724c8f3b4ac02e23e163b92 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Wed, 22 Jul 2026 17:21:48 +0200 Subject: [PATCH 18/22] Rebuilt for Python 3.15.0b4 ABI change From a3aaf8df1bbe58bf97bdfed1351f0f3916483191 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Sat, 15 Aug 2026 17:49:49 -0700 Subject: [PATCH 19/22] Rebuild for ROCm 7.14 Signed-off-by: Tom Rix From 087f2caeb5426d4e9ae8987d83657d55e042e899 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Tue, 18 Aug 2026 13:49:43 -0700 Subject: [PATCH 20/22] Update to 2.13 Signed-off-by: Tom Rix --- .gitignore | 1 + 0001-pytorch-fmt.patch | 54 ++++++++++++++++++++++++++++++++++++++ 0001-pytorch-gloo.patch | 27 +++++++++++++++++++ 0001-pytorch-xnnpack.patch | 40 ++++++++++++++++++++++++++++ python-torch.spec | 35 ++++++++++++++---------- sources | 26 ++++-------------- 6 files changed, 148 insertions(+), 35 deletions(-) create mode 100644 0001-pytorch-fmt.patch create mode 100644 0001-pytorch-gloo.patch create mode 100644 0001-pytorch-xnnpack.patch diff --git a/.gitignore b/.gitignore index f21a902..eed0612 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ /kineto-b2103f7.tar.gz /pytorch-v2.12.0.tar.gz /v3.0.1.tar.gz +/pytorch-v2.13.0.tar.gz diff --git a/0001-pytorch-fmt.patch b/0001-pytorch-fmt.patch new file mode 100644 index 0000000..b32ec41 --- /dev/null +++ b/0001-pytorch-fmt.patch @@ -0,0 +1,54 @@ +From afdeb01359eecc67b573bcfb4f164ec81a1c7197 Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Mon, 17 Aug 2026 15:59:39 -0700 +Subject: [PATCH] pytorch fmt + +--- + cmake/Dependencies.cmake | 31 ------------------------------- + 1 file changed, 31 deletions(-) + +diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake +index f7f938988c8e..d84eea5f1129 100644 +--- a/cmake/Dependencies.cmake ++++ b/cmake/Dependencies.cmake +@@ -1635,37 +1635,6 @@ endif() + # End ATen checks + # + +-# Install `fmtlib` header. +-# This was the default behavior before version 12.0.0. +-# Since PyTorch C API depends on it, make it available for projects that +-# depend on PyTorch. +-set(FMT_INSTALL ON) +-set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) +-set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE) +-add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt) +- +-# Disable compiler feature checks for `fmt`. +-# +-# CMake compiles a little program to check compiler features. Some of our build +-# configurations (notably the mobile build analyzer) will populate +-# 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. +-set_target_properties(fmt-header-only PROPERTIES INTERFACE_COMPILE_FEATURES "") +- +-# Keep fmt's header-only type layout stable across mixed C++ modes by forcing +-# one no_unique_address spelling for all translation units. +-if(MSVC AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(_fmt_no_unique_address "[[msvc::no_unique_address]]") +-else() +- set(_fmt_no_unique_address "[[no_unique_address]]") +-endif() +-target_compile_definitions(fmt PUBLIC "FMT_NO_UNIQUE_ADDRESS=${_fmt_no_unique_address}") +-target_compile_definitions(fmt-header-only INTERFACE "FMT_NO_UNIQUE_ADDRESS=${_fmt_no_unique_address}") +-unset(_fmt_no_unique_address) +- +-list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only) +-set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE) + + # ---[ Kineto + # edge profiler depends on KinetoProfiler but it only does cpu +-- +2.55.0 + diff --git a/0001-pytorch-gloo.patch b/0001-pytorch-gloo.patch new file mode 100644 index 0000000..503cc6d --- /dev/null +++ b/0001-pytorch-gloo.patch @@ -0,0 +1,27 @@ +From 1b1962613916961fade2ddb971c9ceeee74cc5c5 Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Mon, 17 Aug 2026 08:16:49 -0700 +Subject: [PATCH] pytorch gloo + +--- + cmake/Dependencies.cmake | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake +index 81b673aabcd4..f7f938988c8e 100644 +--- a/cmake/Dependencies.cmake ++++ b/cmake/Dependencies.cmake +@@ -1277,6 +1277,10 @@ if(USE_GLOO) + if(NOT Gloo_FOUND) + message(FATAL_ERROR "Cannot find gloo") + endif() ++ set(Gloo_INCLUDE_DIRS /usr/include) ++ set(Gloo_NATIVE_LIBRARY /usr/lib64/libgloo.so) ++ set(Gloo_HIP_LIBRARY /usr/lib64/libgloo_hip.so) ++ + message("Found gloo: ${Gloo_NATIVE_LIBRARY}, cuda lib: ${Gloo_CUDA_LIBRARY}, hip lib: ${Gloo_HIP_LIBRARY}") + message("Found gloo include directories: ${Gloo_INCLUDE_DIRS}") + +-- +2.55.0 + diff --git a/0001-pytorch-xnnpack.patch b/0001-pytorch-xnnpack.patch new file mode 100644 index 0000000..03c2852 --- /dev/null +++ b/0001-pytorch-xnnpack.patch @@ -0,0 +1,40 @@ +From ff660e83955efa54188d87c40804d991e31a8618 Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Mon, 17 Aug 2026 07:34:20 -0700 +Subject: [PATCH] pytorch xnnpack + +--- + cmake/Dependencies.cmake | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake +index 2baa187e69ac..81b673aabcd4 100644 +--- a/cmake/Dependencies.cmake ++++ b/cmake/Dependencies.cmake +@@ -611,16 +611,18 @@ if(USE_XNNPACK AND NOT USE_SYSTEM_XNNPACK) + list(APPEND Caffe2_DEPENDENCY_LIBS XNNPACK microkernels-prod) + elseif(NOT TARGET XNNPACK AND USE_SYSTEM_XNNPACK) + add_library(XNNPACK SHARED IMPORTED) +- add_library(microkernels-prod SHARED IMPORTED) ++# add_library(microkernels-prod SHARED IMPORTED) + find_library(XNNPACK_LIBRARY XNNPACK) +- find_library(microkernels-prod_LIBRARY microkernels-prod) ++# find_library(microkernels-prod_LIBRARY microkernels-prod) + set_property(TARGET XNNPACK PROPERTY IMPORTED_LOCATION "${XNNPACK_LIBRARY}") +- set_property(TARGET microkernels-prod PROPERTY IMPORTED_LOCATION "${microkernels-prod_LIBRARY}") +- if(NOT XNNPACK_LIBRARY OR NOT microkernels-prod_LIBRARY) ++# set_property(TARGET microkernels-prod PROPERTY IMPORTED_LOCATION "${microkernels-prod_LIBRARY}") ++# if(NOT XNNPACK_LIBRARY OR NOT microkernels-prod_LIBRARY) ++ if(NOT XNNPACK_LIBRARY) + message(FATAL_ERROR "Cannot find XNNPACK") + endif() + message("-- Found XNNPACK: ${XNNPACK_LIBRARY}") +- list(APPEND Caffe2_DEPENDENCY_LIBS XNNPACK microkernels-prod) ++# list(APPEND Caffe2_DEPENDENCY_LIBS XNNPACK microkernels-prod) ++ list(APPEND Caffe2_DEPENDENCY_LIBS XNNPACK) + endif() + + # ---[ Vulkan deps +-- +2.55.0 + diff --git a/python-torch.spec b/python-torch.spec index 72e4a26..e9e522d 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -15,7 +15,7 @@ %global miniz_version 3.0.2 %global pybind11_version 3.0.1 %else -%global pypi_version 2.12.0 +%global pypi_version 2.13.0 %global flatbuffers_version 24.12.23 %global miniz_version 3.0.2 %global pybind11_version 3.0.1 @@ -33,7 +33,7 @@ %endif # For testing distributed+rccl etc. -%bcond_with gloo +%bcond_without gloo %bcond_without mpi %bcond_without tensorpipe @@ -51,8 +51,8 @@ # In fedora, not in rhel/epel or requires a newer version %if 0%{?fedora} %bcond_without eigen3 -%bcond_with onnx -%bcond_with protobuf +%bcond_without onnx +%bcond_without protobuf %bcond_with setuptools %bcond_without sympy %else @@ -87,11 +87,15 @@ Patch2: 0001-Fix-struct.pack-polyfill-signature-mismatch-on-Pytho.patch %else Source0: %{forgeurl}/releases/download/v%{version}/pytorch-v%{version}.tar.gz +Patch1: 0001-pytorch-xnnpack.patch +Patch2: 0001-pytorch-gloo.patch +Patch3: 0001-pytorch-fmt.patch + Source1001: inject.py # Problems with python 3.15 -Patch1: 0001-Fix-functools.reduce-polyfill-signature-mismatch-on-.patch -Patch2: 0001-Fix-struct.pack-polyfill-signature-mismatch-on-Pytho.patch +# Patch1: 0001-Fix-functools.reduce-polyfill-signature-mismatch-on-.patch +# Patch2: 0001-Fix-struct.pack-polyfill-signature-mismatch-on-Pytho.patch %endif Source1: https://github.com/google/flatbuffers/archive/refs/tags/v%{flatbuffers_version}.tar.gz @@ -196,7 +200,7 @@ BuildRequires: onnx-devel BuildRequires: openmpi-devel %endif %if %{with protobuf} -BuildRequires: protobuf-devel < 4 +BuildRequires: protobuf-devel %endif BuildRequires: sleef-devel BuildRequires: valgrind-devel @@ -208,6 +212,8 @@ BuildRequires: fxdiv-devel BuildRequires: psimd-devel BuildRequires: xnnpack-devel = 0.0^git20240814.312eb7e +BuildRequires: zlib-ng-compat-static + BuildRequires: python3-devel BuildRequires: python3dist(filelock) BuildRequires: python3dist(jinja2) @@ -258,6 +264,7 @@ BuildRequires: rocm-runtime-devel BuildRequires: rocm-rpm-macros BuildRequires: rocsolver-devel BuildRequires: rocm-smi-devel +BuildRequires: rocshmem-devel BuildRequires: rocthrust-devel BuildRequires: roctracer-devel @@ -497,7 +504,7 @@ sed -i -e 's@set(USE_MIMALLOC ON)@set(USE_MIMALLOC OFF)@' CMakeLists.txt mv third_party/miniz-%{miniz_version} . # # setup.py depends on this script -mv third_party/build_bundled.py . +# mv third_party/build_bundled.py . # Need the just untarred flatbuffers/flatbuffers.h mv third_party/flatbuffers . @@ -535,7 +542,7 @@ mv third_party/googletest . # Remove everything rm -rf third_party/* # Put stuff back -mv build_bundled.py third_party +# mv build_bundled.py third_party mv miniz-%{miniz_version} third_party mv flatbuffers third_party mv pybind11 third_party @@ -698,7 +705,7 @@ export USE_SYSTEM_EIGEN_INSTALL=ON export USE_SYSTEM_ONNX=ON %endif export USE_SYSTEM_PYBIND11=OFF -export USE_SYSTEM_LIBS=OFF +export USE_SYSTEM_LIBS=ON export USE_SYSTEM_NCCL=OFF export USE_TENSORPIPE=OFF export USE_XNNPACK=OFF @@ -708,7 +715,7 @@ export USE_SYSTEM_CPUINFO=ON export USE_SYSTEM_FP16=ON export USE_SYSTEM_FXDIV=ON export USE_SYSTEM_PSIMD=ON -export USE_SYSTEM_XNNPACK=OFF +export USE_SYSTEM_XNNPACK=ON export USE_DISTRIBUTED=ON %if %{with tensorpipe} @@ -717,7 +724,7 @@ export TP_BUILD_LIBUV=OFF %endif %if %{with gloo} -export USE_GLOO=ON +export USE_GLOO=OFF export USE_SYSTEM_GLOO=ON %endif %if %{with mpi} @@ -741,8 +748,8 @@ export ROCM_PATH=`hipconfig -R` # pytorch uses clang, not hipcc export HIP_CLANG_PATH=%{rocmllvm_bindir} -# export PYTORCH_ROCM_ARCH=%{rocm_gpu_list_default} -export PYTORCH_ROCM_ARCH=gfx1151 +export PYTORCH_ROCM_ARCH=%{rocm_gpu_list_default} +# export PYTORCH_ROCM_ARCH=gfx1151 %endif diff --git a/sources b/sources index 29a2107..501e7d8 100644 --- a/sources +++ b/sources @@ -1,29 +1,13 @@ -SHA512 (pytorch-v2.7.0.tar.gz) = 17e875a66f1669901f5f770c9d829ba5bfa3967296cfb71550e8a92507181db742548eaf7cc9a2c478c4b91e366f27cc480e2e1bbb328db8501d30e1649839e6 -SHA512 (v23.3.3.tar.gz) = 4066c94f2473c7ea16917d29a613e16f840a329089c88e0bdbdb999aef3442ba00abfd2aa92266fa9c067e399dc88e6f0ccac40dc151378857e665638e78bbf0 -SHA512 (v2.13.6.tar.gz) = 497c25b33b09a9c42f67131ab82e35d689e8ce089dd7639be997305ff9a6d502447b79c824508c455d559e61f0186335b54dd2771d903a7c1621833930622d1a +SHA512 (pytorch-v2.13.0.tar.gz) = 8d192f2d4ef92e4f83cef86d97f4f23fceec4fd4eaa2ff1d99267250d64785317e918617ef9b80c7cb1dfa209614444b4f427caa7a48d10911cbd2caeac1655f +SHA512 (v24.12.23.tar.gz) = f97762ba41b9cfef648e93932fd789324c6bb6ebc5b7aeca8185c9ef602294b67d73aea7ae371035579a1419cbfbeba7c3e88b31b5a5848db98f5e8a03b982b1 +SHA512 (v3.0.1.tar.gz) = c17e6d6a78c38e760864b390ac2aa7df6a94ca53acb2e8be71f0d63d611b738fa20a16946c98a93fbfcad56cb0346ebf247bbe41c6f5171c6ce68397b1e5c4db SHA512 (tensorpipe-52791a2.tar.gz) = 1e5faf17a7236c5506c08cb28be16069b11bb929bbca64ed9745ce4277d46739186ab7d6597da7437d90ed2d166d4c37ef2f3bceabe8083ef3adbb0e8e5f227e SHA512 (v1.41.0.tar.gz) = bb08a1970a10e8d9571ffea3d021643de30ec212cd51317b98d6cf0cfe55d6877992921fb01d1188a6d466687335b77885685d924f8cb7200a0bec30eee05c65 SHA512 (libnop-910b558.tar.gz) = 74c5324eaa1b6b2ac8dfef94c835b5c5b044625f8e5efe3522470b1ecc4798ff43d344a013cee2f6901e83267c6167072947b754e63f1552ae7044cffe234c36 SHA512 (v1.14.2.tar.gz) = 97635bbaf6dd567c201451dfaf7815b2052fe50d9bccc97aade86cfa4a92651374d167296a5453031b2681dc302806a289bca011a9e79ddc381a17d6118971d7 -SHA512 (cpp-httplib-3b6597b.tar.gz) = 8f1090658c498d04f14fec5c2f301847b1f3360bf92b18d82927643ee04ab61a6b274733a01c7850f9c030205120d674d1d961358d49fdd15636736fb8704f55 -SHA512 (kineto-be13176.tar.gz) = 41a08c7da9eea7d12402f80a5550c9d4df79798719cc52b12a507828c8c896ba28a37c35d8adf809ca72589e1d84965d5ef6dd01f3f8dc1c803c5ed67b03a43a -SHA512 (pytorch-a1cb3cc.tar.gz) = 92bf8b2c2ef0b459406b60169ecebdc50652c75943e3d6087e4d261f6e308dbad365529561e0f07ea3f0b71790efb68b5e4ab2f44e270462097208d924dc2d95 -SHA512 (v24.12.23.tar.gz) = f97762ba41b9cfef648e93932fd789324c6bb6ebc5b7aeca8185c9ef602294b67d73aea7ae371035579a1419cbfbeba7c3e88b31b5a5848db98f5e8a03b982b1 -SHA512 (kineto-5e75018.tar.gz) = 921b96a56e01d69895b79e67582d8977ed6f873573ab41557c5d026ada5d1f6365e4ed0a0c6804057c52e92510749fc58619f554a164c1ba9d8cd13e789bebd0 -SHA512 (pytorch-v2.8.0.tar.gz) = 791e658eab87fb957f025558cb9f925078d2426ab7b6f60771d9841dfb691f67d905ba1330a800008efe7c938b6c69bdc52232bccfe8d4860e795a532cd69d28 +SHA512 (cpp-httplib-bd95e67.tar.gz) = 17c7b1d1a3750b85ebfefcc31a2fe2cb538373b140a31058d5003a018601bbde96e82bd73b99708856c0ebecd910ac4aee5420b829cb444e3aac3ee5764dcff7 +SHA512 (kineto-b2103f7.tar.gz) = 27d9f6a8b27434e83d26ed182df1fecec1d02fc26906995e44155562a730f998f527aad3d6c8a37212255c5e2f86a607a9648edf62861f56eb2ea512c4452908 SHA512 (v1.18.0.tar.gz) = 2f38664947c8d1efc40620a7c1b1953d2aa4b0a37b67c4886b86e77c1d697363c26413413ddda8eabc545892fb1bcb43afc7e93e62f0901527524a2727e1ea8d -SHA512 (pytorch-715dca6.tar.gz) = 09c9aae54fab3eb17901fc3226fece1c13f41cb8e45a2cb066021823abeb8d27c340993088e01d8e55bb37ed5f94334ec31e6c539cddfacbad157abd27c5e907 -SHA512 (pytorch-fd36458.tar.gz) = acbb7475b92ad4a8e8d779f3745da22d8438e4c5ef2d6e76d71c987789f2752c8aef7022c87c9a74640fe4f9c1f1a61a3f12a796f63b1e6be24da8e5aacf37dc -SHA512 (pytorch-0fabc3b.tar.gz) = 2e87975de0bf6f3dcede168b379e1928712bca16170c2a8ee7d63459f53086c01baac05e0763e4d5d28cdaf1c7d8912225ee06adeff96ead4f6f456ee174b341 -SHA512 (pytorch-v2.9.0.tar.gz) = ae989e3a7fe30f9ea90944dc25e21ca92f2a94ee40d8de974a168c292d82c16ee8920624eff91a85755469ad05473dce0f85893e3ed7794ec5c6bdd89cbd2023 -SHA512 (pytorch-v2.9.1.tar.gz) = 88de0289fa2760abd69bef505b5ae3b6d7ff176b415cbb31bbc89ce5476a3800b322a97c4490f270f8b89657aff931bf9a5516202b268e0bb8b1f63dbb87b34a SHA512 (v3.19.6.tar.gz) = 8f92242f2be8e1bbfba41341c87709ad91ad83b8b3e3df88bb430411541d3399295f49291fd52b50e3487b0fce33181cb4d175685fd25aac72adfaee26a612d4 SHA512 (v80.9.0.tar.gz) = e67c6c5e74691e65ecbf24fd19c1da545434ac1674f37c917f5ecc282a00bffc62d64164a885d19f177e99a3fa53db196e2be1cf0aa6811027e61d05119682da -SHA512 (pytorch-v2.10.0.tar.gz) = 64f5c62ac9ec7189ab27a787271e2d993d3230638b43792bbf6576e8ada840323d86ebfc4262d951266281623518cca5ba87f77ca61e165fef6a670fdf5b3c50 -SHA512 (pytorch-v2.11.0.tar.gz) = e67d68245a19e65737c19f97b6d4ddd72051303abb17a734e09f1ba7ecfb3bf6a5546c826820890ad0ddfb2916b1f798175f341bda0cc3c8a83b3b852b077f3b SHA512 (MSLK-3d332d1.tar.gz) = f6bd99ec7a79321692c088e622dd2ea8f1355b137014b33e75cb7ff83922fdd07ebacf5920e2e343a48fccd74315c11861ac5c2fff29e2f2481875ecb1ae57cf -SHA512 (cpp-httplib-bd95e67.tar.gz) = 17c7b1d1a3750b85ebfefcc31a2fe2cb538373b140a31058d5003a018601bbde96e82bd73b99708856c0ebecd910ac4aee5420b829cb444e3aac3ee5764dcff7 -SHA512 (kineto-7a731b6.tar.gz) = f15347cdb210b887c1c9c9e9d91556f48b5b3fc662dce0bfa6086bce38673c568f0fc385cdd1b16a742cc709d4db5798a18c6400f24bd57f6a1b4a2eaf303d47 -SHA512 (kineto-b2103f7.tar.gz) = 27d9f6a8b27434e83d26ed182df1fecec1d02fc26906995e44155562a730f998f527aad3d6c8a37212255c5e2f86a607a9648edf62861f56eb2ea512c4452908 -SHA512 (pytorch-v2.12.0.tar.gz) = 00f900945c3a7dc33fe61ece65341d7995c13f6134b714bc246f43b06f7d091b5952e8cb3febda6931cb769c96189e6b646c179ea59601ead834fb007f0788f2 -SHA512 (v3.0.1.tar.gz) = c17e6d6a78c38e760864b390ac2aa7df6a94ca53acb2e8be71f0d63d611b738fa20a16946c98a93fbfcad56cb0346ebf247bbe41c6f5171c6ce68397b1e5c4db From 749d91ee2c96fc2d7e413d0cde294037e75f3f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Mon, 17 Aug 2026 22:16:59 +0200 Subject: [PATCH 21/22] Improve paralellism on multisocket CPU Current formula counts CPUs in first socket only. This change counts all physical cores in all sockets. I have system with two socket (each of them has 28 cores. As result the job is running with `-j 28` instead of `-j 112` and building at 25% utilization. --- python-torch.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-torch.spec b/python-torch.spec index e9e522d..a0530ef 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -632,7 +632,7 @@ sed -i -e 's@USE_MSLK_DEFAULT ON@USE_MSLK_DEFAULT OFF@' CMakeLists.txt # %ifarch x86_64 # Real cores, No hyperthreading -COMPILE_JOBS=`cat /proc/cpuinfo | grep -m 1 'cpu cores' | awk '{ print $4 }'` +COMPILE_JOBS=`lscpu -p=CORE | grep -v '^#' | sort -u |wc -l` %else # cpuinfo format varies on other arches, fall back to nproc COMPILE_JOBS=`nproc` From 74ef34969cb04786d00c45984bcdc49d095cfb12 Mon Sep 17 00:00:00 2001 From: "Alexander F. Lent" Date: Fri, 21 Aug 2026 13:05:52 -0400 Subject: [PATCH 22/22] Build with GCC, fixes build of 2.13.0 on aarch64 --- python-torch.spec | 6 ------ 1 file changed, 6 deletions(-) diff --git a/python-torch.spec b/python-torch.spec index a0530ef..a27141b 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -159,13 +159,7 @@ Source120: https://github.com/meta-pytorch/MSLK/archive/%{mslk_commit}/MSL %global pt_arches x86_64 aarch64 ExclusiveArch: %pt_arches -# Switch to clang temporarily on aarch64, GCC 16 + PyTorch 2.9.1 has problems -# See rhbz#2431943 for more info -%ifarch aarch64 -%global toolchain clang -%else %global toolchain gcc -%endif %global _lto_cflags %nil BuildRequires: cmake