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

Optimal sparse decompression #223

Merged
merged 2 commits into from
Apr 27, 2024
Merged

Optimal sparse decompression #223

merged 2 commits into from
Apr 27, 2024

Conversation

gdalle
Copy link
Member

@gdalle gdalle commented Apr 27, 2024

Core

  • Make sparsity column-major for column-wise Jacobians (forward mode) and Hessians
  • Make sparsity row-major for row-wise Jacobians (reverse mode)
  • Generate the Jacobian / Hessian according to the same pattern, respecting major
  • Implement decompress! for SparseMatrixCSC (when dir = :col) and its transpose (when dir = :row)
  • Give up on symmetric coloring and decompressing for Hessians at the moment

Tests

  • Quit testing typeof(jac) == SparseMatrixCSC because we can have a Transpose of that (and more general stuff in the future)
  • Test sparsity with AutoSparse(AutoEnzyme(Enzyme.Reverse)) to cover the reverse mode mutating Jacobian

@codecov-commenter
Copy link

codecov-commenter commented Apr 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.17%. Comparing base (09a7da0) to head (2e04819).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #223      +/-   ##
==========================================
+ Coverage   95.64%   96.17%   +0.52%     
==========================================
  Files          74       74              
  Lines        3839     3846       +7     
==========================================
+ Hits         3672     3699      +27     
+ Misses        167      147      -20     

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

@gdalle gdalle merged commit 07b67e8 into main Apr 27, 2024
5 checks passed
@gdalle gdalle deleted the gd/sparse_decompress branch April 27, 2024 11:36
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.

2 participants