[LinearSystem] Introduce ConstantSparsityProjectionMethod#4552
Merged
fredroy merged 7 commits intosofa-framework:masterfrom Mar 18, 2024
Merged
[LinearSystem] Introduce ConstantSparsityProjectionMethod#4552fredroy merged 7 commits intosofa-framework:masterfrom
fredroy merged 7 commits intosofa-framework:masterfrom
Conversation
Contributor
Author
|
[ci-build][with-all-tests] |
bakpaul
approved these changes
Mar 4, 2024
bakpaul
pushed a commit
to bakpaul/sofa
that referenced
this pull request
Mar 21, 2024
…work#4552) * [LinearAlgebra] Refactor sparse matrix product * Move tests as a template test * Fix all combinations of storage * Introduce parallel computation * Manage options for more types * [LinearSystem] Introduce ConstantSparsityProjectionMethod --------- Co-authored-by: Frederick Roy <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #4547. The diff: alxbilger/sofa@sparsematrixproduct...alxbilger:sofa:constantsparsityprojection
Matrix projection method taking advantage of the constant sparsity of the matrices in the computation of sparse matrix product. A boolean Data enables parallel computation.
Benchmark on the reduced diamond for 1000 time steps (previous results in #4490):
MatrixProjectionMethod + areJacobiansConstant=False
This is the most generic method
MatrixProjectionMethod + areJacobiansConstant=True
ConstantSparsityProjectionMethod + areJacobiansConstant=True + parallelProduct=False
Note that the timer includes the first iteration which is very very slow. It alters the average.
ConstantSparsityProjectionMethod + areJacobiansConstant=True + parallelProduct=True
Note that the timer includes the first iteration which is very very slow. It alters the average.
Conclusion
We can observe that the parallelism is necessary to take advantage of the constant sparsity pattern. The fastest configuration is now
ConstantSparsityProjectionMethod + areJacobiansConstant=True + parallelProduct=Truecompared toMatrixProjectionMethod + areJacobiansConstant=Truebefore this PR. It's a speed up of x1.8.For the records, at the beginning of this series of enhancement (#4443), the reduced diamond run at 44 FPS. Now it is 222 FPS = speed up x5.
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if