This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 0bec94b  [MXNET-620]Fix flaky test batchnorm training (#11544)
0bec94b is described below

commit 0bec94ba282135296fbde55233ad0558707d9358
Author: Lai Wei <[email protected]>
AuthorDate: Tue Jul 10 11:30:45 2018 -0700

    [MXNET-620]Fix flaky test batchnorm training (#11544)
    
    * increase atol to 1e-2
    
    * enable test_batchnorm_training
    
    * remove row_sparse as it's tested in another test, increase mkldnn 
batchnorm test atol to 1e-2
---
 tests/python/mkl/test_mkldnn.py        |  2 +-
 tests/python/unittest/test_operator.py | 19 +++++++++----------
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/tests/python/mkl/test_mkldnn.py b/tests/python/mkl/test_mkldnn.py
index dad1bd7..8c296de 100644
--- a/tests/python/mkl/test_mkldnn.py
+++ b/tests/python/mkl/test_mkldnn.py
@@ -234,7 +234,7 @@ def test_batchnorm():
             mean_std = [mx.nd.array(rolling_mean).tostype(stype), 
mx.nd.array(rolling_std).tostype(stype)]
 
             test = mx.symbol.BatchNorm(data, fix_gamma=True)
-            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-4)
+            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-2)
 
     stypes = ['row_sparse', 'default']
     for stype in stypes:
diff --git a/tests/python/unittest/test_operator.py 
b/tests/python/unittest/test_operator.py
index ae5cba2..faaa45e 100644
--- a/tests/python/unittest/test_operator.py
+++ b/tests/python/unittest/test_operator.py
@@ -1445,7 +1445,6 @@ def test_nearest_upsampling():
                     check_nearest_upsampling_with_shape(shapes, scale, 
root_scale)
 
 
[email protected]("test fails intermittently. temporarily disabled till it gets 
fixed. tracked at https://github.com/apache/incubator-mxnet/issues/8044";)
 @with_seed()
 def test_batchnorm_training():
     def check_batchnorm_training(stype):
@@ -1466,28 +1465,28 @@ def test_batchnorm_training():
             mean_std = [mx.nd.array(rolling_mean).tostype(stype), 
mx.nd.array(rolling_std).tostype(stype)]
 
             test = mx.symbol.BatchNorm_v1(data, fix_gamma=True)
-            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-4)
+            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-2)
 
             test = mx.symbol.BatchNorm(data, fix_gamma=True)
-            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-4)
+            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-2)
 
             test = mx.symbol.BatchNorm_v1(data, fix_gamma=True, 
use_global_stats=True)
-            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-4)
+            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-2)
 
             test = mx.symbol.BatchNorm(data, fix_gamma=True, 
use_global_stats=True)
-            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-4)
+            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-2)
 
             test = mx.symbol.BatchNorm_v1(data, fix_gamma=False)
-            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-4)
+            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-2)
 
             test = mx.symbol.BatchNorm(data, fix_gamma=False)
-            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-4)
+            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-2)
 
             test = mx.symbol.BatchNorm_v1(data, fix_gamma=False, 
use_global_stats=True)
-            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-4)
+            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-2)
 
             test = mx.symbol.BatchNorm(data, fix_gamma=False, 
use_global_stats=True)
-            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-4)
+            check_numeric_gradient(test, in_location, mean_std, 
numeric_eps=1e-2, rtol=0.16, atol=1e-2)
 
             # Test varying channel axis
             dim = len(shape)
@@ -1527,7 +1526,7 @@ def test_batchnorm_training():
                 test = mx.symbol.BatchNorm(data, fix_gamma=False, 
use_global_stats=True, axis=chaxis)
                 check_numeric_gradient(test, in_location, xmean_std, 
numeric_eps=1e-2, rtol=0.2, atol=0.01)
 
-    stypes = ['row_sparse', 'default']
+    stypes = ['default']
     for stype in stypes:
         check_batchnorm_training(stype)
 

Reply via email to