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

5-term mul! with Diagonal #603

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

5-term mul! with Diagonal #603

wants to merge 11 commits into from

Conversation

jishnub
Copy link
Collaborator

@jishnub jishnub commented Mar 4, 2025

This speeds up certain 5-term multiplications involving sparse matrices and a Diagonal, as the operations become O(nnz(A)) from O(N^2).

julia> using SparseArrays, LinearAlgebra, Chairmarks

julia> S = sprand(5_000, 5_000, 0.00001);

julia> S2 = similar(S);

julia> D = Diagonal(axes(S,1));

julia> @b (S2,S,D) mul!(_[1], _[2], _[3], true, false)
190.253 ms # main
7.143 μs # PR

julia> S2 = sprand(5_000, 5_000, 0.00001);

julia> @b (S2,S,D) mul!(_[1], _[2], _[3], 2, 3)
219.410 ms (without a warmup) # main
23.085 μs # PR

Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.18%. Comparing base (9548149) to head (a83d27c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #603      +/-   ##
==========================================
+ Coverage   84.10%   84.18%   +0.07%     
==========================================
  Files          12       12              
  Lines        9192     9249      +57     
==========================================
+ Hits         7731     7786      +55     
- Misses       1461     1463       +2     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jishnub jishnub marked this pull request as draft March 11, 2025 15:12
@jishnub jishnub marked this pull request as ready for review March 12, 2025 11:56
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.

None yet

1 participant