-
Notifications
You must be signed in to change notification settings - Fork 235
Add distributed reductions #4497
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
Conversation
function partition_dimensions(arch::Distributed) | ||
R = ranks(arch) | ||
dims = [] | ||
for r in eachindex(R) | ||
if R[r] > 1 | ||
push!(dims, r) | ||
end | ||
end | ||
return tuple(dims...) | ||
end |
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.
maybe we should find a more elegant way to compute this?
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.
also docstring? what is it doing?
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.
checking which are the ``partitioned'' dimensions
@simone-silvestri could you help with this error? |
How do you reduce across a dimension that is partitioned? You need to gather at the end (and then scatter to all devices)? |
we compute the reduction locally and then allreduce through all devices |
can you point to those lines? |
the reduction is here
which is this function over here Oceananigans.jl/src/DistributedComputations/distributed_fields.jl Lines 119 to 128 in f582f25
It has to be done only if (at least one) of the dimensions we are reducing are partitioned in different ranks, otherwise it is not necessary |
ok nice, for some reason I didn't see that |
@simone-silvestri any idea why this comes up?
|
Looks like using |
This PR adds reductions for distributed fields.
When merged, should allow #4470 to go through