-
Notifications
You must be signed in to change notification settings - Fork 150
kcontainer now encapsulated and provides k elements at working prec #5389
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
kcontainer now encapsulated and provides k elements at working prec #5389
Conversation
|
Happily it appears that this will likely fix #5384 . For the two HEG test failures in the CI I would simply bump the test tolerance: |
|
Test this please |
fc69d34 to
17f0313
Compare
|
test this please |
prckent
left a comment
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.
LGTM. (Will still need a non-ORNL merge).
Thanks Peter. I have a couple of minor points, but I don't think they are worth holding up the PR for: first, there is some commented code that would be nice to remove. second, the "Working" data might be more clearly named "WorkingPrec" , or at least a few more comments to this effect added.
|
|
||
| for (int i = 0; i < ref.groups(); i++) | ||
| { | ||
| std::complex<double> rhok_sum, rhok_even_sum; |
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.
My fix https://github.com/QMCPACK/qmcpack/pull/5382/files needs to be reinstated .
|
There are a lot of changes involved with replacing direct member access with accessor functions. That makes reviewing the actual change difficult. Could you make a list of bullet points highlighting functional changes? |
|
Timings should be practically unchanged the cost of initializing the cached low precision values of ksq and kcart is outside of the particle move loop. There is a slight memory cost in mixed precision for the lowered precision ksq and kcart vectors. |
|
test this please |
| ////////////////////////////////////////////////////////////////////////////////////// | ||
|
|
||
| #include "catch.hpp" | ||
| #include "OhmmsPETE/TinyVector.h" |
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 don't feel it is needed here. Can it be removed?
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.
This one can't be removed. Either it has to be here or in checkVector.hpp and I remember a review comment removing it from that file.
ye-luo
left a comment
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.
Please make a separate PR with all the changes under Utilities. It should simplify the review process.
|
this is going to have a clash with #5410 which I need to look at after that merges so don't merge. |
| using PositionFull = QMCTraits::QTFull::PosType; | ||
| static constexpr int DIM = OHMMS_DIM; | ||
| using AppPosition = typename QMCTraits::PosType; | ||
| using Position = typename QMCTypes<Real, DIM>::PosType; |
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.
With this change, there are three precision in this class.
REAL, QMCTraits::FullPrecRealType and QMCTraits::PosType (effectively QMCTraits::RealType)
This seems defeating the purpose of templates.
|
Trying a simple fix #5411 There are a lot of changes in this PR making KContainer comply to our coding standard. That is a very good thing to do. Unfortunately they made code review very hard. I'd recommend making such types of change separately from actual functional changes. It is unclear to me if we can still cherry-pick them or just redo them from scratch. |
|
I think you are being unecessarily restrictive with this and having just had to write an midterm EPM I am accutely aware of how much my performance is effected by our code review process. @prckent please resolve this I am not initerested in revising this again and I do not think it is excessively difficult to review. |
|
I did a very careful review of the whole code and I expressed my concern #5389 (comment) of the key functional change in this PR. Regarding your KPI, that is an offline discussion. If all the assessor changes were in a separate PRs, such PRs should have been merged already. |
|
I'll take a proper look this afternoon. Dev velocity is a key point and also a concern of mine. I tend to think we should merge this since the tests pass and it is clearly a step in the right direction. No need to keep chopping it up. |
I don't advice chopping it up. Instead, just drop this PR and add Dev speed is critical. I frequently reorganized my intended changes into smaller PRs. Please please experienced developers do the same. It is not just helping reviewers but also to get their work finalized timely. They are the largest beneficiary. |
|
Having reviewed the status, I don’t think the return on investment is there to justify splitting this PR or redoing it again (4th time?). While we all strive for small PRs, that doesn’t always work out. The current PR is clearly several steps forward and the tests pass. I think it is time to merge and move on to other things that will benefit QMCPACK users more (observables, shared spline memory etc.). |
|
Let me explain my technical assessment of this PR. I raised the concern, the key functional change of this PR is flawed and made the code further complicated. To address this flaw, extra effort will be needed to clean up the over complicated precision handling if we merge this PR and I'm afraid it's not worth it. The alternative route will be actually using an easily understandable fix of the k sorting. Then do minimal fix (adding a few access functions) to enable structure factor estimator #5303/#5406. They are quite self contained. This alternative route has one drawback that KContainer is not made template. Basically we need to defer the template change. My understanding that the urgent work is to enable estimators not making KContainers template. Taking the alternative route allows to make the needed fix and we can focus working on the actual needed code. |
prckent
left a comment
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 am happy to merge this as is. Let me know your preference @PDoakORNL .
ye-luo
left a comment
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.
For expediting the development of the structure factor estimator, let us merge this PR.
|
Test this please |
Proposed changes
The important change is By providing accessors for working precision ksq and kcart in
KContainerwe continue to support low precision operations for mixed precision and full precision for full precision builds without having to branch at run time.And KContainer now does its internal kshell sorting in full precision and previous PR's made the Lattice always full precision. This removes the ambiguity in number of kshells and which kpoints are members of which shells that mixed precision previously suffered from. This unblocks consistent unit testing that is dependent on kshell sorting. For instance for the Structure Factor estimator. Incidentally the number of kshells reported for mixed precision also becomes consistent for many other unit tests.
In order to have to compiler help direct member access that possibly returns incorrect precision KContainer made an actual class and accessors are also established for other members previously directly accessed.
Describe what this PR changes and why. If it closes an issue, link to it here
with a supported keyword.
What type(s) of changes does this code introduce?
Delete the items that do not apply
Does this introduce a breaking change?
What systems has this change been tested on?
Checklist
Update the following with a yes where the items apply. If you're unsure about any of them, don't hesitate to ask. This is
simply a reminder of what we are going to look for before merging your code.