Replies: 1 comment 3 replies
-
Hi again @nuwoo , asking here is perfect! I want to make sure I understand your script.
Because of the follow-up sums, here's what I would do: import heat
N = 2**10
a=heat.arange(N,dtype=heat.float32,device='gpu',split=0)
processes = a.comm.size
# reshape a into a 2D array, 1 row per process
a = heat.reshape(a, (processes, -1))
# a is still distributed along axis 0
print("global shape, local shape, split axis = ", a.shape, a.lshape, a.split)
# set first row to sum of rows (equivalent to your a[a_0] = a[a_1] + a[a_0])
a[0] = heat.sum(a, axis=0) # heat.sum calls MPI Allreduce
# set second row to difference of rows
a[1] = -a[1]
a[1] = heat.sum(a, axis=0)
# if you need `a` to be 1D, reshape again
a = heat.reshape(a, (N,)) Does this help? Let us know how it goes. Thanks to you I found a bug in the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Follow the distributed tutorials, code like that, already used
heat_test.py
check the mpi and heat installation.When it uses only one GPU, it works fine, but when there are multiple GPUs, it reports an error:
distributed-error
So i want to know if i operate it in a wrong way or some manual to reference.
ps: sorry to ask question here, i can't use
pyheat
tag in stackoverflow.Beta Was this translation helpful? Give feedback.
All reactions