Skip to content
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

Add Mixed16 tests to multi-node chain List #7630

Merged

Conversation

belldandyxtq
Copy link
Member

This commit adds mixed16 tests to multi-node chain list

Thank you for creating a pull request!

Please double-check the following.

@belldandyxtq
Copy link
Member Author

pfnci, test this please

@shu65 shu65 mentioned this pull request Jun 28, 2019
3 tasks
@belldandyxtq belldandyxtq added ChainerMN Related to ChainerMN. cat:test Test or CI related. labels Jun 28, 2019
@chainer-ci
Copy link
Member

Jenkins CI test (for commit 54df4db, target branch master) failed with status FAILURE.

@belldandyxtq
Copy link
Member Author

pfnci, test this please

@chainer-ci
Copy link
Member

Jenkins CI test (for commit 4b605f4, target branch master) failed with status FAILURE.

@kuenishi kuenishi self-requested a review July 4, 2019 05:51
@@ -238,8 240,9 @@ def check_cycle_model(gpu, param):
n, d = 100, 10

with chainer.using_config('dtype', param.dtype):
io_dtype = chainer.get_dtype(map_mixed16=np.float16)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the intention here on explicitly setting map_mixed16 ? I'm afraid we don't need this line.

Copy link
Member Author

@belldandyxtq belldandyxtq Jul 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the mixed16 type is a chainer type, which doesn't exist in numpy. To create a numpy object, mixed16 needs to be maped to a numpy type, which is this line for

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is fine to manually identify the mixed16 and set to nump.float16. Since chainer has already provided this functionality, it is more chaineric to use chainer.get_dtype

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mixed16 doesn't need to be mapped if we intend fp16.

>>> import numpy, chainer
>>> numpy.arange(10).reshape(1, 10).astype(chainer.mixed16)
array([[0., 1., 2., 3., 4., 5., 6., 7., 8., 9.]], dtype=float16)

with chainer.using_config('dtype', param.dtype):
n, d = 100, 10
io_dtype = chainer.get_dtype(map_mixed16=np.float16)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto


with chainer.using_config('dtype', param.dtype):
io_dtype = chainer.get_dtype(map_mixed16=np.float16)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

io_dtype = chainer.get_dtype(map_mixed16=np.float16)

X = np.random.randn(n, d).astype(io_dtype)
Y = (np.random.rand(n) * 2).astype(np.int32)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these lines moved here?

Copy link
Member Author

@belldandyxtq belldandyxtq Jul 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chainer.get_type is more convenient to be used in a context.

def get_dtype(dtype=None, map_mixed16=None):

@belldandyxtq belldandyxtq force-pushed the mixed16_tests_for_multi_node_chain_list branch from 4b605f4 to 00e9039 Compare July 18, 2019 07:13
This commit adds mixed16 tests to multi-node chain list
@belldandyxtq belldandyxtq force-pushed the mixed16_tests_for_multi_node_chain_list branch from 00e9039 to c06e421 Compare July 18, 2019 07:16
@kuenishi
Copy link
Member

Jenkins, test this please.

@chainer-ci
Copy link
Member

Jenkins CI test (for commit c06e421, target branch master) failed with status FAILURE.

@kuenishi kuenishi merged commit 8c5ffba into chainer:master Jul 19, 2019
@kmaehashi kmaehashi added this to the v7.0.0b3 milestone Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:test Test or CI related. ChainerMN Related to ChainerMN.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants