-
Notifications
You must be signed in to change notification settings - Fork 196
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
Throw error if CUDA-aware MPI is not found for distributed GPU architecture #3883
base: main
Are you sure you want to change the base?
Conversation
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.
nice
Hmm, we need to take care because apparently only openmpi allows us to check this:
|
Revisiting this briefly --- we have found that However, there are other possible solutions. For example we can write a test like using MPI
using CUDA
MPI.Init()
function sendrecv_works(grid)
arch = architecture(grid)
comm = arch.communicator
rank = arch.local_rank
size = MPI.Comm_size(comm)
dst = mod(rank+1, size)
src = mod(rank-1, size)
N = 4
FT = eltype(grid)
send_mesg = CuArray{FT}(undef, N)
recv_mesg = CuArray{FT}(undef, N)
fill!(send_mesg, FT(rank))
CUDA.synchronize()
try
MPI.Sendrecv!(send_mesg, dst, 0, recv_mesg, src, 0, comm)
return true
catch err
@warn "MPI.Sendrecv test failed." exception=(err, catch_backtrace())
return false
end
end adapted from https://gist.github.com/luraess/0063e90cb08eb2208b7fe204bbd90ed2 |
We're also discussing whether such a helper could be added to MPI here: JuliaParallel/MPI.jl#886 |
We may want a similar and independent test for |
Also because of the intricacies of configuring CUDA-aware MPI (this can fail due to issues out of your control, for example due to incorrect installation of libraries on a cluster which I experienced recently) we should give more information on failure --- MPI configuration, architecture details, etc. |
I wonder if they have solved this problem in https://github.com/CliMA/ClimaComms.jl We could think of supporting also non-CUDA-aware MPI by switching the buffers to the CPU and performing a copy to the CPU before the send/recv operations, but that would be a big step because then we would have to support MPI routines everywhere all the time, not only for |
Why do you say that?
Is there a point? Would such models be useful / run efficiently? |
I think they have non-gpu aware support.
There would be some overhead, and hiding communication latency would be more difficult. |
Why would non-GPU aware support mean that ClimaComms throws useful errors when CUDA-aware MPI is not available? I don't totally grasp. Anyways if they do have nice error messages let's use those utilities.
The question is really about how much overhead there would be. Would it be a small thing, or would it be so large that there would be no point in even trying to run such a simulation. The other question is, are there systems where CUDA-aware MPI cannot be installed? |
cc @simone-silvestri