Skip to content

Commit 16e2f6a

Browse files
authored
Merge pull request #168 from iotamudelta/rocsparse
Switch from hcSPARSE to rocSPARSE
2 parents 59d1430 + bf45172 commit 16e2f6a

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

cmake/public/LoadHIP.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ ELSE()
3838
SET(ROCBLAS_PATH $ENV{ROCBLAS_PATH})
3939
ENDIF()
4040

41+
# ROCSPARSE_PATH
42+
IF(NOT DEFINED ENV{ROCSPARSE_PATH})
43+
SET(ROCSPARSE_PATH ${ROCM_PATH}/rocsparse)
44+
ELSE()
45+
SET(ROCSPARSE_PATH $ENV{ROCSPARSE_PATH})
46+
ENDIF()
47+
4148
# ROCFFT_PATH
4249
IF(NOT DEFINED ENV{ROCFFT_PATH})
4350
SET(ROCBLAS_PATH ${ROCM_PATH}/rocfft)
@@ -47,7 +54,7 @@ ENDIF()
4754

4855
# HIPSPARSE_PATH
4956
IF(NOT DEFINED ENV{HIPSPARSE_PATH})
50-
SET(HIPSPARSE_PATH ${ROCM_PATH}/hcsparse)
57+
SET(HIPSPARSE_PATH ${ROCM_PATH}/hipsparse)
5158
ELSE()
5259
SET(HIPSPARSE_PATH $ENV{HIPSPARSE_PATH})
5360
ENDIF()
@@ -115,12 +122,14 @@ IF(HIP_FOUND)
115122
set(rocblas_DIR ${ROCBLAS_PATH}/lib/cmake/rocblas)
116123
set(rocfft_DIR ${ROCFFT_PATH}/lib/cmake/rocfft)
117124
set(hipsparse_DIR ${HIPSPARSE_PATH}/lib/cmake/hipsparse)
125+
set(rocsparse_DIR ${ROCSPARSE_PATH}/lib/cmake/rocsparse)
118126

119127
find_package(rocrand REQUIRED)
120128
find_package(hiprand REQUIRED)
121129
find_package(rocblas REQUIRED)
122130
find_package(rocfft REQUIRED)
123131
find_package(miopen REQUIRED)
132+
#find_package(rocsparse REQUIRED)
124133
#find_package(hipsparse REQUIRED)
125134

126135
# TODO: hip_hcc has an interface include flag "-hc" which is only
@@ -132,6 +141,7 @@ IF(HIP_FOUND)
132141
# however currently it's just the lib name
133142
FIND_LIBRARY(PYTORCH_MIOPEN_LIBRARIES ${miopen_LIBRARIES} HINTS ${MIOPEN_PATH}/lib)
134143
FIND_LIBRARY(hiprand_LIBRARIES hiprand HINTS ${HIPRAND_PATH}/lib)
144+
FIND_LIBRARY(rocsparse_LIBRARIES rocsparse HINTS ${ROCSPARSE_PATH}/lib)
135145
FIND_LIBRARY(hipsparse_LIBRARIES hipsparse HINTS ${HIPSPARSE_PATH}/lib)
136146

137147

docker/caffe2/jenkins/common/install_rocm.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,6 @@ install_hip_thrust() {
5050
git clone --recursive https://github.com/ROCmSoftwarePlatform/cub-hip.git /data/Thrust/thrust/system/cuda/detail/cub-hip
5151
}
5252

53-
# This will be removed after merging an upcoming PR.
54-
install_hcsparse() {
55-
mkdir -p /opt/rocm/debians
56-
curl https://s3.amazonaws.com/ossci-linux/hcsparse-master-907a505-Linux.deb -o /opt/rocm/debians/hcsparse.deb
57-
dpkg -i /opt/rocm/debians/hcsparse.deb
58-
}
59-
6053
# Install an updated version of rocRand that's PyTorch compatible.
6154
install_rocrand() {
6255
mkdir -p /opt/rocm/debians
@@ -85,5 +78,4 @@ fi
8578

8679
install_hip_thrust
8780
install_rocrand
88-
install_hcsparse
8981
install_hipsparse

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,8 +929,8 @@ def run(self):
929929
rocm_include_path = '/opt/rocm/include'
930930
hcc_include_path = '/opt/rocm/hcc/include'
931931
rocblas_include_path = '/opt/rocm/rocblas/include'
932+
hipsparse_include_path = '/opt/rocm/hipsparse/include'
932933
rocfft_include_path = '/opt/rocm/rocfft/include'
933-
hipsparse_include_path = '/opt/rocm/hcsparse/include'
934934
hiprand_include_path = '/opt/rocm/hiprand/include'
935935
rocrand_include_path = '/opt/rocm/rocrand/include'
936936
hip_lib_path = '/opt/rocm/hip/lib'

tools/amd_build/pyHIPIFY/cuda_to_hip_mappings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2171,7 +2171,7 @@
21712171
CUDA_SPARSE_MAP = {
21722172
"cusparseStatus_t": ("hipsparseStatus_t", CONV_MATH_FUNC, API_SPARSE),
21732173
"cusparseHandle_t": ("hipsparseHandle_t", CONV_MATH_FUNC, API_SPARSE),
2174-
"cusparseOperation_t": ("hcsparseOperation_t", CONV_TYPE, API_SPARSE),
2174+
"cusparseOperation_t": ("hipsparseOperation_t", CONV_TYPE, API_SPARSE),
21752175
"cusparseCreate": ("hipsparseCreate", CONV_MATH_FUNC, API_SPARSE),
21762176
"cusparseDestroy": ("hipsparseDestroy", CONV_MATH_FUNC, API_SPARSE),
21772177
"CUSPARSE_STATUS_SUCCESS": ("HIPSPARSE_STATUS_SUCCESS", CONV_NUMERIC_LITERAL, API_SPARSE),

torch/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ if(USE_ROCM)
349349
/opt/rocm/include
350350
/opt/rocm/hcc/include
351351
/opt/rocm/rocblas/include
352-
/opt/rocm/hcsparse/include
352+
/opt/rocm/hipsparse/include
353353
)
354354
endif()
355355

0 commit comments

Comments
 (0)