Skip to content

Commit

Permalink
Update pytorch to 2.4.0 which has riscv support
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar authored Jul 25, 2024
1 parent 555b1b7 commit b2dddc0
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions pytorch.spec
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
### RPM external pytorch 2.3.1
### RPM external pytorch 2.4.0
## INCLUDE cuda-flags
## INCLUDE microarch_flags

%define cuda_arch_float $(echo %{cuda_arch} | tr ' ' '\\n' | sed -E 's|([0-9])$|.\\1|' | tr '\\n' ' ')
%define tag 63d5e9221bedd1546b7d364b5ce4171547db12a9
%define branch cms/v%{realversion}

Source: git+https://github.com/cms-externals/pytorch.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz
Source: git+https://github.com/pytorch/pytorch.git?obj=main/v%{realversion}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz
Source1: FindEigen3.cmake
Source2: FindFMT.cmake
Source99: scram-tools.file/tools/eigen/env
Patch0: pytorch-ignore-different-cuda-include-dir
Patch1: pytorch-missing-braces
Patch2: pytorch-system-fmt

BuildRequires: cmake ninja
Requires: eigen fxdiv numactl openmpi protobuf psimd python3 py3-PyYAML
Requires: OpenBLAS zlib protobuf fmt py3-pybind11 py3-typing-extensions
%{!?without_cuda:Requires: cuda cudnn}
#%{!?without_rocm:Requires: rocm rocm-rocrand}

%prep
%setup -n %{n}-%{realversion}
#%patch0 -p1
%patch1 -p1
%patch2 -p1

Expand All @@ -32,17 +27,12 @@ rm -rf ../build && mkdir ../build && cd ../build
source %{_sourcedir}/env

USE_CUDA=OFF
%if "%{cmsos}" != "slc7_aarch64"
%if 0%{!?without_cuda:1}
if [ "%{cuda_gcc_support}" = "true" ] ; then
USE_CUDA=%{!?without_cuda:ON}
USE_CUDA=ON
fi
%endif

#%if 0%{!?without_rocm:1}
#export ROCM_PATH=${ROCM_ROOT}
#export PYTORCH_ROCM_ARCH=gfx900,gfx906,gfx908,gfx90a,gfx1030
#%endif

cmake ../%{n}-%{realversion} \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=%{i} \
Expand Down

0 comments on commit b2dddc0

Please sign in to comment.