-
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
Add Mixed16 tests to multi-node chain List #7630
Add Mixed16 tests to multi-node chain List #7630
Conversation
pfnci, test this please |
Jenkins CI test (for commit 54df4db, target branch master) failed with status FAILURE. |
pfnci, test this please |
Jenkins CI test (for commit 4b605f4, target branch master) failed with status FAILURE. |
@@ -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) |
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.
What is the intention here on explicitly setting map_mixed16
? I'm afraid we don't need this line.
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.
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
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.
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
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.
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) |
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.
ditto
|
||
with chainer.using_config('dtype', param.dtype): | ||
io_dtype = chainer.get_dtype(map_mixed16=np.float16) |
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.
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) |
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.
Why are these lines moved here?
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.
The chainer.get_type is more convenient to be used in a context.
Line 291 in d297a17
def get_dtype(dtype=None, map_mixed16=None): |
4b605f4
to
00e9039
Compare
This commit adds mixed16 tests to multi-node chain list
00e9039
to
c06e421
Compare
Jenkins, test this please. |
Jenkins CI test (for commit c06e421, target branch master) failed with status FAILURE. |
This commit adds mixed16 tests to multi-node chain list
Thank you for creating a pull request!
Please double-check the following.