summarylogtreecommitdiffstats
path: root/python-pytorch-goo-rocm-6.patch
blob: 8914e1d1c76d838734b549b30991b6f81af3cf61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
From 2cbcef29a6aff241896a86c719195f1757bfd1b8 Mon Sep 17 00:00:00 2001
From: Pruthvi Madugundu <pruthvigithub@gmail.com>
Date: Fri, 13 Oct 2023 19:09:01 -0700
Subject: [PATCH] Updates to Hip.cmake to support recent ROCm (#371)

Summary:
- Remove deprecated HIP_PATH
- Cleanup of unused variables

Pull Request resolved: https://github.com/facebookincubator/gloo/pull/371

Reviewed By: kit1980

Differential Revision: D50140546

Pulled By: malfet

fbshipit-source-id: 004bca04ba415df37c181652dfcd4e36353d769d
---
 cmake/Hip.cmake | 103 ++----------------------------------------------
 1 file changed, 4 insertions(+), 99 deletions(-)

diff --git a/cmake/Hip.cmake b/cmake/Hip.cmake
index 31a03e7b9..18a3c075b 100644
--- a/cmake/Hip.cmake
+++ b/cmake/Hip.cmake
@@ -6,102 +6,14 @@ ELSE()
   SET(ROCM_PATH $ENV{ROCM_PATH})
 ENDIF()
 
-# HIP_PATH
-IF(NOT DEFINED ENV{HIP_PATH})
-  SET(HIP_PATH ${ROCM_PATH}/hip)
-ELSE()
-  SET(HIP_PATH $ENV{HIP_PATH})
-ENDIF()
-
-IF(NOT EXISTS ${HIP_PATH})
-  return()
-ENDIF()
-
-# HCC_PATH
-IF(NOT DEFINED ENV{HCC_PATH})
-  SET(HCC_PATH ${ROCM_PATH}/hcc)
-ELSE()
-  SET(HCC_PATH $ENV{HCC_PATH})
-ENDIF()
-
-# HSA_PATH
-IF(NOT DEFINED ENV{HSA_PATH})
-  SET(HSA_PATH ${ROCM_PATH}/hsa)
-ELSE()
-  SET(HSA_PATH $ENV{HSA_PATH})
-ENDIF()
-
-# ROCBLAS_PATH
-IF(NOT DEFINED ENV{ROCBLAS_PATH})
-  SET(ROCBLAS_PATH ${ROCM_PATH}/rocblas)
-ELSE()
-  SET(ROCBLAS_PATH $ENV{ROCBLAS_PATH})
-ENDIF()
-
-# ROCSPARSE_PATH
-IF(NOT DEFINED ENV{ROCSPARSE_PATH})
-  SET(ROCSPARSE_PATH ${ROCM_PATH}/rocsparse)
-ELSE()
-  SET(ROCSPARSE_PATH $ENV{ROCSPARSE_PATH})
-ENDIF()
-
-# ROCFFT_PATH
-IF(NOT DEFINED ENV{ROCFFT_PATH})
-  SET(ROCFFT_PATH ${ROCM_PATH}/rocfft)
-ELSE()
-  SET(ROCFFT_PATH $ENV{ROCFFT_PATH})
-ENDIF()
-
-# HIPSPARSE_PATH
-IF(NOT DEFINED ENV{HIPSPARSE_PATH})
-  SET(HIPSPARSE_PATH ${ROCM_PATH}/hipsparse)
-ELSE()
-  SET(HIPSPARSE_PATH $ENV{HIPSPARSE_PATH})
-ENDIF()
-
-# THRUST_PATH
-IF(DEFINED ENV{THRUST_PATH})
-  SET(THRUST_PATH $ENV{THRUST_PATH})
-ELSE()
-  SET(THRUST_PATH ${ROCM_PATH}/include)
-ENDIF()
-
-# HIPRAND_PATH
-IF(NOT DEFINED ENV{HIPRAND_PATH})
-  SET(HIPRAND_PATH ${ROCM_PATH}/hiprand)
-ELSE()
-  SET(HIPRAND_PATH $ENV{HIPRAND_PATH})
-ENDIF()
-
-# ROCRAND_PATH
-IF(NOT DEFINED ENV{ROCRAND_PATH})
-  SET(ROCRAND_PATH ${ROCM_PATH}/rocrand)
-ELSE()
-  SET(ROCRAND_PATH $ENV{ROCRAND_PATH})
-ENDIF()
-
-# MIOPENGEMM
-IF(NOT DEFINED ENV{MIOPENGEMM_PATH})
-  SET(MIOPENGEMM_PATH ${ROCM_PATH}/miopengemm)
-ELSE()
-  SET(MIOPENGEMM_PATH $ENV{MIOPENGEMM_PATH})
-ENDIF()
-
-# MIOPEN_PATH
-IF(NOT DEFINED ENV{MIOPEN_PATH})
-  SET(MIOPEN_PATH ${ROCM_PATH}/miopen)
-ELSE()
-  SET(MIOPEN_PATH $ENV{MIOPEN_PATH})
-ENDIF()
-
 IF(NOT DEFINED ENV{GLOO_ROCM_ARCH})
-  SET(GLOO_ROCM_ARCH gfx900;gfx906)
+  SET(GLOO_ROCM_ARCH gfx906;gfx908;gfx90a)
 ELSE()
   SET(GLOO_ROCM_ARCH $ENV{GLOO_ROCM_ARCH})
 ENDIF()
 
 # Add HIP to the CMAKE Module Path
-set(CMAKE_MODULE_PATH ${HIP_PATH}/cmake ${CMAKE_MODULE_PATH})
+set(CMAKE_MODULE_PATH ${ROCM_PATH}/lib/cmake/hip ${CMAKE_MODULE_PATH})
 
 # Disable Asserts In Code (Can't use asserts on HIP stack.)
 ADD_DEFINITIONS(-DNDEBUG)
@@ -112,19 +24,12 @@ find_package(HIP 1.0)
 IF(HIP_FOUND)
   set(HAVE_HIP TRUE)
 
-  if(HIP_COMPILER STREQUAL clang)
-    set(hip_library_name amdhip64)
-  else()
-    set(hip_library_name hip_hcc)
-  endif()
+  set(hip_library_name amdhip64)
   message("HIP library name: ${hip_library_name}")
 
   set(CMAKE_HCC_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
   set(CMAKE_HCC_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
-  FIND_LIBRARY(GLOO_HIP_HCC_LIBRARIES ${hip_library_name} HINTS ${HIP_PATH}/lib)
-  # Necessary includes for building Gloo since we include HIP headers that depend on hcc/hsa headers.
-  set(hcc_INCLUDE_DIRS ${HCC_PATH}/include)
-  set(hsa_INCLUDE_DIRS ${HSA_PATH}/include)
+  FIND_LIBRARY(GLOO_HIP_HCC_LIBRARIES ${hip_library_name} HINTS ${ROCM_PATH}/lib)
 
 ENDIF()