From 20a2480dc904f833c661dddc02c5755bc60d11f3 Mon Sep 17 00:00:00 2001 From: Roshani Nagmote Date: Thu, 2 Aug 2018 15:27:19 -0700 Subject: [PATCH 1/3] adjusting tolerance level and removing fixed seed --- tests/python/gpu/test_operator_gpu.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/tests/python/gpu/test_operator_gpu.py b/tests/python/gpu/test_operator_gpu.py index 3d799aa5319b..7bca65275c7d 100644 --- a/tests/python/gpu/test_operator_gpu.py +++ b/tests/python/gpu/test_operator_gpu.py @@ -127,7 +127,7 @@ def check_ifft(shape): init_complex.real[:,i] = init[0][:,2*i] init_complex.imag[:,i] = init[0][:,2*i+1] a = np.fft.ifft(init_complex, n=None, axis=-1, norm=None) - assert_almost_equal(a.real, out1[0]/shape_old[1],rtol=1e-3, atol=1e-12) + assert_almost_equal(a.real, out1[0]/shape_old[1],rtol=1e-3, atol=1e-5) if len(shape) == 4: init_complex = np.zeros(shape_old,dtype = np.complex64) @@ -135,7 +135,7 @@ def check_ifft(shape): init_complex.real[:,:,:,i] = init[0][:,:,:,2*i] init_complex.imag[:,:,:,i] = init[0][:,:,:,2*i+1] a = np.fft.ifft(init_complex, n=None, axis=-1, norm=None) - assert_almost_equal(a.real, out1[0]/shape_old[3],rtol=1e-3, atol=1e-12) + assert_almost_equal(a.real, out1[0]/shape_old[3],rtol=1e-3, atol=1e-5) # backward if len(shape) == 2: out_grad = mx.nd.empty(shape_old) @@ -148,7 +148,7 @@ def check_ifft(shape): temp[:,i] = exe.grad_arrays[0].asnumpy()[:,2*i] a = np.fft.fft(out_grad.asnumpy(), n=None, axis=-1, norm=None) - assert_almost_equal(a.real, temp, rtol=1e-3, atol=1e-12) + assert_almost_equal(a.real, temp, rtol=1e-3, atol=1e-5) if len(shape) == 4: out_grad = mx.nd.empty(shape_old) out_grad[:] = np.random.normal(-3, 3, shape_old) @@ -160,9 +160,11 @@ def check_ifft(shape): temp[:,:,:,i] = exe.grad_arrays[0].asnumpy()[:,:,:,2*i] a = np.fft.fft(out_grad.asnumpy(), n=None, axis=-1, norm=None) - assert_almost_equal(a.real, temp, rtol=1e-3, atol=1e-12) + assert_almost_equal(a.real, temp, rtol=1e-3, atol=1e-5) -@with_seed(0) +# @roshrini - removing fixed seed for this test. raised tolerance level. +# Issue to track: https://github.com/apache/incubator-mxnet/issues/11731 +@with_seed() def test_ifft(): nrepeat = 2 maxdim = 10 @@ -221,7 +223,7 @@ def check_fft(shape): a[i,j,:,p+1] = out2[i,j+out1[0].shape[1],:,k] p = p+2 - assert_almost_equal(a, out1[0],rtol=1e-3, atol=1e-6) + assert_almost_equal(a, out1[0],rtol=1e-3, atol=1e-5) # backward if len(shape) == 2: @@ -235,7 +237,7 @@ def check_fft(shape): for exe in exe_list: exe.backward([out_grad]) a = np.fft.ifft(out_grad_complex, n=None, axis=-1, norm=None) - assert_almost_equal(a.real, exe.grad_arrays[0].asnumpy()/shape[1],rtol=1e-3, atol=1e-8) + assert_almost_equal(a.real, exe.grad_arrays[0].asnumpy()/shape[1],rtol=1e-3, atol=1e-5) if len(shape) == 4: out_grad = mx.nd.empty(out1[0].shape) @@ -248,9 +250,11 @@ def check_fft(shape): for exe in exe_list: exe.backward([out_grad]) a = np.fft.ifft(out_grad_complex, n=None, axis=-1, norm=None) - assert_almost_equal(a.real, exe.grad_arrays[0].asnumpy()/shape[3],rtol=1e-3, atol=1e-6) + assert_almost_equal(a.real, exe.grad_arrays[0].asnumpy()/shape[3],rtol=1e-3, atol=1e-5) -@with_seed(0) +# @roshrini - removing fixed seed for this test. raised tolerance level. +# Issue to track: https://github.com/apache/incubator-mxnet/issues/11730 +@with_seed() def test_fft(): nrepeat = 2 maxdim = 10 From 9331116ffca1901ca1f85a200cbacee022e59ee8 Mon Sep 17 00:00:00 2001 From: Roshani Nagmote Date: Fri, 3 Aug 2018 07:05:56 -0700 Subject: [PATCH 2/3] CI retrigger --- tests/python/gpu/test_operator_gpu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/gpu/test_operator_gpu.py b/tests/python/gpu/test_operator_gpu.py index 7bca65275c7d..2487fb906208 100644 --- a/tests/python/gpu/test_operator_gpu.py +++ b/tests/python/gpu/test_operator_gpu.py @@ -196,7 +196,7 @@ def check_fft(shape): for exe in exe_list: for arr, iarr in zip(exe.arg_arrays, init): arr[:] = iarr.astype(arr.dtype) - #forward + # forward for exe in exe_list: exe.forward(is_train=True) out1 = [exe.outputs[0].asnumpy() for exe in exe_list] From a79e7f8a25a2577574978ceefdbe38ed28b3e9c7 Mon Sep 17 00:00:00 2001 From: Roshani Nagmote Date: Mon, 6 Aug 2018 10:26:39 -0700 Subject: [PATCH 3/3] removing status --- tests/python/gpu/test_operator_gpu.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/python/gpu/test_operator_gpu.py b/tests/python/gpu/test_operator_gpu.py index 2487fb906208..9dbf5f0825a8 100644 --- a/tests/python/gpu/test_operator_gpu.py +++ b/tests/python/gpu/test_operator_gpu.py @@ -162,8 +162,6 @@ def check_ifft(shape): a = np.fft.fft(out_grad.asnumpy(), n=None, axis=-1, norm=None) assert_almost_equal(a.real, temp, rtol=1e-3, atol=1e-5) -# @roshrini - removing fixed seed for this test. raised tolerance level. -# Issue to track: https://github.com/apache/incubator-mxnet/issues/11731 @with_seed() def test_ifft(): nrepeat = 2 @@ -252,8 +250,6 @@ def check_fft(shape): a = np.fft.ifft(out_grad_complex, n=None, axis=-1, norm=None) assert_almost_equal(a.real, exe.grad_arrays[0].asnumpy()/shape[3],rtol=1e-3, atol=1e-5) -# @roshrini - removing fixed seed for this test. raised tolerance level. -# Issue to track: https://github.com/apache/incubator-mxnet/issues/11730 @with_seed() def test_fft(): nrepeat = 2