diff --git a/download b/download new file mode 100644 index 0000000000000000000000000000000000000000..e3eba1a46c5c06065ca0599e473534772d561e47 --- /dev/null +++ b/download @@ -0,0 +1 @@ +6186b06618415e1c4a2c9f057893c4f0 pytorch-v2.0.1.tar.gz diff --git a/pytorch-onednn.patch b/pytorch-onednn.patch new file mode 100644 index 0000000000000000000000000000000000000000..4cda8a40c7bde40bb7ae7d35113925bd109a4b91 --- /dev/null +++ b/pytorch-onednn.patch @@ -0,0 +1,29 @@ +diff --git a/aten/src/ATen/Version.cpp b/aten/src/ATen/Version.cpp +index 0c0ea61c..cff309a9 100644 +--- a/aten/src/ATen/Version.cpp ++++ b/aten/src/ATen/Version.cpp +@@ -6,7 +6,7 @@ + #endif + + #if AT_MKLDNN_ENABLED() +-#include ++#include + #include + #endif + +@@ -42,12 +42,12 @@ std::string get_mkldnn_version() { + // Apparently no way to get ideep version? + // https://github.com/intel/ideep/issues/29 + { +- const mkldnn_version_t* ver = mkldnn_version(); +- ss << "Intel(R) MKL-DNN v" << ver->major << "." << ver->minor << "." << ver->patch ++ const dnnl_version_t* ver = dnnl_version(); ++ ss << "Intel(R) ONEDNN v" << ver->major << "." << ver->minor << "." << ver->patch + << " (Git Hash " << ver->hash << ")"; + } + #else +- ss << "MKLDNN not found"; ++ ss << "ONEDNN not found"; + #endif + return ss.str(); + } diff --git a/pytorch-v2.0.1.tar.gz b/pytorch-v2.0.1.tar.gz deleted file mode 100644 index 823edfbe38f2da309a81a3661394d2afa1e52ea3..0000000000000000000000000000000000000000 Binary files a/pytorch-v2.0.1.tar.gz and /dev/null differ diff --git a/pytorch.spec b/pytorch.spec index 469e76463d0542da47a751178e813cf5803acf55..9c34a71c832a9a66bf549add5f879120fe809169 100644 --- a/pytorch.spec +++ b/pytorch.spec @@ -1,3 +1,4 @@ + %global vcu_maj 12 %global vcu_min 1 @@ -92,6 +93,9 @@ BuildRequires: clang %if %{have_cuda} %if %{have_cuda_gcc} %if "%{toolchain}" == "gcc" +%if 0%{?fedora} > 34 +BuildRequires: cuda-gcc-c++ +%endif %endif %endif BuildRequires: cuda-nvcc-%{vcu_maj}-%{vcu_min} @@ -144,7 +148,6 @@ This package contains development files for pythorch. Summary: Python files for pytorch Provides: python%{python3_version}dist(torch) = %{version} Requires: %{name} = %{version}-%{release} -#Requires: %{name}-devel = %{version}-%{release} %description python3 This package contains python files for pythorch. @@ -215,10 +218,10 @@ sed -i '/TARGET cpuinfo PROPERTY/d' cmake/Dependencies.cmake sed -i '/APPEND Caffe2_DEPENDENCY_LIBS fp16/d' cmake/Dependencies.cmake # external qnnpack -#mkdir -p third_party/QNNPACK -#echo '' >> third_party/QNNPACK/CMakeLists.txt -#sed -i '/TARGET qnnpack PROPERTY/d' cmake/Dependencies.cmake -#sed -i -e '/target_compile_options(qnnpack/d' cmake/Dependencies.cmake +mkdir -p third_party/QNNPACK +echo '' >> third_party/QNNPACK/CMakeLists.txt +sed -i '/TARGET qnnpack PROPERTY/d' cmake/Dependencies.cmake +sed -i -e '/target_compile_options(qnnpack/d' cmake/Dependencies.cmake #sed -i 's/QNNPACK_LIBRARY_TYPE \"static\"/QNNPACK_LIBRARY_TYPE \"shared\"/g' cmake/Dependencies.cmake # external psimd @@ -322,6 +325,7 @@ export PYTHON_EXECUTABLE="%{__python3}" %global optflags %(echo "%{optflags} -w -fpermissive -Wno-sign-compare -Wno-deprecated-declarations -Wno-nonnull -DEIGEN_HAS_CXX11_MATH=1" | sed 's|-g||') # -DUSE_NATIVE_ARCH=ON export LDFLAGS="-Wl,-lstdc++" +export CFLAGS="${CFLAGS} -fPIC" #export LD_LIBRARY_PATH="/usr/local/cuda-%{vcu_maj}.%{vcu_min}/%{_lib}/" %cmake .. -Wno-dev \ -DCMAKE_SKIP_RPATH=ON \ @@ -394,14 +398,17 @@ export LDFLAGS="-Wl,-lstdc++" -DUSE_LMDB=ON \ -DUSE_REDIS=ON \ -DUSE_LEVELDB=ON \ +%if 0%{?fedora} >= 30 + -DUSE_ROCKSDB=ON \ +%else -DUSE_ROCKSDB=OFF \ +%endif -DUSE_FFMPEG=OFF \ -DUSE_OPENCV=ON \ -DUSE_METAL=OFF \ -DUSE_TBB=OFF \ -DUSE_LLVM=OFF \ - -DATEN_NO_TEST=ON \ - -DUSE_MOBILE=OFF + -DATEN_NO_TEST=ON make %{?_smp_mflags} popd @@ -425,7 +432,7 @@ popd install -D -pm 755 build/lib/libnnapi_backend.so %{buildroot}/%{_libdir}/ mkdir -p %{buildroot}/%{python3_sitearch}/torch/bin -#install -D -pm 644 build/lib/_C.so %{buildroot}/%{python3_sitearch}/torch/ +install -D -pm 644 build/lib/_C.so %{buildroot}/%{python3_sitearch}/torch/ #install -D -pm 644 build/lib/_dl.so %{buildroot}/%{python3_sitearch}/torch/ mkdir -p %{buildroot}/%{_includedir}/THC/ install -D -pm 644 aten/src/THC/THCDeviceUtils.cuh %{buildroot}/%{_includedir}/THC/ @@ -502,20 +509,13 @@ set -x %doc CONTRIBUTING.md %license LICENSE %{_bindir}/* -#%{_libdir}/nvfuser.so %{_libdir}/libshm.so.* %{_libdir}/libc10.so.* -#%{_libdir}/libc10_cuda.so %{_libdir}/libtorch.so.* %{_libdir}/libtorch_cpu.so.* -#%{_libdir}/libtorch_cuda.so -#%{_libdir}/libnvfuser_codegen.so %{_libdir}/libtorch_global_deps.so.* %{_libdir}/libcaffe2_observers.so.* -#%{_libdir}/libcaffe2_detectron_ops_gpu.so -#%{_libdir}/libcaffe2_nvrtc.so %{_libdir}/libnnapi_backend.so -#%{_libdir}/libtorch_cuda_linalg.so %{_libdir}/libcaffe2_detectron_ops.so* %{_libdir}/libshm.so %{_libdir}/libc10.so @@ -534,5 +534,5 @@ set -x %changelog -* Fri Jun 16 2023 forrest_ly - 2.0.1-1 +* Fri Jun 16 2023 forrest_ly - 2.0.1-1 - init for anolis 23