-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add the L1 jacobi #1310
Add the L1 jacobi #1310
Conversation
I'm a bit confused. The paper talks about the L1 Jacobi only in a distributed setting, ie the off-diagonal entries you mentioned are the entries of our non-local matrix in the distributed matrix. But your implementation is for non-distributed matrices. Can you perhaps provide another reference for the non-distributed case? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1310 +/- ##
===========================================
- Coverage 90.88% 89.80% -1.08%
===========================================
Files 808 811 +3
Lines 66521 67254 +733
===========================================
- Hits 60459 60400 -59
- Misses 6062 6854 +792 ☔ View full report in Codecov by Sentry. |
it's only based on the nonoverlapping partition. |
I think sec. 6.2 means using the preconditioner from 6. |
If the partition is only designed with the mpi (let me use the mpi here to distinguish), L1 is indeed normal Jacobi |
there's one reference from precond. They use L1-scalar Jacobi |
The L1 smoother from sec. 6 is an improvement on the hybrid smoother from sec 5. The hybrid smoother applies a local smoother only on the local matrix block of a distributed matrix and ignores the non-local part. The L1 smoother than takes the non-local part into account through the |
Perhaps naming it 'lumped-Jacobi' would be better suited to differentiate between those two variants. And I guess the L1 from the first paper could be implemented as another distributed preconditioner. |
The first paper considers the diagonal entries are positive, so they are equivalent. |
My argument is that what is implemented in this PR is not the L1 from the paper, so we should not call it that. But honestly, I don't have a great overview of how the term L1 smoother is usually interpreted. |
|
It should be theorically L1 smoother. otherwise, I just add some random Jacobi. |
The L1 smoother (Jacobi or GS) explicitly references distributed matrices. I still think that if we want to follow the naming of the paper, the variant implemented here should not be called L1. Instead, we should add a new distributed preconditioner which consists of a local solver (Jacobi, or in the future perhaps GS) and a diagonal matrix with the row-wise sum of the non-local part. |
Maybe I am misunderstanding something, but in the non-distributed case, this is basically diagonal relaxation with weights equal to row sums, right ? So, I think it definitely makes sense to have as a smoother as an alternative to the scalar Jacobi smoother. I think the name L1 is well suited because you are taking the L1 norm on the row space vectors ? Not sure if there is some mathematical basis for this yet, we could also try seeing if any other p-norms also make sense, Particularly with |
If we go with @pratikvn suggestion, and base this version on the L1 row norm, then we need to take the absolute value of the diagonal. |
I am not sure whether to take the absolute value of the diagonal value. |
Taking the absolute value is the only way for this preconditioner to make sense. And for blocks, I would just go with taking the absolute value component-wise. I think then it makes the most sense to add up these block-wise. Currently, you seem to only update the diagonal values of the diagonal block, or maybe I'm mistaken. |
Yes, from the block-version, it only updates the diagonal value. From the paper or formula perspective, I prefer only adding values on the diagonal value without take absolute on the diagonal value first. |
803333e
to
5fc569a
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some doc suggestions, otherwise LGTM!
* If it is true, it generates the preconditioner on A + Diag(sum_{k in | ||
* off diagonal block of i} A_ik) not A. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think two things are missing:
- You should mention that you take the absolute values of the elements.
- Maybe also add a note for the scalar case: "When
block_size=1
, this will be equivalent to taking the inverse of the row-sums as the preconditioner."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for changing the name, for me the name is fine now.
I do have some questions about the block version though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only smaller nits left on the documentation.
|
nvhpc 23.3 may optimize the formula in different way for scaled_value in make_diag_dominant, which lead the updated value is slightly different
Co-authored-by: Marcel Koch <[email protected]>
Co-authored-by: Marcel Koch <[email protected]> Co-authored-by: Pratik Nayak <[email protected]>
Error: PR already merged! |
This add the L1 to Jacobi. The detail is shown in https://epubs.siam.org/doi/abs/10.1137/100798806$M$ (which is diagonal of A for scalar Jacobi or diagonal block of A)$M' = M + D^{\mathcal{l}_1}$ whose $D^{\mathcal{l}_1}$ is a diagonal matrix with
original preconditioner is on
L1 smoother is on
$$D_{ii}^{\mathcal{l}1} = \sum{j \in \text{the off-diagonal block of corresponding block of i}}{|A_{ij}|}$$
I am not sure whether the theorems in the paper still work for negative diagonal entries.