diff --git a/.gitignore b/.gitignore index 2918194..2dab732 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ /v1.18.0.tar.gz /pytorch-715dca6.tar.gz /pytorch-fd36458.tar.gz +/pytorch-0fabc3b.tar.gz diff --git a/python-torch.spec b/python-torch.spec index 3dad39d..f7f7f0c 100644 --- a/python-torch.spec +++ b/python-torch.spec @@ -6,15 +6,15 @@ # So pre releases can be tried %bcond_without gitcommit %if %{with gitcommit} -# v2.9.0-rc6 -%global commit0 fd364580a94079854f2f32d463c118afaefe62e0 +# v2.9.0-rc9 +%global commit0 0fabc3ba44823f257e70ce397d989c8de5e362c1 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) -%global date0 20251002 +%global date0 20251008 %global pypi_version 2.9.0 %global flatbuffers_version 24.12.23 %global miniz_version 3.0.2 %global pybind11_version 2.13.6 -%global rc_tag -rc6 +%global rc_tag -rc9 %else %global pypi_version 2.8.0 %global flatbuffers_version 24.12.23 @@ -117,9 +117,13 @@ Patch11: 0001-Add-cmake-variable-USE_ROCM_CK.patch Patch12: 0001-Fix-compilation-and-import-torch-issues-for-cpython-.patch %endif -# ExclusiveArch: x86_64 aarch64 -# aarch64 not building on 2.9.0-rc6 -ExclusiveArch: x86_64 +%if 0%{?fedora} >= 45 +# drop aarch64 in 45 +%global pt_arches x86_64 +%else +%global pt_arches x86_64 aarch64 +%endif +ExclusiveArch: %pt_arches %global toolchain gcc %global _lto_cflags %nil @@ -137,6 +141,9 @@ BuildRequires: gloo-devel BuildRequires: json-devel BuildRequires: libomp-devel +%if %{with gitcommit} +BuildRequires: moodycamel-concurrentqueue-devel +%endif BuildRequires: numactl-devel BuildRequires: ninja-build %if %{with onnx} @@ -205,10 +212,6 @@ BuildRequires: rocm-smi-devel BuildRequires: rocthrust-devel BuildRequires: roctracer-devel -%if %{with gitcommit} -BuildRequires: moodycamel-concurrentqueue-devel -%endif - Requires: amdsmi %endif @@ -261,6 +264,14 @@ PyTorch is a Python package that provides two high-level features: You can reuse your favorite Python packages such as NumPy, SciPy, and Cython to extend PyTorch when needed. +%package -n pytorch-rpm-macros +Summary: PyTorch RPM macros +BuildArch: noarch + +%description -n pytorch-rpm-macros +This package contains PyTorch related RPM macros. + + %if %{with test} %package -n python3-%{pypi_name}-test Summary: Tests for %{name} @@ -512,6 +523,9 @@ sed -i -e 's@${PROJECT_SOURCE_DIR}/third_party/concurrentqueue@/usr/include/conc %build +# Export the arches +echo "%%pytorch_arches %pt_arches" > macros.pytorch + # # Control the number of jobs # @@ -653,6 +667,10 @@ export PYTORCH_ROCM_ARCH=%{rocm_gpu_list_default} %install +# pytorch rpm macros +install -Dpm 644 macros.pytorch \ + %{buildroot}%{_rpmmacrodir}/macros.pytorch + %if %{with rocm} export USE_ROCM=ON export USE_ROCM_CK=OFF @@ -691,6 +709,9 @@ export PYTORCH_ROCM_ARCH=%{rocm_gpu_list_default} %{python3_sitearch}/%{pypi_name}* %{python3_sitearch}/functorch +%files -n pytorch-rpm-macros +%{_rpmmacrodir}/macros.pytorch + %changelog %autochangelog diff --git a/sources b/sources index 701e6b4..89e2a95 100644 --- a/sources +++ b/sources @@ -14,3 +14,4 @@ SHA512 (pytorch-v2.8.0.tar.gz) = 791e658eab87fb957f025558cb9f925078d2426ab7b6f60 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