Skip to content
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

Cusparse-hipsparse integration #53

Merged
merged 30 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
39bf615
include cusparse in cupy build
bmedishe Apr 23, 2024
60c8a73
make cusparse.pyx use cusparse_hip
bmedishe Apr 24, 2024
fb75777
update cusparse.pxd
bmedishe Apr 24, 2024
b005cca
remove tydep of hipsparsestatus to cusparsestatus
bmedishe Apr 25, 2024
734e1bf
update cusparse.pxd
bmedishe Apr 26, 2024
8f69f8e
update cupy_backends/cuda/libs/cusparse.pxd
bmedishe Apr 26, 2024
0fd31ec
remove definitions of cusparse apis with hip mappings
bmedishe Apr 26, 2024
18fd7d9
update softlink for hipsparse
bmedishe Apr 29, 2024
5f572d6
only missing cusparse mappings supported here
bmedishe Apr 29, 2024
c9edf6f
replace cusparseStatus with hip
bmedishe Apr 29, 2024
5962684
update cupy_backends/cuda/libs/cusparse.pxd
bmedishe Apr 29, 2024
0c04b24
update cupy_backends/hip/cupy_hipsparse.h
bmedishe Apr 29, 2024
4e4f2cc
update cupy_backends/hip/cupy_hipsparse.h
bmedishe Apr 30, 2024
832f7b3
version code from cupy_backends/hip/cupy_hipsparse.h moved to cupy_ba…
bmedishe May 7, 2024
c40dde3
update cupy_backends/cuda/libs/cusparse.pxd with unspported enums
bmedishe May 7, 2024
9f9e75c
is_hip_environment to runtime._is_hip_environment
bmedishe May 7, 2024
15c4574
version_check grouped and in cupy_backends/hip/cupy_hipsparse.h
bmedishe May 7, 2024
81e820d
prasanth comment for cuda build fail
bmedishe May 14, 2024
640989a
missing version checks
bmedishe May 14, 2024
a640e20
flake W293 E303 errors fixed in cusparse.pyx , pxd
bmedishe May 17, 2024
48e3497
add more version checks
bmedishe May 21, 2024
cec6c0c
hipsparseCsr2CscAlg_t
bmedishe May 21, 2024
f6e6e8a
update cupy_backends/hip/cupy_hipsparse.h
bmedishe May 21, 2024
1be845c
flake8 E501 errors
bmedishe May 21, 2024
54da486
flake8 errors
bmedishe Jun 3, 2024
65e89d0
rocm backward compatibility
bmedishe Jun 4, 2024
a7e05c3
HIP_VERSION updated
bmedishe Jun 5, 2024
b607493
change hip_version from 3 digits to 8 digits for backwrd compat
bmedishe Jun 5, 2024
b151336
more backward compatibility updates
bmedishe Jun 5, 2024
073075f
backward compatibility fix
bmedishe Jun 5, 2024
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
145 changes: 73 additions & 72 deletions cupy_backends/cuda/libs/cusparse.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ cpdef enum:
CUSPARSE_SOLVE_POLICY_NO_LEVEL = 0
CUSPARSE_SOLVE_POLICY_USE_LEVEL = 1

CUSPARSE_ALG_NAIVE = 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are only these two enums removed from here and moved under the IF condition?

Copy link

@lcskrishna lcskrishna May 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bmedishe Could you review this one with 6.0_internal_testing branch. Looks like these enum values shouldn't be re-ordered..

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lcskrishna these two enums do not have hip mapping

CUSPARSE_ALG_MERGE_PATH = 1

# Enums for cuSparse generic API
CUSPARSE_FORMAT_CSR = 1 # Compressed Sparse Row (CSR)
CUSPARSE_FORMAT_CSC = 2 # Compressed Sparse Column (CSC)
Expand Down Expand Up @@ -149,72 +146,76 @@ cpdef enum:

# cusparseDenseToSparseAlg_t
CUSPARSE_DENSETOSPARSE_ALG_DEFAULT = 0

cdef class SpVecAttributes:
cdef:
public int64_t size
public int64_t nnz
public intptr_t idx
public intptr_t values
public IndexType idxType
public IndexBase idxBase
public DataType valueType

cdef class CooAttributes:
cdef:
public int64_t rows
public int64_t cols
public int64_t nnz
public intptr_t rowIdx
public intptr_t colIdx
public intptr_t values
public IndexType idxType
public IndexBase idxBase
public DataType valueType

cdef class CooAoSAttributes:
cdef:
public int64_t rows
public int64_t cols
public int64_t nnz
public intptr_t ind
public intptr_t values
public IndexType idxType
public IndexBase idxBase
public DataType valueType

cdef class CsrAttributes:
cdef:
public int64_t rows
public int64_t cols
public int64_t nnz
public intptr_t rowOffsets
public intptr_t colIdx
public intptr_t values
public IndexType rowOffsetType
public IndexType colIdxType
public IndexBase idxBase
public DataType valueType

cdef class DnVecAttributes:
cdef:
public int64_t size
public intptr_t values
public DataType valueType

cdef class DnMatAttributes:
cdef:
public int64_t rows
public int64_t cols
public int64_t ld
public intptr_t values
public DataType valueType
public Order order

cdef class DnMatBatchAttributes:
cdef:
public int count
public int64_t stride

cpdef intptr_t create() except? 0
cpdef void destroy(intptr_t handle) except *
IF CUPY_HIP_VERSION == 0:
cpdef enum:
CUSPARSE_ALG_NAIVE = 0
CUSPARSE_ALG_MERGE_PATH = 1

cdef class SpVecAttributes:
cdef:
public int64_t size
public int64_t nnz
public intptr_t idx
public intptr_t values
public IndexType idxType
public IndexBase idxBase
public DataType valueType

cdef class CooAttributes:
cdef:
public int64_t rows
public int64_t cols
public int64_t nnz
public intptr_t rowIdx
public intptr_t colIdx
public intptr_t values
public IndexType idxType
public IndexBase idxBase
public DataType valueType

cdef class CooAoSAttributes:
cdef:
public int64_t rows
public int64_t cols
public int64_t nnz
public intptr_t ind
public intptr_t values
public IndexType idxType
public IndexBase idxBase
public DataType valueType

cdef class CsrAttributes:
cdef:
public int64_t rows
public int64_t cols
public int64_t nnz
public intptr_t rowOffsets
public intptr_t colIdx
public intptr_t values
public IndexType rowOffsetType
public IndexType colIdxType
public IndexBase idxBase
public DataType valueType

cdef class DnVecAttributes:
cdef:
public int64_t size
public intptr_t values
public DataType valueType

cdef class DnMatAttributes:
cdef:
public int64_t rows
public int64_t cols
public int64_t ld
public intptr_t values
public DataType valueType
public Order order

cdef class DnMatBatchAttributes:
cdef:
public int count
public int64_t stride

cpdef intptr_t create() except? 0
cpdef void destroy(intptr_t handle) except *
Loading
Loading