Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Test failures from BLAS-flavour testing for 1.13 in conda-forge #20472

Open
h-vetinari opened this issue Apr 14, 2024 · 2 comments
Open
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected

Comments

@h-vetinari
Copy link
Member

h-vetinari commented Apr 14, 2024

Collecting the various test failures (new and existing) from conda-forge/scipy-feedstock#273, I made a distinction whether something is affecting the main BLAS flavours (e.g. the conda-forge default, or other frequently used implementations like MKL), or regarding the severity of the failure (e.g. crash vs. minor tolerance violation) when opening new issues.

Here's a list of already existing or new stand-alone issues:

A note on PyPy

On linux-64, PyPy 7.3.15 hangs completely, while on osx & win, there are merely additional test failures (compared to CPython).

Other failures

linux-64 + blis / osx + accelerate: minor tolerance violation in test_x0_working[tfqmr]
____________________________ test_x0_working[tfqmr] ____________________________
[gw1] linux -- Python 3.9.19 $PREFIX/bin/python
$PREFIX/lib/python3.9/site-packages/scipy/sparse/linalg/_isolve/tests/test_iterative.py:507: in test_x0_working
    assert norm(A @ x - b) <= 2e-6*norm(b)
E   assert 3.5355292454346426e-06 <= (2e-06 * 1.240298651028214)
E    +  where 3.5355292454346426e-06 = norm(((array([[3.68514493, 2.22433683, 2.80424149, 2.06524296, 2.82772901,\n        1.70134349, 2.98806253, 2.88379072, 1.9578..., 2.29515724, 2.77591422, 1.55001596, 1.93969785,\n        1.88091968, 2.24894423, 2.49791763, 1.66944017, 2.12310297]]) @ array([ -1.22142941, -23.52880604,  -4.72398545, -21.36850239,\n       -12.68971238,  -0.96740459,  32.8587725 , -11.40286367,\n        10.993623  ,  30.93083318])) - array([0.55127821, 0.22828434, 0.09135873, 0.07249963, 0.11693987,\n       0.74246847, 0.72216603, 0.1607452 , 0.15471589, 0.18022921])))
E    +  and   1.240298651028214 = norm(array([0.55127821, 0.22828434, 0.09135873, 0.07249963, 0.11693987,\n       0.74246847, 0.72216603, 0.1607452 , 0.15471589, 0.18022921]))
        A          = array([[3.68514493, 2.22433683, 2.80424149, 2.06524296, 2.82772901,
        1.70134349, 2.98806253, 2.88379072, 1.9578..., 2.29515724, 2.77591422, 1.55001596, 1.93969785,
        1.88091968, 2.24894423, 2.49791763, 1.66944017, 2.12310297]])
        b          = array([0.55127821, 0.22828434, 0.09135873, 0.07249963, 0.11693987,
       0.74246847, 0.72216603, 0.1607452 , 0.15471589, 0.18022921])
        info       = 0
        kw         = {'atol': 0, 'rtol': 1e-06}
        n          = 10
        rng        = Generator(PCG64) at 0x7FBA278194A0
        solver     = <function tfqmr at 0x7fba34af4b80>
        x          = array([ -1.22142941, -23.52880604,  -4.72398545, -21.36850239,
       -12.68971238,  -0.96740459,  32.8587725 , -11.40286367,
        10.993623  ,  30.93083318])
        x0         = array([0.63685093, 0.46836296, 0.0677924 , 0.52832101, 0.49467215,
       0.68333247, 0.3392967 , 0.57867322, 0.25729156, 0.60952728])
linux-64 + MKL: single-element tolerance violation in TestKMean.test_krandinit[numpy]
_______________________ TestKMean.test_krandinit[numpy] ________________________
[gw0] linux -- Python 3.11.8 $PREFIX/bin/python
$PREFIX/lib/python3.11/site-packages/scipy/cluster/tests/test_vq.py:353: in test_krandinit
    xp_assert_close(orig_cov, init_cov, atol=1e-2)
        data       = array([[-2.2 ,  1.17, -1.63,  1.69, -2.04,  4.38, -3.09,  0.95, -1.7 ,
         4.79, -1.68,  0.68, -2.26,  3.34, -2.2...75, -2.25,  1.71, -3.28,
         3.38, -1.74,  0.88, -2.41,  1.92, -2.24,  1.19, -2.48,  1.06,
        -1.68, -0.62]])
        datas      = [array([[-2.2 ,  1.17],
       [-1.63,  1.69],
       [-2.04,  4.38],
       [-3.09,  0.95],
       [-1.7 ,  4.79],
  ...5, -2.25,  1.71, -3.28,
         3.38, -1.74,  0.88, -2.41,  1.92, -2.24,  1.19, -2.48,  1.06,
        -1.68, -0.62]])]
        init       = array([[-1.55614868, -0.5955572 , -1.14277154, ...,  1.06323592,
        -1.4042778 ,  4.2915102 ],
       [-1.5199948...012,  2.05841291],
       [-1.82097104,  0.48772385, -4.30463642, ..., -0.02417925,
        -2.36226902,  1.46849236]])
        init_cov   = array([[ 2.52765840e-01, -2.12853305e-01, -1.70382413e-01,
        -3.35383740e-01,  3.08041712e-01, -5.99226107e-01,
...-8.46350354e-01,
         9.73843820e-01,  7.60819946e-02, -2.40444555e-01,
        -1.05667721e+00,  1.94581156e+00]])
        k          = 1000000
        orig_cov   = array([[ 2.53401111e-01, -2.13683333e-01, -1.70653333e-01,
        -3.35983333e-01,  3.09443333e-01, -6.01860000e-01,
...-8.46272222e-01,
         9.76020000e-01,  7.60555556e-02, -2.42171111e-01,
        -1.06294000e+00,  1.95102333e+00]])
        rng        = Generator(PCG64) at 0x7F0AD379AB20
        self       = <scipy.cluster.tests.test_vq.TestKMean object at 0x7f0ae2c23c50>
        xp         = <module 'numpy' from '/home/conda/feedstock_root/build_artifacts/scipy-split_1713003735196/_test_env_placehold_placeho...ehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib/python3.11/site-packages/numpy/__init__.py'>
$PREFIX/lib/python3.11/contextlib.py:81: in inner
    return func(*args, **kwds)
E   AssertionError: 
E   Not equal to tolerance rtol=1e-07, atol=0.01
E   
E   Mismatched elements: 1 / 400 (0.25%)
E   Max absolute difference: 0.01098377
E   Max relative difference: 0.16674294
E    x: array([[ 2.534011e-01, -2.136833e-01, -1.706533e-01, -3.359833e-01,
E            3.094433e-01, -6.018600e-01,  1.971678e-01, -1.761122e-01,
E           -3.160811e-01,  3.538044e-01, -3.322333e-02, -4.241900e-01,...
E    y: array([[ 2.527658e-01, -2.128533e-01, -1.703824e-01, -3.353837e-01,
E            3.080417e-01, -5.992261e-01,  1.964842e-01, -1.761007e-01,
E           -3.145892e-01,  3.528359e-01, -3.218698e-02, -4.244195e-01,...
        args       = (<function assert_allclose.<locals>.compare at 0x7f0ad3823560>, array([[ 2.53401111e-01, -2.13683333e-01, -1.70653333e...8.46350354e-01,
         9.73843820e-01,  7.60819946e-02, -2.40444555e-01,
        -1.05667721e+00,  1.94581156e+00]]))
        func       = <function assert_array_compare at 0x7f0af4933100>
        kwds       = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-07, atol=0.01', 'verbose': True}
        self       = <contextlib._GeneratorContextManager object at 0x7f0af495ca50>
osx-64 + MKL + PyPy: in test_cossin[True-40-12-20-float32]

Unclear why this only shows up in this combination (osx, MKL, PyPy); previously (for 1.12) also test_cossin[False-40-12-20-float32] failed.

______________________ test_cossin[True-40-12-20-float32] ______________________
[gw2] darwin -- Python 3.9.18 $PREFIX/bin/python
$PREFIX/lib/pypy3.9/site-packages/scipy/linalg/tests/test_decomp_cossin.py:61: in test_cossin
    assert_allclose(u, u2, rtol=0., atol=10*np.finfo(dtype_).eps)
        _          = array([], shape=(0, 0), dtype=float32)
        cs         = array([[0.9776542 , 0.        , 0.        , ..., 0.        , 0.        ,
        0.        ],
       [0.        , 0.93...       ],
       [0.        , 0.        , 0.        , ..., 0.        , 0.        ,
        0.        ]], dtype=float32)
        cs2        = array([[0.9776543 , 0.        , 0.        , ..., 0.        , 0.        ,
        0.        ],
       [0.        , 0.93...       ],
       [0.        , 0.        , 0.        , ..., 0.        , 0.        ,
        0.        ]], dtype=float32)
        dtype_     = <class 'numpy.float32'>
        m          = 40
        p          = 12
        q          = 20
        rng        = Generator(PCG64) at 0x7F80C2F5AEE0
        swap_sign  = True
        u          = array([[-0.06412254, -0.169602  ,  0.3865385 , ...,  0.        ,
         0.        ,  0.        ],
       [-0.217334 ...6],
       [ 0.        ,  0.        ,  0.        , ...,  0.15757903,
        -0.14554036, -0.19666514]], dtype=float32)
        u2         = array([[-0.06412242,  0.1696023 ,  0.3865385 , ...,  0.        ,
         0.        ,  0.        ],
       [-0.2173338...6],
       [ 0.        ,  0.        ,  0.        , ...,  0.15757942,
        -0.14554064, -0.1966648 ]], dtype=float32)
        vh         = array([[ 0.13631816, -0.20160665, -0.25449932, ...,  0.        ,
         0.        ,  0.        ],
       [ 0.0383219... ],
       [ 0.        ,  0.        ,  0.        , ...,  0.13668793,
         0.01040455, -0.26890454]], dtype=float32)
        vh2        = array([[ 0.13631816, -0.20160665, -0.25449932, ...,  0.        ,
         0.        ,  0.        ],
       [ 0.0383219... ],
       [ 0.        ,  0.        ,  0.        , ...,  0.13668793,
         0.01040455, -0.26890454]], dtype=float32)
        x          = array([[-0.02367539,  0.40119368, -0.05368597, ...,  0.17337501,
         0.37582624,  0.01585775],
       [ 0.0132678...1],
       [ 0.15149911,  0.1761488 , -0.08100508, ..., -0.14594388,
        -0.35172257, -0.04196982]], dtype=float32)
$PREFIX/lib/pypy3.9/contextlib.py:79: in inner
    return func(*args, **kwds)
E   AssertionError: 
E   Not equal to tolerance rtol=0, atol=1.19209e-06
E   
E   Mismatched elements: 161 / 1600 (10.1%)
E   Max absolute difference: 1.2539275
E   Max relative difference: 2.0001893
E    x: array([[-0.064123, -0.169602,  0.386539, ...,  0.      ,  0.      ,
E            0.      ],
E          [-0.217334, -0.533708, -0.280909, ...,  0.      ,  0.      ,...
E    y: array([[-0.064122,  0.169602,  0.386539, ...,  0.      ,  0.      ,
E            0.      ],
E          [-0.217334,  0.533708, -0.280909, ...,  0.      ,  0.      ,...
        args       = (<function assert_allclose.<locals>.compare at 0x00007f80b7eb2660>, array([[-0.06412254, -0.169602  ,  0.3865385 , ......],
       [ 0.        ,  0.        ,  0.        , ...,  0.15757942,
        -0.14554064, -0.1966648 ]], dtype=float32))
        func       = <function assert_array_compare at 0x00007f80c7d3a340>
        kwds       = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=0, atol=1.19209e-06', 'verbose': True}
        self       = <contextlib._GeneratorContextManager object at 0x00007f80c7d483a0>
PyPy (everywhere): test_dunder_ror[dok_matrix]
_________________________ test_dunder_ror[dok_matrix] __________________________
[gw0] darwin -- Python 3.9.18 $PREFIX/bin/python
$PREFIX/lib/pypy3.9/site-packages/scipy/sparse/tests/test_dok.py:163: in test_dunder_ror
    assert d.__ror__(d) == Asp.__ror__(d)
E   AttributeError: 'dict' object has no attribute '__ror__'. Did you mean: '__ior__'?
        Asp        = <3x3 sparse matrix of type '<class 'numpy.float64'>'
	with 2 stored elements in Dictionary Of Keys format>
        d          = {(0, 1): 1, (0, 2): 2}

Fixed ✅

In #20474

{linux-64,win-64} + blis: minor (absolute) tolerance violation in TestRegularGridInterpolator.test_derivatives
_________________ TestRegularGridInterpolator.test_derivatives _________________
[gw1] linux -- Python 3.9.19 $PREFIX/bin/python
$PREFIX/lib/python3.9/site-packages/scipy/interpolate/tests/test_rgi.py:139: in test_derivatives
    assert_allclose(interp(sample, nu=(0, 1, 1, 0)),
        interp     = <scipy.interpolate._rgi.RegularGridInterpolator object at 0x7fba3082fa60>
        points     = [(0.0, 0.5, 1.0), (0.0, 0.5, 1.0), (0.0, 0.5, 1.0), (0.0, 0.5, 1.0)]
        sample     = array([[0.1 , 0.1 , 1.  , 0.9 ],
       [0.2 , 0.1 , 0.45, 0.8 ],
       [0.5 , 0.5 , 0.5 , 0.5 ]])
        self       = <scipy.interpolate.tests.test_rgi.TestRegularGridInterpolator object at 0x7fba3082f610>
        values     = array([[[[0.0000e+00, 5.0000e+02, 1.0000e+03],
         [5.0000e+01, 5.5000e+02, 1.0500e+03],
         [1.0000e+02, 6....1100e+02, 1.0110e+03],
         [6.1000e+01, 5.6100e+02, 1.0610e+03],
         [1.1100e+02, 6.1100e+02, 1.1110e+03]]]])
$PREFIX/lib/python3.9/contextlib.py:79: in inner
    return func(*args, **kwds)
E   AssertionError: 
E   Not equal to tolerance rtol=1e-07, atol=1e-12
E   
E   Mismatched elements: 1 / 3 (33.3%)
E   Max absolute difference: 1.02318154e-12
E   Max relative difference: inf
E    x: array([-1.023182e-12,  0.000000e+00, -9.094947e-13])
E    y: array([0, 0, 0])
        args       = (<function assert_allclose.<locals>.compare at 0x7fba23d8e8b0>, array([-1.02318154e-12,  0.00000000e+00, -9.09494702e-13]), array([0, 0, 0]))
        func       = <function assert_array_compare at 0x7fba3c55cb80>
        kwds       = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-07, atol=1e-12', 'verbose': True}
        self       = <contextlib._GeneratorContextManager object at 0x7fba3c5650a0>
osx-64 + accelerate: tolerance violation in TestInterpN.test_matrix_input[quintic]
____________________ TestInterpN.test_matrix_input[quintic] ____________________
[gw1] darwin -- Python 3.10.14 $PREFIX/bin/python
$PREFIX/lib/python3.10/site-packages/scipy/interpolate/tests/test_rgi.py:986: in test_matrix_input
    assert_allclose(v1, v2)
        method     = 'quintic'
        sample     = array([[[0.86763282, 0.44517443],
        [0.02918942, 0.10719824],
        [0.19625915, 0.23823634],
        [0.82451...3, 0.34864109],
        [0.48048149, 0.64392643],
        [0.62162643, 0.76119301],
        [0.28665106, 0.49238521]]])
        self       = <scipy.interpolate.tests.test_rgi.TestInterpN object at 0x119037370>
        v1         = array([[0.4789054 , 0.3514018 , 0.54012216, 0.54447361, 0.47604678,
        0.51217751, 0.04425903],
       [0.8209919...778, 0.68049855],
       [0.95113819, 0.548359  , 0.69364055, 0.32331236, 0.5971776 ,
        0.07371108, 0.82078431]])
        v2         = array([[0.47890549, 0.35140192, 0.54012223, 0.5444737 , 0.47604662,
        0.51217757, 0.04425903],
       [0.8209918...821, 0.68049851],
       [0.95113806, 0.54835903, 0.69364065, 0.32331228, 0.59717755,
        0.07371097, 0.82078419]])
        values     = matrix([[0.03931146, 0.43177652, 0.85427585, 0.42232848, 0.08844911,
         0.05669501, 0.10327285],
        [0.4853...2, 0.45127308],
        [0.65087142, 0.80930517, 0.28296286, 0.27338179, 0.38573719,
         0.42160812, 0.93216543]])
        x          = array([0. , 0.4, 0.8, 1.2, 1.6, 2. ])
        y          = array([0.        , 0.16666667, 0.33333333, 0.5       , 0.66666667,
       0.83333333, 1.        ])
$PREFIX/lib/python3.10/contextlib.py:79: in inner
    return func(*args, **kwds)
E   AssertionError: 
E   Not equal to tolerance rtol=1e-07, atol=0
E   
E   Mismatched elements: 15 / 21 (71.4%)
E   Max absolute difference: 4.27814137e-07
E   Max relative difference: 1.98036236e-06
E    x: array([[0.478905, 0.351402, 0.540122, 0.544474, 0.476047, 0.512178,
E           0.044259],
E          [0.820992, 0.284413, 1.280366, 0.476941, 0.861279, 0.216028,...
E    y: array([[0.478905, 0.351402, 0.540122, 0.544474, 0.476047, 0.512178,
E           0.044259],
E          [0.820992, 0.284413, 1.280366, 0.476941, 0.861279, 0.216028,...
        args       = (<function assert_allclose.<locals>.compare at 0x1278ff010>, array([[0.4789054 , 0.3514018 , 0.54012216, 0.54447361, 0...21, 0.68049851],
       [0.95113806, 0.54835903, 0.69364065, 0.32331228, 0.59717755,
        0.07371097, 0.82078419]]))
        func       = <function assert_array_compare at 0x1136a2ef0>
        kwds       = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-07, atol=0', 'verbose': True}
        self       = <contextlib._GeneratorContextManager object at 0x1136b8f40>
osx-64 + accelerate: tolerance violation in TestRBFInterpolatorNeighbors20.test_pickleable (flaky)
________________ TestRBFInterpolatorNeighbors20.test_pickleable ________________
[gw1] darwin -- Python 3.9.18 $PREFIX/bin/python
$PREFIX/lib/pypy3.9/site-packages/scipy/interpolate/tests/test_rbfinterp.py:418: in test_pickleable
    assert_array_equal(yitp1, yitp2)
        interp     = <scipy.interpolate._rbfinterp.RBFInterpolator object at 0x00007fd326723910>
        self       = <scipy.interpolate.tests.test_rbfinterp.TestRBFInterpolatorNeighbors20 object at 0x00007fd33e91ee90>
        seq        = <scipy.stats._qmc.Halton object at 0x00007fd326722fa8>
        x          = array([[0.      ],
       [1.5     ],
       [0.75    ],
       [2.25    ],
       [0.375   ],
       [1.875   ],
    ...75],
       [0.609375],
       [2.109375],
       [1.359375],
       [2.859375],
       [0.140625],
       [1.640625]])
        xitp       = array([[0.890625 ],
       [2.390625 ],
       [0.515625 ],
       [2.015625 ],
       [1.265625 ],
       [2.765625 ]...      [1.4296875],
       [2.9296875],
       [0.0703125],
       [1.5703125],
       [0.8203125],
       [2.3203125]])
        y          = array([ 0.        ,  0.24413581, -0.44285432,  0.27466724, -0.9722152 ,
        0.29864165,  0.02432428,  0.2240337 , ...131898, -0.12065703,  0.2441372 , -0.66695964,
        0.28883559,  0.18663159,  0.19056618, -0.77998605,  0.27856231])
        yitp1      = array([-0.23846054,  0.25702357, -0.81124363,  0.29531296,  0.13262317,
        0.20380022, -0.9961497 ,  0.29755   , ...415359, -0.55418691,  0.28230372,  0.21859066,
        0.18102502, -0.48531143,  0.26388737, -0.33687091,  0.26616824])
        yitp2      = array([-0.23846054,  0.25702357, -0.81124363,  0.29531296,  0.13262317,
        0.20380022, -0.9961497 ,  0.29755   , ...415359, -0.55418691,  0.28230372,  0.21859066,
        0.18102502, -0.48531143,  0.26388737, -0.33687091,  0.26616824])
$PREFIX/lib/pypy3.9/contextlib.py:79: in inner
    return func(*args, **kwds)
E   AssertionError: 
E   Arrays are not equal
E   
E   Mismatched elements: 3 / 50 (6%)
E   Max absolute difference: 5.55111512e-17
E   Max relative difference: 2.04146e-16
E    x: array([-0.238461,  0.257024, -0.811244,  0.295313,  0.132623,  0.2038  ,
E          -0.99615 ,  0.29755 , -0.019889,  0.230791, -0.516801,  0.279867,
E           0.227767,  0.178071, -0.172756,  0.251327, -0.406818,  0.271919,...
E    y: array([-0.238461,  0.257024, -0.811244,  0.295313,  0.132623,  0.2038  ,
E          -0.99615 ,  0.29755 , -0.019889,  0.230791, -0.516801,  0.279867,
E           0.227767,  0.178071, -0.172756,  0.251327, -0.406818,  0.271919,...
        args       = (<built-in function eq>, array([-0.23846054,  0.25702357, -0.81124363,  0.29531296,  0.13262317,
        0.20380022, -...15359, -0.55418691,  0.28230372,  0.21859066,
        0.18102502, -0.48531143,  0.26388737, -0.33687091,  0.26616824]))
        func       = <function assert_array_compare at 0x00007fd336574660>
        kwds       = {'err_msg': '', 'header': 'Arrays are not equal', 'strict': False, 'verbose': True}
        self       = <contextlib._GeneratorContextManager object at 0x00007fd33655fa98>
win-64 + blis: minor tolerance violation in Test_SVDS_PROPACK.test_svds_parameter_k_which[LM-5]
_____________ Test_SVDS_PROPACK.test_svds_parameter_k_which[LM-5] _____________
[gw1] win32 -- Python 3.10.14 %PREFIX%\python.exe
..\_test_env\lib\site-packages\scipy\sparse\linalg\_eigen\tests\test_svds.py:269: in test_svds_parameter_k_which
    _check_svds(A, k, *res, which=which, atol=8e-10)
        A          = array([[0.63696169, 0.26978671, 0.04097352, 0.01652764, 0.81327024,
        0.91275558, 0.60663578, 0.72949656, 0.5436..., 0.96792619, 0.0147063 , 0.86364009, 0.98119504,
        0.95721018, 0.14876401, 0.97262881, 0.88993556, 0.82237383]])
        k          = 5
        res        = (array([[-0.32771492,  0.4158033 , -0.53137496,  0.02426458,  0.31783075],
       [-0.39239685, -0.02251468, -0.063087...54 ,  0.21588656,  0.29722489,  0.31843038,
         0.31819307,  0.28881893,  0.46509902,  0.29898348,  0.31066731]]))
        rng        = Generator(PCG64) at 0x27FE5935000
        self       = <scipy.sparse.linalg._eigen.tests.test_svds.Test_SVDS_PROPACK object at 0x0000027FD06F29B0>
        which      = 'LM'
..\_test_env\lib\site-packages\scipy\sparse\linalg\_eigen\tests\test_svds.py:52: in _check_svds
    assert_allclose(uh_u, np.identity(k), atol=atol, rtol=rtol)
        A          = array([[0.63696169, 0.26978671, 0.04097352, 0.01652764, 0.81327024,
        0.91275558, 0.60663578, 0.72949656, 0.5436..., 0.96792619, 0.0147063 , 0.86364009, 0.98119504,
        0.95721018, 0.14876401, 0.97262881, 0.88993556, 0.82237383]])
        A_rebuilt  = array([[ 0.62664866,  0.26143156,  0.11583711,  0.10946253,  0.90237439,
         0.86426285,  0.54138144,  0.62698622...6753, -0.05990525,  0.81456418,  0.85739979,
         1.00404725,  0.21265842,  1.03219384,  0.92104378,  0.79572735]])
        atol       = 8e-10
        check_svd  = True
        check_usvh_A = False
        k          = 5
        m          = 10
        n          = 10
        rtol       = 1e-07
        s          = array([0.90017941, 0.97420967, 1.26999904, 1.59849819, 5.71090105])
        u          = array([[-0.32771492,  0.4158033 , -0.53137496,  0.02426458,  0.31783075],
       [-0.39239685, -0.02251468, -0.0630873...84 , -0.12697327, -0.09277105,  0.34919585],
       [-0.26457914, -0.13503641, -0.15837359,  0.53003248,  0.42841613]])
        uh_u       = array([[ 1.00000000e+00, -3.27833058e-14, -1.38947663e-15,
         2.42856942e-13, -1.48403292e-10],
       [-3.27833...3.47129694e-11],
       [-1.48403292e-10,  9.92425943e-10,  5.40502283e-10,
         3.47129694e-11,  1.00000000e+00]])
        vh         = array([[-0.42927645, -0.02385317,  0.21368543,  0.47797589, -0.42344063,
         0.30012128,  0.03406212,  0.19590089...554 ,  0.21588656,  0.29722489,  0.31843038,
         0.31819307,  0.28881893,  0.46509902,  0.29898348,  0.31066731]])
        which      = 'LM'
..\_test_env\lib\contextlib.py:79: in inner
    return func(*args, **kwds)
E   AssertionError: 
E   Not equal to tolerance rtol=1e-07, atol=8e-10
E   
E   Mismatched elements: 2 / 25 (8%)
E   Max absolute difference: 9.92425943e-10
E   Max relative difference: 1.80300219e-13
E    x: array([[ 1.000000e+00, -3.278331e-14, -1.389477e-15,  2.428569e-13,
E           -1.484033e-10],
E          [-3.278331e-14,  1.000000e+00,  1.498714e-14, -6.832333e-13,...
E    y: array([[1., 0., 0., 0., 0.],
E          [0., 1., 0., 0., 0.],
E          [0., 0., 1., 0., 0.],...
        args       = (<function assert_allclose.<locals>.compare at 0x0000027FE74E1F30>, array([[ 1.00000000e+00, -3.27833058e-14, -1.38947...,
       [0., 1., 0., 0., 0.],
       [0., 0., 1., 0., 0.],
       [0., 0., 0., 1., 0.],
       [0., 0., 0., 0., 1.]]))
        func       = <function assert_array_compare at 0x0000027FC28DAB00>
        kwds       = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-07, atol=8e-10', 'verbose': True}
        self       = <contextlib._GeneratorContextManager object at 0x0000027FC28CE470>
@h-vetinari h-vetinari added the defect A clear bug or issue that prevents SciPy from being installed or used as expected label Apr 14, 2024
ev-br added a commit to ev-br/scipy that referenced this issue Apr 14, 2024
A slight tolerance violation was reported on conda-forge in
scipy#20472
ev-br added a commit to ev-br/scipy that referenced this issue Apr 14, 2024
A small tolerance violation reported on conda-forge
in scipy#20472
ev-br added a commit to ev-br/scipy that referenced this issue Apr 14, 2024
An exact equality was reported as flaky on conda-forge in
scipy#20472

The tolerance violations are of the order of fp noise (< 2e-16), and I don't
think that pickling/unpickling guarantees bit-to-bit compatibility.
In principle, this may invoke recalculations and those may be subject
to fp noise. So I think it's OK to only require allclose(atol=eps)
instead of exact equality.
@ev-br
Copy link
Member

ev-br commented Apr 14, 2024

#20474 has what I think are straightforward tolerance bumps in RGI and RBF.

The cossin failure needs a more careful look. Off the cuff, it looks like some signs differ. So maybe it's a matter of the factorization only being unique up to consistent sign changes in the multipliers.

ev-br added a commit to ev-br/scipy that referenced this issue Apr 14, 2024
An exact equality was reported as flaky on conda-forge in
scipy#20472

The tolerance violations are of the order of fp noise (< 2e-16), and I don't
think that pickling/unpickling guarantees bit-to-bit compatibility.
In principle, this may invoke recalculations and those may be subject
to fp noise. So I think it's OK to only require allclose(atol=eps)
instead of exact equality.
@h-vetinari
Copy link
Member Author

The failure in test_x0_working[tfqmr] also showed up on osx-64 + accelerate now...

osx-64 + accelerate: minor tolerance violation in test_x0_working[tfqmr]
____________________________ test_x0_working[tfqmr] ____________________________
[gw0] darwin -- Python 3.11.8 $PREFIX/bin/python
$PREFIX/lib/python3.11/site-packages/scipy/sparse/linalg/_isolve/tests/test_iterative.py:507: in test_x0_working
    assert norm(A @ x - b) <= 2e-6*norm(b)
E   assert 2.5193553673686355e-06 <= (2e-06 * 1.240298651028214)
E    +  where 2.5193553673686355e-06 = norm(((array([[3.68514493, 2.22433683, 2.80424149, 2.06524296, 2.82772901,\n        1.70134349, 2.98806253, 2.88379072, 1.9578..., 2.29515724, 2.77591422, 1.55001596, 1.93969785,\n        1.88091968, 2.24894423, 2.49791763, 1.66944017, 2.12310297]]) @ array([ -1.22141632, -23.52877158,  -4.72398748, -21.36850005,\n       -12.68970431,  -0.96739246,  32.85873976, -11.40287273,\n        10.9936288 ,  30.93080707])) - array([0.55127821, 0.22828434, 0.09135873, 0.07249963, 0.11693987,\n       0.74246847, 0.72216603, 0.1607452 , 0.15471589, 0.18022921])))
E    +  and   1.240298651028214 = norm(array([0.55127821, 0.22828434, 0.09135873, 0.07249963, 0.11693987,\n       0.74246847, 0.72216603, 0.1607452 , 0.15471589, 0.18022921]))
        A          = array([[3.68514493, 2.22433683, 2.80424149, 2.06524296, 2.82772901,
        1.70134349, 2.98806253, 2.88379072, 1.9578..., 2.29515724, 2.77591422, 1.55001596, 1.93969785,
        1.88091968, 2.24894423, 2.49791763, 1.66944017, 2.12310297]])
        b          = array([0.55127821, 0.22828434, 0.09135873, 0.07249963, 0.11693987,
       0.74246847, 0.72216603, 0.1607452 , 0.15471589, 0.18022921])
        info       = 0
        kw         = {'atol': 0, 'rtol': 1e-06}
        n          = 10
        rng        = Generator(PCG64) at 0x1220C8120
        solver     = <function tfqmr at 0x10c87ad40>
        x          = array([ -1.22141632, -23.52877158,  -4.72398748, -21.36850005,
       -12.68970431,  -0.96739246,  32.85873976, -11.40287273,
        10.9936288 ,  30.93080707])
        x0         = array([0.63685093, 0.46836296, 0.0677924 , 0.52832101, 0.49467215,
       0.68333247, 0.3392967 , 0.57867322, 0.25729156, 0.60952728])

tylerjereddy pushed a commit to tylerjereddy/scipy that referenced this issue May 2, 2024
A slight tolerance violation was reported on conda-forge in
scipy#20472
tylerjereddy pushed a commit to tylerjereddy/scipy that referenced this issue May 2, 2024
A small tolerance violation reported on conda-forge
in scipy#20472
tylerjereddy pushed a commit to tylerjereddy/scipy that referenced this issue May 2, 2024
An exact equality was reported as flaky on conda-forge in
scipy#20472

The tolerance violations are of the order of fp noise (< 2e-16), and I don't
think that pickling/unpickling guarantees bit-to-bit compatibility.
In principle, this may invoke recalculations and those may be subject
to fp noise. So I think it's OK to only require allclose(atol=eps)
instead of exact equality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected
Projects
None yet
Development

No branches or pull requests

3 participants
@ev-br @h-vetinari and others