Skip to content

Coloring and decompression for structured matrices #132

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

Closed
wants to merge 32 commits into from
Closed

Conversation

gdalle
Copy link
Owner

@gdalle gdalle commented Oct 2, 2024

Fixes #64 and fixes #65 by implementing structured coloring & decompression for various structured matrix types:

Package Type Coloring Decomp. Test perf
LinearAlgebra Diagonal
LinearAlgebra Bidiagonal
LinearAlgebra Tridiagonal
LinearAlgebra SymTridiagonal
BandedMatrices BandedMatrix
BlockBandedMatrices BlockBandedMatrix
BlockBandedMatrices BandedBlockBandedMatrix

General philosophy

Keep the same result type (ColumnColoringResult / RowColoringResult).

  • Upside: if the user tries to decompress into something else, like a SparseMatrixCSC, it will still be very fast
  • Downside: a few needless allocations after coloring, but unlike decompression they are a one-time cost.

Remaning issues

For SymTridiagonal I'm not sure what to do since it is not mutable.

For decompression of BlockBandedMatrices, I still need to figure out JuliaArrays/BlockArrays.jl#418. But it already works because the fallback algorithm relies on the nonzeros of the sparse encoding, so it does not try to access illegal indices outside of the bands.

@gdalle gdalle marked this pull request as draft October 2, 2024 07:23
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (1cb3884) to head (df53bde).

Additional details and impacted files
@@            Coverage Diff             @@
##              main      #132    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           11        14     +3     
  Lines          871      1022   +151     
==========================================
+ Hits           871      1022   +151     

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

@gdalle gdalle changed the title Structured coloring & decompression, episode 1 Structured coloring: Diagonal, Bidiagonal, Tridiagonal Oct 2, 2024
@gdalle gdalle changed the title Structured coloring: Diagonal, Bidiagonal, Tridiagonal Coloring and decompression for structured matrices Oct 2, 2024
@gdalle gdalle changed the base branch from main to gd/better_result October 2, 2024 10:27
Base automatically changed from gd/better_result to main October 2, 2024 16:37
@gdalle gdalle marked this pull request as ready for review October 2, 2024 18:53
@gdalle
Copy link
Owner Author

gdalle commented Oct 3, 2024

Superseded by #139 (I screwed up with a git rebase while splitting out the tests)

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

Successfully merging this pull request may close these issues.

Optimized coloring for specific matrix types Optimized decompression for specific matrix types
1 participant