Conversation
@mxnet-label-bot add [MKLDNN, pr-awaiting-review] |
tests/python/mkl/test_mkldnn.py
Outdated
@@ -398,6 +398,24 @@ def softmax_forward(input_data, true_output): | |||
softmax_forward(mx.nd.array([[[[-3.4e38,-3.4e38]]]]), np.array([1.0,1.0])) | |||
softmax_forward(mx.nd.array([[[[3.4e38,3.4e38]]]]), np.array([1.0,1.0])) | |||
|
|||
def test_deconvolution_inference(): | |||
np.random.seed(12345) |
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.
set random seed @with_seed()
@juliusshufan Could you help to check if the issue of DCGAN can be fixed via this PR? Thank you. |
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.
@azai91 Could help to check why this issue was not exposed in tests/python/gpu/test_operator_gpu.py? I think there are several deconv tests.
tests/python/mkl/test_mkldnn.py
Outdated
@@ -398,6 +398,24 @@ def softmax_forward(input_data, true_output): | |||
softmax_forward(mx.nd.array([[[[-3.4e38,-3.4e38]]]]), np.array([1.0,1.0])) | |||
softmax_forward(mx.nd.array([[[[3.4e38,3.4e38]]]]), np.array([1.0,1.0])) | |||
|
|||
@with_seed(12345) |
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.
No need to use a fixed seed 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.
@TaoLv do you mean tests/python/unittest/test_operator.py. The tests in tests/python/gpu/test_operator_gpu.py are only meant to run with gpu context.
I see that there are tests in tests/python/unittest/test_operator.py for deconv but they are also skipped because of flakiness. Doesnt seem like we have any coverage on the Deconvolution operator for CPU
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.
nvm. forgot about the check_consistency tests.
@TaoLv I think you're referring to this test? https://github.com/apache/incubator-mxnet/blob/dc3648bd910092c2ded2d67b6fb66d48d91f55ce/tests/python/gpu/test_operator_gpu.py#L628 looking into |
the difference is that the unit test does not use filter length that is divisible by 8. When the the input shape has a filter size that is divisible by 8, then mkldnn reorders the data and thus the check fails. the gpu tests uses filter length of 8. |
tests/python/mkl/test_mkldnn.py
Outdated
exe = y.simple_bind(ctx=mx.cpu(), x=shape, grad_req='null') | ||
exe.arg_arrays[0][:] = np.random.normal(size=exe.arg_arrays[0].shape) | ||
exe.arg_arrays[1][:] = np.random.normal(size=exe.arg_arrays[1].shape) | ||
for i in range(10): |
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.
nit: do we need this 10 times.
tests/python/mkl/test_mkldnn.py
Outdated
for i in range(10): | ||
exe.forward(is_train=False) | ||
o = exe.outputs[0] | ||
t = o.asnumpy() |
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.
can we just do exe.outputs[0].wait_to_read()
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.
you're right. this is only dependent on the shape and not values.
Nice catch. Do you mind adding new test shapes to the tests in |
@azai91 The previously encountered issue can't be reproduced on applying your PR on the MXNET repo. |
what do you mean? the test changes don't catch the issue on the master branch which currently has the bug? |
@azai91 I can also reproduce the issue on an internal test case I am tracking, this case involving deconv, and the test case can pass with your fix.
|
@juliusshufan Please approve if this PR fix your issue. Thanks. |
@TaoLv from @juliusshufan 's comment this PR fixed his failing test. |
Thanks, @azai91 @anirudh2290 @juliusshufan . Now I will close the corresponding issue. |
@azai91 Do you mind porting this PR to v1.4.x? |
* add test case * revert refactor * use with seed decorator * retrigger * remove seed * remove iteration * remove old test * update deconvolution test to have filter length that triggers mkldnn reorder
* add test case * revert refactor * use with seed decorator * retrigger * remove seed * remove iteration * remove old test * update deconvolution test to have filter length that triggers mkldnn reorder
Description
PR to fix issues - #13421. Added unit test for deconvolution inference and reverted refactor change to mkldnn deconvolution inference commmited in #11778.
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments