Update gitcommit to 2.12

Signed-off-by: Tom Rix <Tom.Rix@amd.com>
This commit is contained in:
Tom Rix 2026-06-19 10:10:06 -07:00
commit 52842c0aea
5 changed files with 323 additions and 47 deletions

View file

@ -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