Conversation
|
I made a change which was bugging me when I was implementing In Fredholm, This can be simplified to |
|
Thanks @rohanbabbar04 When I suggested we should investigate Allgatherv I did not foresee the issue with non-contiguous arrays. What you propose in the Fredholm code is a bit problematic though. We have used that transpose patterns for a real reason, G is usually much bigger than x, so by transposing twice x (before and after G is applied) we do effectively much fewer operations than transposing G... we do the same in PyLops' original operator, so changing this would require some proper benchmarking to do if the combo of changes you suggest is actually beneficial 😉 |
|
Ah!, Yes in that case we should keep it as before, because when G>>x then G transpose and conj will put pressure on memory. I also think we should keep both |
mrava87
left a comment
There was a problem hiding this comment.
@rohanbabbar04 this looks good!
Just one thing i am a bit unsure.... you mentioned about the issue with Fredholm as the array is non-contiguous and that allgatherv requires contiguity.. but we don't seem to check this in mpi_allgather... so what would happen if we have Fredholm with G that have different size in G.shape[0]... I suspect the code will crash?
You could probably test it first by doing something like
pylops-mpi/tests/test_fredholm.py
Line 120 in a0eed42
nsl =par["nsl"] +1 if rank == 0 else par["nsl"]
and then use nsl instead of par["nsl"] in the rest of the test... this ensures rank0 has different size than the other ranks and we should hit to allgatherv with non-contiguous arrays...
If I am right fix the code by:
- either add a check of contiguity in
mpi_allgather - adding a parameter to
mpi_allgatherand methods that call it to let user forceallgathereven if the different arrays don't have the same shape with the usual padding/unrolling
da916ed to
d8e9630
Compare
Yup, what I did was use |
Alright! I see this for |
Yes, you are right it was already handled by the |
|
@rohanbabbar04 Alright, then I think we agree. Resolve conflicts and get the CI back up and running and then we should be almost ready to merge - I did also add a few minor extra comments below... |
|
@tharittk can you also please have a look at this PR since it changes a few things you did, would like to have your input 😄 |
mrava87
left a comment
There was a problem hiding this comment.
@rohanbabbar04 left a few more comments and waiting for @tharittk input 😄 almost there!
2f8a63f to
2f1225a
Compare
tharittk
left a comment
There was a problem hiding this comment.
Looks good @rohanbabbar04 !
I have somewhat similar feeling to @mrava87 that I much prefer to keep the array unrolling in one place. Currently, your propose mpi_allgather has two unrolling (for the variable-size and non-variable size). And previously we have the _unroll_allgather_recv which half of it becomes obsolete (the mpi part).
Hmm, I think it would be really nice to have them in one place... Maybe extending the original _unroll_allgather_recv to handle both padded and non-padded input ?
|
Ok, did some minor changes to |
|
@mrava87, I think once this is merged we can make a new release as the issue with |
|
@rohanbabbar04 agreed! Let me have a final look at this at the weekend (and check with @hongyx11 why the CuPy CI seems to have stopped working) |
Closes #169
MPI_AllGathervinmpi_allgather.