heaseny opened a new issue #18015: [Unit test] 2 unit tests of 
test_optimizer.py randomly fail due to assertion error
URL: https://github.com/apache/incubator-mxnet/issues/18015
 
 
   ## Description
   test_ftrl and test_sparse_ftrl  of test_optimizer.py fail randomly and can 
be reproduced with seed on master branch latest commit.
   MXNET_TEST_SEED=2129777731 nosetests -s -v 
tests/python/unittest/test_optimizer.py:test_sparse_ftrl
   MXNET_TEST_SEED=2085448245 nosetests -s -v 
tests/python/unittest/test_optimizer.py:test_ftrl 
   ### Error Message
   ======================================================================
   FAIL: test_optimizer.test_sparse_ftrl
   ----------------------------------------------------------------------
   Traceback (most recent call last):
     File 
"/home/mxnet/anacondaenv/anaconda3_mxnet/envs/mxnet_daily_py3_debug/lib/python3.6/site-packages/nose/case.py",
 line 197, in runTest
       self.test(*self.arg)
     File 
"/home/mxnet/workspace/source/incubator-mxnet/tests/python/unittest/common.py", 
line 215, in test_new
       orig_test(*args, **kwargs)
     File 
"/home/mxnet/workspace/source/incubator-mxnet/tests/python/unittest/test_optimizer.py",
 line 717, in test_sparse_ftrl
       rtol=1e-4, atol=1e-4)
     File 
"/home/mxnet/anacondaenv/anaconda3_mxnet/envs/mxnet_daily_py3_debug/lib/python3.6/site-packages/mxnet-2.0.0-py3.6.egg/mxnet/test_utils.py",
 line 2326, in compare_optimizer
       compare_ndarray_tuple(tuple(w1_list), tuple(w2_list), rtol=rtol, 
atol=atol)
     File 
"/home/mxnet/anacondaenv/anaconda3_mxnet/envs/mxnet_daily_py3_debug/lib/python3.6/site-packages/mxnet-2.0.0-py3.6.egg/mxnet/test_utils.py",
 line 2279, in compare_ndarray_tuple
       compare_ndarray_tuple(s1, s2, rtol, atol)
     File 
"/home/mxnet/anacondaenv/anaconda3_mxnet/envs/mxnet_daily_py3_debug/lib/python3.6/site-packages/mxnet-2.0.0-py3.6.egg/mxnet/test_utils.py",
 line 2281, in compare_ndarray_tuple
       assert_almost_equal(t1, t2, rtol=rtol, atol=atol)
     File 
"/home/mxnet/anacondaenv/anaconda3_mxnet/envs/mxnet_daily_py3_debug/lib/python3.6/site-packages/mxnet-2.0.0-py3.6.egg/mxnet/test_utils.py",
 line 637, in assert_almost_equal
       raise AssertionError(msg)
   AssertionError:
   Items are not equal:
   Error 1.049805 exceeds tolerance rtol=1.000000e-04, atol=1.000000e-04 
(mismatch 1.666667%).
   Location of maximum error: (0, 3, 1), a=0.16198730, b=0.16186523
    ACTUAL: array([[[ 0.       ,  0.2236   , -0.       ,  0.0002441,  0.       
],
           [ 0.05914  ,  0.06915  ,  0.       , -0.02031  ,  0.00795  ],
           [ 0.004116 ,  0.0171   ,  0.0321   ,  0.       ,  0.1605   ],...
    DESIRED: array([[[ 0.       ,  0.2236   , -0.       ,  0.0002441,  0.       
],
           [ 0.05914  ,  0.06915  ,  0.       , -0.02031  ,  0.00795  ],
           [ 0.004116 ,  0.0171   ,  0.0321   ,  0.       ,  0.1605   ],...
   -------------------- >> begin captured logging << --------------------
   common: INFO: Setting module np/mx/python random seeds, use 
MXNET_MODULE_SEED=75654305 to reproduce.
   common: WARNING: *** test-level seed set: all "@with_seed()" tests run 
deterministically ***
   common: INFO: Setting test np/mx/python random seeds, use 
MXNET_TEST_SEED=2129777731 to reproduce.
   --------------------- >> end captured logging << ---------------------
   
   ----------------------------------------------------------------------
   Ran 1 test in 6.137s
   
   FAILED (failures=1)
   
   
   nosetests -s -v test_optimizer:test_ftrl 2>&1 [INFO] Setting module 
np/mx/python random seeds, use MXNET_MODULE_SEED=2085448245 to reproduce.
   test_optimizer.test_ftrl ... [INFO] Setting test np/mx/python random seeds, 
use MXNET_TEST_SEED=672842212 to reproduce.
   FAIL
   
   ======================================================================
   FAIL: test_optimizer.test_ftrl
   ----------------------------------------------------------------------
   Traceback (most recent call last):
     File 
"/home/mxnet/anacondaenv/mxnet_ubuntu/envs/mxnet_preci_ubuntu_03/lib/python3.6/site-packages/nose/case.py",
 line 197, in runTest
       self.test(*self.arg)
     File 
"/mnt/jenkins_dir/workspace/MXNet_PreCI/mxnet_preci/tests/python/unittest/common.py",
 line 215, in test_new
       orig_test(*args, **kwargs)
     File 
"/mnt/jenkins_dir/workspace/MXNet_PreCI/mxnet_preci/tests/python/unittest/test_optimizer.py",
 line 692, in test_ftrl
       rtol=1e-4, atol=1e-4)
     File 
"/home/mxnet/anacondaenv/mxnet_ubuntu/envs/mxnet_preci_ubuntu_03/lib/python3.6/site-packages/mxnet-2.0.0-py3.6.egg/mxnet/test_utils.py",
 line 2326, in compare_optimizer
       compare_ndarray_tuple(tuple(w1_list), tuple(w2_list), rtol=rtol, 
atol=atol)
     File 
"/home/mxnet/anacondaenv/mxnet_ubuntu/envs/mxnet_preci_ubuntu_03/lib/python3.6/site-packages/mxnet-2.0.0-py3.6.egg/mxnet/test_utils.py",
 line 2279, in compare_ndarray_tuple
       compare_ndarray_tuple(s1, s2, rtol, atol)
     File 
"/home/mxnet/anacondaenv/mxnet_ubuntu/envs/mxnet_preci_ubuntu_03/lib/python3.6/site-packages/mxnet-2.0.0-py3.6.egg/mxnet/test_utils.py",
 line 2281, in compare_ndarray_tuple
       assert_almost_equal(t1, t2, rtol=rtol, atol=atol)
     File 
"/home/mxnet/anacondaenv/mxnet_ubuntu/envs/mxnet_preci_ubuntu_03/lib/python3.6/site-packages/mxnet-2.0.0-py3.6.egg/mxnet/test_utils.py",
 line 637, in assert_almost_equal
       raise AssertionError(msg)
   AssertionError: 
   Items are not equal:
   Error 1.038086 exceeds tolerance rtol=1.000000e-04, atol=1.000000e-04 
(mismatch 1.666667%).
   Location of maximum error: (1, 2, 3), a=0.17529297, b=0.17517090
    ACTUAL: array([[[ 0.1858  ,  0.06128 ,  0.1536  ,  0.0569  ,  0.00931 ],
           [-0.02083 ,  0.03882 ,  0.0694  ,  0.3926  , -0.006363],
           [ 0.0287  ,  0.2588  ,  0.02467 ,  0.2166  ,  0.02672 ],...
    DESIRED: array([[[ 0.1858  ,  0.06128 ,  0.1536  ,  0.0569  ,  0.00931 ],
           [-0.02083 ,  0.03882 ,  0.0694  ,  0.3926  , -0.006363],
           [ 0.0287  ,  0.2588  ,  0.02467 ,  0.2166  ,  0.02672 ],...
   -------------------- >> begin captured logging << --------------------
   common: INFO: Setting module np/mx/python random seeds, use 
MXNET_MODULE_SEED=2085448245 to reproduce.
   common: INFO: Setting test np/mx/python random seeds, use 
MXNET_TEST_SEED=672842212 to reproduce.
   --------------------- >> end captured logging << ---------------------
   
   ----------------------------------------------------------------------
   Ran 1 test in 1.180s
   
   FAILED (failures=1)
   
   *** Maximum errors for vector of size 60:  rtol=0.0001, atol=0.0001
   
     1: Error 1.038086  Location of error: (1, 2, 3), a=0.17529297, b=0.17517090
   
   
   ## To Reproduce
   cd tests/python/unittest/
   MXNET_MODULE_SEED=2085448245 nosetests -s -v test_optimizer:test_ftrl 
   MXNET_TEST_SEED=2129777731 nosetests -s -v test_optimizer:test_sparse_ftrl
   
   ### Steps to reproduce
   1. Get latest source code ( commit: d8c7293ac8e73) and build with mkl
   make -j USE_MKLDNN=1 USE_OPENCV=1 USE_BLAS=mkl USE_GPERFTOOLS=0 
USE_INTEL_PATH=/opt/intel/
   2. Change directory to tests/python/unittest/ and try with below commands:
   MXNET_MODULE_SEED=2085448245 nosetests -s -v test_optimizer:test_ftrl 
   MXNET_TEST_SEED=2129777731 nosetests -s -v test_optimizer:test_sparse_ftrl
   
   
   ## Environment
   GCC: 5.3.1 and 7.3.1
   CMAKE: 3.14.0
   Python: 3.6.8
   OS: CentOS Linux release 7.6.1810 (Core)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to