Skip to content

Optimize BandedBlockBandedMatrix #74

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

Merged
merged 10 commits into from
Aug 8, 2019
Merged

Optimize BandedBlockBandedMatrix #74

merged 10 commits into from
Aug 8, 2019

Conversation

huanglangwen
Copy link
Contributor

The original indexing based assignment is slow for BandedBlockBandedMatrix compared to CSC matrix (#67). This PR switch to a column-based iteration, the evaluation time of colored jacobian for BBBmatrix is reduced from 120 ms to 87ms while the performance for CSC matrix is kept the same.

@huanglangwen huanglangwen changed the title Switch to column based iteration [WIP] Switch to column based iteration Aug 2, 2019
@huanglangwen huanglangwen changed the title [WIP] Switch to column based iteration Switch to column based iteration Aug 4, 2019
@huanglangwen huanglangwen changed the title Switch to column based iteration Optimize BandedBlockBandedMatrix Aug 7, 2019
@codecov
Copy link

codecov bot commented Aug 7, 2019

Codecov Report

Merging #74 into master will increase coverage by 2.68%.
The diff coverage is 96.49%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #74      +/-   ##
==========================================
+ Coverage   67.98%   70.66%   +2.68%     
==========================================
  Files           7        7              
  Lines         406      450      +44     
==========================================
+ Hits          276      318      +42     
- Misses        130      132       +2
Impacted Files Coverage Δ
src/DiffEqDiffTools.jl 100% <ø> (ø) ⬆️
src/jacobians.jl 88.51% <96.49%> (+2.93%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3a5df7...8321080. Read the comment docs.

@coveralls
Copy link

coveralls commented Aug 7, 2019

Coverage Status

Coverage increased (+15.4%) to 69.794% when pulling 8321080 on huanglangwen:optimize into f3a5df7 on JuliaDiffEq:master.

src/jacobians.jl Outdated
end
end

@inline function _colorediteration!(Jac::BlockBandedMatrices.BandedBlockBandedMatrix,
Copy link
Member

Choose a reason for hiding this comment

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

put this in an @requires block

@require BlockBandedMatrices="ffab5731-97b5-5995-9138-79e8c1846df0" begin
_use_findstructralnz(::BlockBandedMatrices.BandedBlockBandedMatrix) = false

@inline function _colorediteration!(Jac::BlockBandedMatrices.BandedBlockBandedMatrix,
Copy link
Member

Choose a reason for hiding this comment

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

What about just standard BlockBandedMatrix and BandedMatrix? Are those fine without a special iteration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'm working on that.

@ChrisRackauckas ChrisRackauckas merged commit 3e98859 into JuliaDiff:master Aug 8, 2019
@huanglangwen huanglangwen deleted the optimize branch August 8, 2019 12:20
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.

3 participants