Skip to content

Switch from hcSPARSE to rocSPARSE #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion cmake/public/LoadHIP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ 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(ROCBLAS_PATH ${ROCM_PATH}/rocfft)
Expand All @@ -47,7 +54,7 @@ ENDIF()

# HIPSPARSE_PATH
IF(NOT DEFINED ENV{HIPSPARSE_PATH})
SET(HIPSPARSE_PATH ${ROCM_PATH}/hcsparse)
SET(HIPSPARSE_PATH ${ROCM_PATH}/hipsparse)
ELSE()
SET(HIPSPARSE_PATH $ENV{HIPSPARSE_PATH})
ENDIF()
Expand Down Expand Up @@ -115,12 +122,14 @@ IF(HIP_FOUND)
set(rocblas_DIR ${ROCBLAS_PATH}/lib/cmake/rocblas)
set(rocfft_DIR ${ROCFFT_PATH}/lib/cmake/rocfft)
set(hipsparse_DIR ${HIPSPARSE_PATH}/lib/cmake/hipsparse)
set(rocsparse_DIR ${ROCSPARSE_PATH}/lib/cmake/rocsparse)

find_package(rocrand REQUIRED)
find_package(hiprand REQUIRED)
find_package(rocblas REQUIRED)
find_package(rocfft REQUIRED)
find_package(miopen REQUIRED)
#find_package(rocsparse REQUIRED)
#find_package(hipsparse REQUIRED)

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


Expand Down
8 changes: 0 additions & 8 deletions docker/caffe2/jenkins/common/install_rocm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ install_hip_thrust() {
git clone --recursive https://github.com/ROCmSoftwarePlatform/cub-hip.git /data/Thrust/thrust/system/cuda/detail/cub-hip
}

# This will be removed after merging an upcoming PR.
install_hcsparse() {
mkdir -p /opt/rocm/debians
curl https://s3.amazonaws.com/ossci-linux/hcsparse-master-907a505-Linux.deb -o /opt/rocm/debians/hcsparse.deb
dpkg -i /opt/rocm/debians/hcsparse.deb
}

# Install an updated version of rocRand that's PyTorch compatible.
install_rocrand() {
mkdir -p /opt/rocm/debians
Expand Down Expand Up @@ -85,5 +78,4 @@ fi

install_hip_thrust
install_rocrand
install_hcsparse
install_hipsparse
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,8 +929,8 @@ def run(self):
rocm_include_path = '/opt/rocm/include'
hcc_include_path = '/opt/rocm/hcc/include'
rocblas_include_path = '/opt/rocm/rocblas/include'
hipsparse_include_path = '/opt/rocm/hipsparse/include'
rocfft_include_path = '/opt/rocm/rocfft/include'
hipsparse_include_path = '/opt/rocm/hcsparse/include'
hiprand_include_path = '/opt/rocm/hiprand/include'
rocrand_include_path = '/opt/rocm/rocrand/include'
hip_lib_path = '/opt/rocm/hip/lib'
Expand Down
2 changes: 1 addition & 1 deletion tools/amd_build/pyHIPIFY/cuda_to_hip_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2171,7 +2171,7 @@
CUDA_SPARSE_MAP = {
"cusparseStatus_t": ("hipsparseStatus_t", CONV_MATH_FUNC, API_SPARSE),
"cusparseHandle_t": ("hipsparseHandle_t", CONV_MATH_FUNC, API_SPARSE),
"cusparseOperation_t": ("hcsparseOperation_t", CONV_TYPE, API_SPARSE),
"cusparseOperation_t": ("hipsparseOperation_t", CONV_TYPE, API_SPARSE),
"cusparseCreate": ("hipsparseCreate", CONV_MATH_FUNC, API_SPARSE),
"cusparseDestroy": ("hipsparseDestroy", CONV_MATH_FUNC, API_SPARSE),
"CUSPARSE_STATUS_SUCCESS": ("HIPSPARSE_STATUS_SUCCESS", CONV_NUMERIC_LITERAL, API_SPARSE),
Expand Down
2 changes: 1 addition & 1 deletion torch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ if(USE_ROCM)
/opt/rocm/include
/opt/rocm/hcc/include
/opt/rocm/rocblas/include
/opt/rocm/hcsparse/include
/opt/rocm/hipsparse/include
)
endif()

Expand Down