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: Eagerly combine duplicate element on construction. #2213

Merged
merged 2 commits into from
Jan 4, 2024

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Jan 2, 2024

Fixes #2185.

This turned out relatively tricky, as I couldn't find much info on how CUSPARSE handles duplicate entries. Some operations seemed to do so, as shown in the linked issue, however the SparseArrays.sparse function requires support for an arbitrary combinator function. To support that, and make printing work, I added the functionality to eagerly combine duplicate values (requiring 3 kernel launches, O(nnzval)).

cc @amontoison, maybe you can review? Can't add you as a reviewer here, maybe it's time to invite you to the JuliaGPU org :-)

@maleadt maleadt added enhancement New feature or request cuda array Stuff about CuArray. cuda libraries Stuff about CUDA library wrappers. labels Jan 2, 2024
@maleadt maleadt marked this pull request as draft January 2, 2024 12:57
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

Attention: 29 lines in your changes are missing coverage. Please review.

Comparison is base (fc23949) 72.84% compared to head (75e9777) 61.39%.

Files Patch % Lines
lib/cusparse/conversions.jl 51.66% 29 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2213       +/-   ##
===========================================
- Coverage   72.84%   61.39%   -11.46%     
===========================================
  Files         159      154        -5     
  Lines       14708    14197      -511     
===========================================
- Hits        10714     8716     -1998     
- Misses       3994     5481     +1487     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maleadt maleadt marked this pull request as ready for review January 2, 2024 14:58
@maleadt maleadt merged commit 3122ba8 into master Jan 4, 2024
@maleadt maleadt deleted the tb/sparse_combine branch January 4, 2024 11:12
Copy link
Member

@amontoison amontoison left a comment

Choose a reason for hiding this comment

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

Sorry for the delay of my answer @maleadt.
LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda array Stuff about CuArray. cuda libraries Stuff about CUDA library wrappers. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for combining duplicate elements in sparse matrices
2 participants