-
Notifications
You must be signed in to change notification settings - Fork 101
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
minimal trial implementation for a twisted clover determinant derivative (pre-draft) #1338
Conversation
This is similar to @Marcogarofalo's #1330 but I want to focus on getting this to work with tmLQCD first and then generalize the original function from there. As a result, the present PR will be temporary and only to share progress. |
The problem #1330 (comment) is clearly fixed by removing the extra However, the next problem crops up when the Dslash is supposed to be applied:
and this I find quite strange since |
The issue above occurs because of
and I can update the error message above to indicate that this might be a possibility, but to be honest, maybe we generally should check more frequently if |
The next small step. Here I do not really understand where the problem comes from.
|
I got a similar error while trying to use When I try to disable autotuning via setting |
I suspect that the problem is in the spinor comms of |
it seems that the error does not quite occur where it is reported above, as far as I can tell from a run with |
Thanks for the tip about disabling tuning @SaltyChiang, this makes it quite obvious where the issue is:
|
More tests for correctness is needed.
I think I can confirm that the error in #1338 (comment) stems from
|
I will get more involved with this debug in the next day or so. One thought though: when debugging it’s best to run with |
Thanks a lot, I keep forgetting about this... On 2 GPUs:
|
To be honest I never really liked this design where a singlet fermion field is distinct from a non-twisted field. The dimensions are identical, and the field can be used as intended, so I don't see the need for the separate field type. I'm not sure what the original design motivation was for this (perhaps @alexstrel knows, as I think he was the originator, but this may be lost in the mists of time?) A better approach here may be to dump the distinction between |
Ok, so this suggests the issue isn't the |
It works fine (I haven't checked yet whether it's correct, but at least it doesn't crash). I will be able to work some more on this next week hopefully and make some more concrete progress. |
I think it is the problem in Please see this commit in #1339. quda/lib/clover_outer_product.cu Lines 145 to 158 in 8e15042
After using
|
I agree. The name is also a bit fundamentally confusing in some sense, since I would consider the "flavour" to correspond to either +mu or -mu or equivalently +r or -r in the "physical basis", rather than the distinction between single-flavour and doublet. That is a whole other story, however, and the present solution works well in practice. On the other hand, having a flag indicating that one is dealing with a twisted mass operator (rather than having to check whether mu is non-zero against best practice, even though also this is done here and there) is not a bad thing. This fact is useful in a couple of places:
Before getting rid of it, perhaps it's worth checking if this would not introduce lots of local and equivalent variables (which will likely be |
All good points @kostrzewa regarding I've taken a look at the clover_outer_product.cu file a bit more to see if I could visually isolate what's going on here. One thing I do see is that the halo exchange code is rather nasty, and is badly need of an update to clean this up. It wouldn't surprise me if this code has bit rotted, and that in turn could lead to the crashes you were seeing, e.g., if the ghost buffers weren't being sized correctly, or some such.@SaltyChiang tried replacing with May I suggest the following (which I think is what you were trending towards anyway):
What's the best way for me to run this function myself? I assume you're calling this from tmLQCD? |
…suggested in review, and sprinkle in some more OMP for more speedup
@weinbe2 c0fdc7b address this suggestion: merging CloverForce_reference.h and TMCloverForce_reference.cpp into a single file clover_force_reference.cpp. |
@maddyscientist I just noticed that here Lines 4661 to 4663 in 7bd79ed
we could remove completely the tmp spinor. Can I push this change or this part is under refurbishment?
|
Sounds like a good idea, thanks. |
@Marcogarofalo @kostrzewa just making sure I understand the conventions here: does tmLQCD solve for MdagM or MMdag when doing HMC forces? Was having another look at parametrizing the differences between tmLQCD and MILC interfaces to simplify the code: apart from the parity differences, the only other main difference is that one seems to be the Hermitian conjugate of the other. |
I was also confused by comments like this in the tmLQCD interface code:
In general the default with QUDA CG for example is MdagM not MMdag, so wanting to make sure we're on the same page. |
My understanding is that in tmLQCD we need Then inside the force at Lines 4657 to 4660 in 19ce4dd
We want With Maybe some comments are misleading |
…nces between MILC and tmLQCD interfaces now parametrized on QudaInvertParam::matpc_type and QudaInvertParam::dagger
@Marcogarofalo I've now parametrized the differences between MILC and tmLQCD. For tmLQCD, I'm now expecting that |
@maddyscientist Yes they are the ones that are passed when in tmLQCD we call QUDA CG, for the MG they are different but I set them after the MG and before calling the force function. |
@weinbe2 this is ready for final sign off. I'll push clang-format shortly. |
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.
Hugely impressive work, thank you @kostrzewa , @Marcogarofalo , + @maddyscientist for additional clean-up and contributions. Merging momentarily!
Thank you All for making this possible! |
This is a temporary copy of
computeCloverForceQuda
with (almost) the minimum amount of functionality to implement the derivative of a twisted clover determinant monomial as a starting point for debugging