Allow turning off checking device factorizations to avoid blocking calls - #270
Conversation
lkdvos
left a comment
There was a problem hiding this comment.
Definitely looks reasonable to me, although it would be nice to get a sense of how bad the performance is to try and decide if we want to turn this on or off by default.
Is this specifically for the case where we apply the factorizations to a bunch of blocks and don't want to sync inbetween? There might also be a case for writing a batched version that tries to only sync at the end or something similar
Indeed it helps with this but not only here, another example is |
|
Yeah fair enough, I definitely think the keyword argument is a good solution, just slightly on the fence about disabling checks by default. 🤷 it's a bit annoying to think that PEPSKit would run without these and then if at some point something doesn't converge it just silently goes haywire, and then you have to do a full rerun with checks on to figure out what happened, but I guess that's what it has to be |
|
I agree, that's why I think in fact this should be settable at |
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
|
It seems like all four of |
|
Also, I don't fully understand why this needs to be so expensive. Is there something with |
|
The expensive part is less about the cost of the operation, and more about the fact that sending back a scalar requires synchronization, so it breaks the asynchronous programming model, which im assuming is dominating the runtime for the tail of small blocks. Probably this can be improved in a batched implementation, but I do see the value in having a switch for this, although I do want the default to be having the checks on |
|
Indeed I think |
90c10bd to
e47031a
Compare
lkdvos
left a comment
There was a problem hiding this comment.
Overall I'm definitely okay with this, although it would really be nice to have other ways of circumventing this. For example, can we do a non-blocking NaN-poison of the results? My main reservations are that we do actually have a LAPACK error every now and again, and I have a hard time gauging how much of a pain it is to not have this error and simply produce garbage.
Ultimately, I think the real win is still the batched solution, but since this PR is such a small change and really doesn't hurt I don't see why not :)
|
OK, let me add the ROCm checks too tomorrow |
7b83917 to
d8cf28c
Compare
|
Test failures look unrelated, probably ok to force merge |
The idea of this PR is to make the checks involving
@allowscalaroptional. These copies are extremely expensive and block the device, so by (optionally) disabling them, we should be able to make better use of the GPU.So far I've just done the CUSOLVER ones, but I can also do ROCSOLVER if we like the idea. I think it would make sense to have a settable flag that turns the checks on and off so that users can control it, or a
CheckedCUSOLVERdriver. Anyone have thoughts on that angle?