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

Consider dropping cub::DeviceSpmv in favor of cuSPARSE #3070

Open
2 tasks done
Tracked by #101
bernhardmgruber opened this issue Dec 6, 2024 · 4 comments
Open
2 tasks done
Tracked by #101

Consider dropping cub::DeviceSpmv in favor of cuSPARSE #3070

bernhardmgruber opened this issue Dec 6, 2024 · 4 comments
Assignees

Comments

@bernhardmgruber
Copy link
Contributor

bernhardmgruber commented Dec 6, 2024

CUB offers an implementation of sparse matrix-vector multiplication. But so does cuSPARSE. We should investigate whether

  • cuSPARSE offers at least the same functionality as CUB
  • and reaches at least the same performance.

If both are the case, we should deprecate cub::DeviceSpmv with a note that users should switch to cuSPARSE and eventually remove it.

@github-project-automation github-project-automation bot moved this to Todo in CCCL Dec 6, 2024
@bernhardmgruber bernhardmgruber changed the title Consider dropping SpMV in favor of cuSPARSE Consider dropping cub::DeviceSpmv in favor of cuSPARSE Dec 6, 2024
@fbusato
Copy link
Contributor

fbusato commented Jan 9, 2025

cuSPARSE offers at least the same functionality as CUB

cusparseSpMV features not supported by CUB:

  • Host/device coefficients alpha and beta.
  • 64-bit offset and column indices.
  • 64-bit for matrix sizes and number of non-zeros.
  • Transpose/conjugate.
  • Mixed-precision computation, i.e. different input, output, and compute types. Including mixed regular/complex types.
  • Deterministic run-to-run results.
  • Optional preprocessing for performance improvements.
  • Other formats beyond CSR, e.g. COO, CSC, Sliced-ELL.

On the other hand, CUB is open-source. It supports any user-provided data types and operators.
(custom operators can be specified with cusparseSpMMOp which relies on JIT).

and reaches at least the same performance.

cuSPARSE SpMV is based on a different algorithm than merge-path that provides theoretical guarantees of better performance, especially for heavily unbalanced matrices. Internal experiments have proven better performance for recent architectures (Ampere, Hopper).

My personal opinion is to drop CUB SpMV for the following reasons:

  • A bit out of scope of the CUB library.
  • If we decide to keep it, we should also consider
    • extending it for other very popular formats, such as COO.
    • extending CUB for other very common algorithms, such as multiple RHS (SpMM).
    • optimize and maintain it.

@fbusato fbusato moved this from Todo to In Review in CCCL Jan 9, 2025
@leofang
Copy link
Member

leofang commented Jan 10, 2025

I am in favor of just dropping it

@miscco
Copy link
Collaborator

miscco commented Jan 10, 2025

+1 for dropping

@bernhardmgruber
Copy link
Contributor Author

drop it like it's hot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

No branches or pull requests

4 participants