A working --with gitcommit --with rocm

Signed-off-by: Tom Rix <trix@redhat.com>
This commit is contained in:
Tom Rix 2024-02-04 07:39:22 -05:00
commit 1bcf75f50a
2 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,34 @@
From 4248211ce9a9de81bb3ade5d421ba709b19ead08 Mon Sep 17 00:00:00 2001
From: Tom Rix <trix@redhat.com>
Date: Sat, 3 Feb 2024 15:01:28 -0500
Subject: [PATCH] use any hip
---
cmake/public/LoadHIP.cmake | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmake/public/LoadHIP.cmake b/cmake/public/LoadHIP.cmake
index 1abeb06228..28458c4146 100644
--- a/cmake/public/LoadHIP.cmake
+++ b/cmake/public/LoadHIP.cmake
@@ -30,7 +30,7 @@ endif()
message("Building PyTorch for GPU arch: ${PYTORCH_ROCM_ARCH}")
# Add HIP to the CMAKE Module Path
-set(CMAKE_MODULE_PATH ${ROCM_PATH}/lib/cmake/hip ${CMAKE_MODULE_PATH})
+set(CMAKE_MODULE_PATH ${ROCM_PATH}/lib64/cmake/hip ${CMAKE_MODULE_PATH})
macro(find_package_and_print_version PACKAGE_NAME)
find_package("${PACKAGE_NAME}" ${ARGN})
@@ -38,7 +38,7 @@ macro(find_package_and_print_version PACKAGE_NAME)
endmacro()
# Find the HIP Package
-find_package_and_print_version(HIP 1.0)
+find_package_and_print_version(HIP MODULE)
if(HIP_FOUND)
set(PYTORCH_FOUND_HIP TRUE)
--
2.43.0

View file

@ -61,6 +61,7 @@ Patch5: 0001-disable-submodule-search.patch
Patch100: 0001-cuda-hip-signatures.patch
Patch101: 0001-silence-an-assert.patch
Patch102: 0001-can-not-use-with-c-files.patch
Patch103: 0001-use-any-hip.patch
%endif
%else
@ -325,6 +326,7 @@ export USE_NCCL=OFF
export BUILD_NVFUSER=OFF
export HIP_PATH=%{_prefix}
export ROCM_PATH=%{_prefix}
export DEVICE_LIB_PATH=/usr/lib/clang/17/amdgcn/bitcode
%else
export USE_ROCM=OFF
%endif
@ -343,6 +345,13 @@ export USE_XNNPACK=ON
%py3_build
%install
%if %{with rocm}
export USE_ROCM=ON
export HIP_PATH=%{_prefix}
export ROCM_PATH=%{_prefix}
export DEVICE_LIB_PATH=/usr/lib/clang/17/amdgcn/bitcode
%endif
%py3_install
# empty files
@ -403,6 +412,11 @@ sed -i -f br.sed devel.files
%{python3_sitearch}/torch/lib/libtorch_cpu.so
%{python3_sitearch}/torch/lib/libtorch_global_deps.so
%{python3_sitearch}/torch/lib/libtorch_python.so
%if %{with rocm}
%{python3_sitearch}/torch/lib/libc10_hip.so
%{python3_sitearch}/torch/lib/libcaffe2_nvrtc.so
%{python3_sitearch}/torch/lib/libtorch_hip.so
%endif
# misc
%{python3_sitearch}/torch/utils/model_dump/{*.js,*.mjs,*.html}