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

Allocation-free bidirectional decompression #154

Merged
merged 5 commits into from
Nov 6, 2024
Merged

Conversation

gdalle
Copy link
Owner

@gdalle gdalle commented Nov 5, 2024

  • Remove adjacency graph from bipartite introduced in Custom adjacency graph from bipartite graph #144 because we need an actual SparseMatrixCSC containing A and Aᵀ for efficient decompression.
  • Precompute more stuff and allocate all necessary storage when creating a BicoloringResult.
  • To decompress a BicoloringResult into a SparseMatrixCSC, actually decompress into a larger matrix A_and_noAᵀ, which contains the lower triangle of A_and_Aᵀ. This larger matrix shares the vector A.nzval, so that A is updated in-place.
  • Add type stability and allocation tests for bicoloring. At the moment, only decompression into a SparseMatrixCSC is alloc-free. Decompression into a Matrix still requires taking the bottom left submatrix of A_and_noAᵀ (it also could be a view but views of sparse matrices are inefficient).

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (1455236) to head (70dc0ae).
Report is 1 commits behind head on bicoloring.

Additional details and impacted files
@@             Coverage Diff              @@
##           bicoloring      #154   +/-   ##
============================================
  Coverage      100.00%   100.00%           
============================================
  Files              13        12    -1     
  Lines            1261      1256    -5     
============================================
- Hits             1261      1256    -5     

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

@gdalle gdalle marked this pull request as ready for review November 5, 2024 19:13
@gdalle gdalle merged commit 707e15e into bicoloring Nov 6, 2024
6 checks passed
@gdalle gdalle deleted the gd/bicoloring_decomp branch November 6, 2024 05:11
gdalle added a commit that referenced this pull request Nov 8, 2024
* Implement efficient adjacency graph from bipartite (#145)

* Custom adjacency graph from bipartite

* Fix nb edges

* More typing

* Working prototype for bicoloring (coloring + decompression) (#146)

* Start bicoloring result

* Working bidirectional decompression

* Min diff

* Slight perf optim

* Perf

* Gettin bi

* Less code

* Fix tests

* Remove remaining compat

* Fix group typing

* Avoid accessing ag.S

* Add bidirectional coloring visualization (#153)

* Allocation-free bidirectional decompression (#154)

* Minimize diff

* Bump version to 0.4.9

* Check scale for bicoloring visualization

* Fix visualization tests

* Improve docs

* Undo view change

* Typo

* Add views
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.

1 participant