You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
NumPy 1.20.0 on openSUSE Tumbleweed 32-bit looks even worse than Ubuntu some years ago (#430):
[ 1044s] __________________________ TestRandomDist.test_pareto __________________________
[ 1044s] [gw4] linux -- Python 3.8.7 /usr/bin/python3.8
[ 1044s]
[ 1044s] self = <numpy.random.tests.test_generator_mt19937.TestRandomDist object at 0xf06d9bc8>
[ 1044s]
[ 1044s] def test_pareto(self):
[ 1044s] random = Generator(MT19937(self.seed))
[ 1044s] actual = random.pareto(a=.123456789, size=(3, 2))
[ 1044s] desired = np.array([[1.0394926776069018e+00, 7.7142534343505773e+04],
[ 1044s] [7.2640150889064703e-01, 3.4650454783825594e+05],
[ 1044s] [4.5852344481994740e+04, 6.5851383009539105e+07]])
[ 1044s] # For some reason on 32-bit x86 Ubuntu 12.10 the [1, 0] entry in this
[ 1044s] # matrix differs by 24 nulps. Discussion:
[ 1044s] # https://mail.python.org/pipermail/numpy-discussion/2012-September/063801.html
[ 1044s] # Consensus is that this is probably some gcc quirk that affects
[ 1044s] # rounding but not in any important way, so we just use a looser
[ 1044s] # tolerance on this test:
[ 1044s] > np.testing.assert_array_almost_equal_nulp(actual, desired, nulp=30)
[ 1044s] E AssertionError: X and Y are not equal to 30 ULP (max is 31)
[ 1044s]
[ 1044s] ../../../BUILDROOT/python-numpy-1.20.0-90.1.i386/usr/lib/python3.8/site-packages/numpy/random/tests/test_generator_mt19937.py:1520: AssertionError
What is a little interesting is that it doesn't occur in the same test for RandomState. Even though the underlying code is the same, the seeding of the MT19937 generator in the failing file is different from that in the RandomState, and so the test values are different.
I think it would be reasonable to relax the tolerance on 32-bit Linux as a pragmatic fix. It seems to be compiler-specific since the test doesn't fail on other 32-bit platforms including other 32-bit variants of Linux.
Activity
seberg commentedon Feb 10, 2021
I am surprised anything changed here, but marking for 1.20.2, just so that its not lost by accident. For what its worth, the mailing list link is slightly off for me, and this gives the right one:
https://mail.python.org/pipermail/numpy-discussion/2012-September/063764.html
Out of curiosity, do you know that this is a regression in that the 1.19 passed fine with the same compiler versions, etc?
bnavigator commentedon Feb 10, 2021
See #18388 for build logs. Here is a passing one for 1.19.5:
numpy-1.19-i586_log.txt
bashtage commentedon Feb 11, 2021
What is a little interesting is that it doesn't occur in the same test for RandomState. Even though the underlying code is the same, the seeding of the MT19937 generator in the failing file is different from that in the RandomState, and so the test values are different.
charris commentedon Mar 27, 2021
I cleared the milestone here. @bashtage Seems this is a value issue/
bashtage commentedon Mar 27, 2021
I think it would be reasonable to relax the tolerance on 32-bit Linux as a pragmatic fix. It seems to be compiler-specific since the test doesn't fail on other 32-bit platforms including other 32-bit variants of Linux.
apteryks commentedon Apr 19, 2022
I also reproduce this on i686-linux (GNU Guix). The
test_float_remainder_overflowtest also failed there: