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

Avoid transpose in symbolic Cholesky benchmark #1312

Merged
merged 6 commits into from
Mar 24, 2023

Conversation

upsj
Copy link
Member

@upsj upsj commented Mar 23, 2023

The transposition is pretty slow on OpenMP, so to have a fair performance baseline, I want to skip all the operations needed to symmetrize the matrix.

@upsj upsj added the 1:ST:ready-for-review This PR is ready for review label Mar 23, 2023
@upsj upsj self-assigned this Mar 23, 2023
@ginkgo-bot ginkgo-bot added reg:testing This is related to testing. mod:core This is related to the core module. mod:reference This is related to the reference module. reg:benchmarking This is related to benchmarking. type:factorization This is related to the Factorizations labels Mar 23, 2023
@upsj upsj added the 1:ST:no-changelog-entry Skip the wiki check for changelog update label Mar 23, 2023
void symbolic_cholesky(const matrix::Csr<ValueType, IndexType>*,
std::unique_ptr<matrix::Csr<ValueType, IndexType>>&,
std::unique_ptr<elimination_forest<IndexType>>&);
void symbolic_cholesky(
Copy link
Member

Choose a reason for hiding this comment

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

perhaps it makes sense to always just return the pattern of L? Then you would have to add the symmetrization to the places where you call this, but IMO it would be clearer what the function does.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd like to have this in quickly, so I can always benchmark off develop, clean-up comes later :)

Copy link
Member

Choose a reason for hiding this comment

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

TBH, I don't think that is the purpose of develop. Why not use a branch that has everything you need in it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because I want things to be reproducible, if I mix performance tuning with benchmark changes, I could easily mess up things.
And in general, all uses of the symbolic factorization in Ginkgo need the symmetric version ATM (maybe with some changes in the future for Cholesky, but that's not yet clear). This is not a public function, so it makes sense to choose the most useful semantics.

Copy link
Member

@yhmtsai yhmtsai left a comment

Choose a reason for hiding this comment

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

Maybe still need to keep one version including transpose time?

@upsj
Copy link
Member Author

upsj commented Mar 23, 2023

@yhmtsai agreed, I added it

Copy link
Member

@yhmtsai yhmtsai left a comment

Choose a reason for hiding this comment

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

I agree with @MarcelKoch.
develop should not have a short change and revert afterwards.
At least, if we add the performance test without transpose, we should keep it for a while.
Maybe not complete related to this, but I would like to bring #895

Copy link
Member

@thoasm thoasm left a comment

Choose a reason for hiding this comment

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

I am not a fan of renaming an old functionality instead of renaming the new one, as this makes it difficult to re-generate old benchmark results.
Edit: Since the benchmark was added 2 days ago in #1302, I am fine with renaming this functionality.

core/factorization/symbolic.hpp Outdated Show resolved Hide resolved
benchmark/sparse_blas/operations.cpp Show resolved Hide resolved
@upsj
Copy link
Member Author

upsj commented Mar 23, 2023

@yhmtsai To clarify: I want the code I am benchmarking on to be as close as possible to develop, it doesn't necessarily need to be merged, but it should be reviewed (I won't merge this now, because there seem to have been some compiler changes in MSVC which break the overflow check)

@upsj
Copy link
Member Author

upsj commented Mar 23, 2023

Found the MSVC issue, we were reading uninitialized data in the prefix_sum kernel, I fixed it and added tests

@ginkgo-bot
Copy link
Member

Note: This PR changes the Ginkgo ABI:

Functions changes summary: 8 Removed, 0 Changed, 8 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

For details check the full ABI diff under Artifacts here

@upsj upsj added 1:ST:ready-to-merge This PR is ready to merge. and removed 1:ST:ready-for-review This PR is ready for review labels Mar 23, 2023
@sonarcloud
Copy link

sonarcloud bot commented Mar 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

41.7% 41.7% Coverage
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Patch coverage: 83.33% and project coverage change: -0.01 ⚠️

Comparison is base (e73ea67) 91.27% compared to head (8228f8d) 91.26%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1312      +/-   ##
===========================================
- Coverage    91.27%   91.26%   -0.01%     
===========================================
  Files          577      577              
  Lines        48721    48739      +18     
===========================================
+ Hits         44468    44484      +16     
- Misses        4253     4255       +2     
Impacted Files Coverage Δ
test/factorization/cholesky_kernels.cpp 0.00% <0.00%> (ø)
reference/test/factorization/cholesky_kernels.cpp 92.30% <71.42%> (-0.80%) ⬇️
core/factorization/cholesky.cpp 100.00% <100.00%> (ø)
core/factorization/lu.cpp 98.14% <100.00%> (ø)
core/factorization/symbolic.cpp 100.00% <100.00%> (ø)
reference/components/prefix_sum_kernels.cpp 100.00% <100.00%> (ø)
reference/test/components/prefix_sum_kernels.cpp 100.00% <100.00%> (ø)
reference/test/factorization/lu_kernels.cpp 95.45% <100.00%> (ø)
test/components/prefix_sum_kernels.cpp 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@upsj upsj merged commit 786d580 into develop Mar 24, 2023
@upsj upsj deleted the symbolic_cholesky_no_transpose branch March 24, 2023 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1:ST:no-changelog-entry Skip the wiki check for changelog update 1:ST:ready-to-merge This PR is ready to merge. mod:core This is related to the core module. mod:reference This is related to the reference module. reg:benchmarking This is related to benchmarking. reg:testing This is related to testing. type:factorization This is related to the Factorizations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants