-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Raise ValueError when calling xxx_obj
with ChainerX array in ChainerMN
#8320
Conversation
The chainerx array preserves device id inside, which will also be pickled during the mpi communications and causes future errors. This commit prevent such cases by raising ValueError when calling `x_obj` with the chainerx array.
0ad860a
to
d9e2244
Compare
d9e2244
to
0d10a8e
Compare
Jenkins, test this please |
xp = chainer.backend.get_array_module(value) | ||
if xp == chainerx and value.device.name.startswith('cuda'): | ||
return True | ||
else: |
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.
How about checking if obj
is array object of numpy
, 'cupy', and chainerx
?
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.
chainer.backend.get_array_module
can accept any type and return numpy
for types that are not cupy nor chainerx. So I don't think we have to check if they beforehand.
Jenkins CI test (for commit 0d10a8e, target branch master) succeeded! |
Jenkins, test this please |
Jenkins CI test (for commit e7dc04d, target branch master) succeeded! |
xxx_obj
with ChainerX array in ChianerMNxxx_obj
with ChainerX array in ChainerMN
Jenkins CI test (for commit e7dc04d, target branch master) succeeded! |
The chainerx array preserves device id inside, which will also be
pickled during the mpi communications and causes future errors.
This PR prevents such cases by raising ValueError when calling
x_obj
with the chainerx array.