Conversation
|
Do you intend adding an eigenvalue estimation? I think that would be very helpful, because most times users don't have that available. I think PETSc is also doing that. I think this is the GMRES version used by PETSC to compute the estimate: https://petsc.org/release/docs/manualpages/KSP/KSPAGMRES/ |
|
@MarcelKoch thanks for providing these reference. I do not think I will put them in this pull request. From https://doi.org/10.1137/0907057, they introduce the algorithm From https://petsc.org/release/docs/manualpages/KSP/KSPCHEBYSHEV/#kspchebyshev, For GMRES, we need to get the Hessenberg out and compute eigenvalue on it. |
|
Kudos, SonarCloud Quality Gate passed! |
MarcelKoch
left a comment
There was a problem hiding this comment.
Besides the comments left below, I want to mention the num_keep and num_generated mechanic. That needs some explaination, because right now I don't understand what that is for. It seems like some sort of restart mechanic, but I might be wrong there. Also, exposing this to the user seems confusing to me.
| /** | ||
| * The number of scalar to keep | ||
| */ | ||
| int GKO_FACTORY_PARAMETER_SCALAR(num_keep, 2); |
There was a problem hiding this comment.
It is not clear what this parameter is for.
There was a problem hiding this comment.
Perhaps this means, construct Chebyshev polynomials until degree num_keep, and after that just do IR with these polynomial?
There was a problem hiding this comment.
no, num_keep is to keep the generated scalar in the storage.
alpha and beta are changed by iteration, but they are fixed by the given bound.
It's used for fixed iteration runs because we do not need to refill these scalars for different apply
There was a problem hiding this comment.
But shouldn't we then just keep all scalars?
There was a problem hiding this comment.
when using it as normal solver, we may not have the maximum iteration information.
allocating one big dense matrix and then moving them to another one when full may not be a good approach.
we can also add the ability of workspace such that it can handle the std::vector then it should be more flexible for uncertain size.
There was a problem hiding this comment.
I can not assume that there's an iteration criterion. It can contain the residual norm or time criterion.
If we assume that, we should provide the standalone iteration parameter.
Users do not need to know the implementation details.
The statement is to keep how many scalars for chebyshev to avoid the refill overhead.
I can introduce this usage later when we have the use case.
I think it should help the situation when kernel launch overhead is noticeable.
There was a problem hiding this comment.
You are right, this is very useful to negate the overhead. Still, I think we can assume that there is an iteration criterion somewhere in the combined one and use that. If not, we would just throw.
There was a problem hiding this comment.
You could set the default value to unspecified, which you define before. When the solver is generated, you can check if the parameter is unspecified and then try to extract an iteration criterion from the criteria. If that doesn't work, you throw with a message to either pass an iteration criterion or set this parameter to something else.
Or alternatively, just replace the criteria parameter with a iterations parameter and move the class into the preconditioner namespace. I think that is also a fine option, since that would be the main use case anyway.
There was a problem hiding this comment.
I have moved it to based on the given iteration from stopping criterion.
It is only increased after creating object.
I also think whether staying a fixed number is enough or not.
There was a problem hiding this comment.
Thanks, I think it should be fine the way it is now.
| /** | ||
| * Chebyshev iteration is an iterative method that uses another coarse | ||
| * method to approximate the error of the current solution via the current | ||
| * residual. It has another term for the difference of solution. Moreover, this |
There was a problem hiding this comment.
| * residual. It has another term for the difference of solution. Moreover, this | |
| * residual. The solution is then updated using the Chebyshev polynomials. Moreover, this |
Is that what the sentence is trying to say? Anyway, I think it should be mentioned somewhere that this uses these polynomials.
There was a problem hiding this comment.
the solution x_i is also based on the
There was a problem hiding this comment.
TBH I don't see the relevance of that. Has that any effect for the user?
There was a problem hiding this comment.
no, I only try to explain the algorithm's difference from IR. IR uses
There was a problem hiding this comment.
I still think this has to be rephrased
There was a problem hiding this comment.
I try to rephrase it again. Could you take a look?
vasilisge0
left a comment
There was a problem hiding this comment.
I am fine with merging this PR when corrections in parts of the documentation that are pointed out (comments) take place. I could understand what num_keep variable was used for but perhaps a more descriptive name would be better.
c88ea63 to
f9d0e28
Compare
|
Kudos, SonarCloud Quality Gate passed!
|
MarcelKoch
left a comment
There was a problem hiding this comment.
LGTM, but I would like to resolve some of my earlier issues. Other than that only minor nits.
| /** | ||
| * Chebyshev iteration is an iterative method that uses another coarse | ||
| * method to approximate the error of the current solution via the current | ||
| * residual. It has another term for the difference of solution. Moreover, this |
There was a problem hiding this comment.
I still think this has to be rephrased
|
Kudos, SonarCloud Quality Gate passed!
|
Co-authored-by: Marcel Koch <marcel.koch@kit.edu>
Co-authored-by: Marcel Koch <marcel.koch@kit.edu>
Co-authored-by: Marcel Koch <marcel.koch@kit.edu>
Co-authored-by: Marcel Koch <marcel.koch@kit.edu>
Co-authored-by: Tobias Ribizel <ribizel@kit.edu>
Co-authored-by: Tobias Ribizel <mail@ribizel.de>
Co-authored-by: Marcel Koch <marcel.koch@kit.edu>
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1289 +/- ##
===========================================
- Coverage 89.36% 88.73% -0.64%
===========================================
Files 824 831 +7
Lines 68983 69571 +588
===========================================
+ Hits 61649 61732 +83
- Misses 7334 7839 +505 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|















It adds the Chebshev iteration in https://en.wikipedia.org/wiki/Chebyshev_iteration
The second-order richardson uses a similar formula but the scalars are constant in all iteration. Chebyshev Iteration update the scalar from the previous one (the scalar are the same if upper/lower eigval does not change)