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

Workaround for cuda 12 issue in cusparse #1508

Merged
Merged
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
7 changes: 6 additions & 1 deletion cpp/include/raft/spectral/detail/matrix_wrappers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,11 @@ struct sparse_matrix_t {
cusparseDnVecDescr_t vecX;
RAFT_CUSPARSE_TRY(raft::sparse::detail::cusparsecreatednvec(&vecX, size_x, x));

rmm::device_uvector<value_type> y_tmp(size_y, stream);
raft::copy(y_tmp.data(), y, size_y, stream);

cusparseDnVecDescr_t vecY;
RAFT_CUSPARSE_TRY(raft::sparse::detail::cusparsecreatednvec(&vecY, size_y, y));
RAFT_CUSPARSE_TRY(raft::sparse::detail::cusparsecreatednvec(&vecY, size_y, y_tmp.data()));

// get (scratch) external device buffer size:
//
Expand All @@ -241,6 +244,8 @@ struct sparse_matrix_t {
RAFT_CUSPARSE_TRY(raft::sparse::detail::cusparsespmv(
cusparse_h, trans, &alpha, matA, vecX, &beta, vecY, spmv_alg, external_buffer.raw(), stream));

// FIXME: This is a workaround for a cusparse issue being encountered in CUDA 12
Copy link
Member

Choose a reason for hiding this comment

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

Is there a link to a github issue for this problem that we can add here?

raft::copy(y, y_tmp.data(), size_y, stream);
// free descriptors:
//(TODO: maybe wrap them in a RAII struct?)
//
Expand Down