Giter Club home page Giter Club logo

Comments (14)

WarrenWeckesser avatar WarrenWeckesser commented on July 20, 2024 1

The issue for the failure of TestOnenormest.test_onenormest_table_6_t_1 is gh-17385.

from scipy.

mdhaber avatar mdhaber commented on July 20, 2024

For slow, I get the same failures as above except FAILED scipy/linalg/tests/test_matfuncs.py::TestExpM::test_gh18086 - no new ones. It seems that test_gh18086 is flaky.

However, I had to skip scipy\scipy\sparse\linalg\tests\test_propack.py due to an access violation in test_svdp

from scipy.

mdhaber avatar mdhaber commented on July 20, 2024

With SCIPY_XSLOW=1 I get one new failure from sparse/linalg:

_________________ TestOnenormest.test_onenormest_table_6_t_1 __________________

self = <scipy.sparse.linalg.tests.test_onenormest.TestOnenormest object at 0x000001C791846510>

    @pytest.mark.xslow
    def test_onenormest_table_6_t_1(self):
        #TODO this test seems to give estimates that match the table,
        #TODO even though no attempt has been made to deal with
        #TODO complex numbers in the one-norm estimation.
        # This will take multiple seconds if your computer is slow like mine.
        # It is stochastic, so the tolerance could be too strict.
        np.random.seed(1234)
        t = 1
        n = 100
        itmax = 5
        nsamples = 5000
        observed = []
        expected = []
        nmult_list = []
        nresample_list = []
        for i in range(nsamples):
            A_inv = np.random.rand(n, n) + 1j * np.random.rand(n, n)
            A = scipy.linalg.inv(A_inv)
            est, v, w, nmults, nresamples = _onenormest_core(A, A.T, t, itmax)
            observed.append(est)
            expected.append(scipy.linalg.norm(A, 1))
            nmult_list.append(nmults)
            nresample_list.append(nresamples)
        observed = np.array(observed, dtype=float)
        expected = np.array(expected, dtype=float)
        relative_errors = np.abs(observed - expected) / expected

        # check the mean underestimation ratio
        underestimation_ratio = observed / expected
        underestimation_ratio_mean = np.mean(underestimation_ratio)
        assert_(0.90 < underestimation_ratio_mean < 0.99)

        # check the required column resamples
        max_nresamples = np.max(nresample_list)
        assert_equal(max_nresamples, 0)

        # check the proportion of norms computed exactly correctly
        nexact = np.count_nonzero(relative_errors < 1e-14)
        proportion_exact = nexact / float(nsamples)
>       assert_(0.7 < proportion_exact < 0.8)
E       AssertionError

A          = array([[ 1.0543604 +0.03847635j, -0.33208373-0.22861055j,
         0.40431944+0.0792976j , ..., -0.05681823-0.97139639...     -0.72327521+0.42464523j, ...,  0.86198444+1.35242015j,
        -1.4396941 -0.77624368j, -0.03960976-0.01487513j]])
A_inv      = array([[0.29119074+0.65104849j, 0.58305885+0.67128938j,
        0.06722355+0.93823077j, ..., 0.6889593 +0.84052724j,
 ...
        0.45835081+0.39487713j, ..., 0.39236538+0.22490301j,
        0.37966209+0.48231849j, 0.52764845+0.90868658j]])
est        = 286.67179442494756
expected   = array([ 71.97806709,  70.56821698,  42.24911326, ...,  42.74919002,
        71.59204191, 287.08535285])
i          = 4999
itmax      = 5
max_nresamples = 0
n          = 100
nexact     = 2781
nmult_list = [5, 7, 4, 6, 7, 4, ...]
nmults     = 4
nresample_list = [0, 0, 0, 0, 0, 0, ...]
nresamples = 0
nsamples   = 5000
observed   = array([ 71.97806709,  70.56821698,  35.59762277, ...,  42.74919002,
        63.85697738, 286.67179442])
proportion_exact = 0.5562
relative_errors = array([0.00000000e+00, 2.01377551e-16, 1.57435032e-01, ...,
       0.00000000e+00, 1.08043636e-01, 1.44054171e-03])
self       = <scipy.sparse.linalg.tests.test_onenormest.TestOnenormest object at 0x000001C791846510>
t          = 1
underestimation_ratio = array([1.        , 1.        , 0.84256497, ..., 1.        , 0.89195636,
       0.99855946])
underestimation_ratio_mean = 0.9414421444954721
v          = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0., 0., 0., 0., 0., 0., 0., 0., ...0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
w          = array([ 1.93101609+4.88613457e-02j,  0.95209743+2.99680743e-01j,
        3.85029705-1.27986728e+00j,  1.89775519+4.326...578313 -9.43259458e-01j,  1.87828784-6.22941868e+00j,
        0.80356713+1.08910034e+00j, -2.96027481+1.61222120e+00j])

scipy\sparse\linalg\tests\test_onenormest.py:183: AssertionError

And 150 more from scipy.stats.sampling of the form:

_________________ TestNumericalInversePolynomial.test_cdf[x6] _________________

self = <scipy.stats.tests.test_sampling.TestNumericalInversePolynomial object at 0x000001C79A2B0710>
x = [[nan, 0.5, 0.1], [0.2, 0.4, inf], [-inf, 3, 4]]

    @pytest.mark.parametrize("x", x)
    def test_cdf(self, x):
        dist = StandardNormal()
>       rng = NumericalInversePolynomial(dist, u_resolution=1e-14)

dist       = <scipy.stats.tests.test_sampling.StandardNormal object at 0x000001C92F41E010>
self       = <scipy.stats.tests.test_sampling.TestNumericalInversePolynomial object at 0x000001C79A2B0710>
x          = [[nan, 0.5, 0.1], [0.2, 0.4, inf], [-inf, 3, 4]]

scipy\stats\tests\test_sampling.py:915:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
unuran_wrapper.pyx:1414: in scipy.stats._unuran.unuran_wrapper.NumericalInversePolynomial.__cinit__
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   OSError: Failed to open file b'C:\\Users\\matth\\AppData\\Local\\Temp\\scipy-1iyihy7o'


messagestream.pyx:43: OSError

During handling of the above exception, another exception occurred:

cls = <class '_pytest.runner.CallInfo'>
func = <function call_and_report.<locals>.<lambda> at 0x000001C92F3F0680>
when = 'call'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)

    @classmethod
    def from_call(
        cls,
        func: Callable[[], TResult],
        when: Literal["collect", "setup", "call", "teardown"],
        reraise: Optional[
            Union[Type[BaseException], Tuple[Type[BaseException], ...]]
        ] = None,
    ) -> "CallInfo[TResult]":
        """Call func, wrapping the result in a CallInfo.

        :param func:
            The function to call. Called without arguments.
        :param when:
            The phase in which the function is called.
        :param reraise:
            Exception or exceptions that shall propagate if raised by the
            function, instead of being wrapped in the CallInfo.
        """
        excinfo = None
        start = timing.time()
        precise_start = timing.perf_counter()
        try:
>           result: Optional[TResult] = func()

cls        = <class '_pytest.runner.CallInfo'>
duration   = 0.0035343000199645758
excinfo    = <ExceptionInfo PytestUnraisableExceptionWarning('Exception ignored in: \'scipy._lib.messagestream.MessageStream.__deal...m cannot find the file specified: b\'C:\\\\Users\\\\matth\\\\AppData\\\\Local\\\\Temp\\\\scipy-1iyihy7o\'\n') tblen=12>
func       = <function call_and_report.<locals>.<lambda> at 0x000001C92F3F0680>
precise_start = 528360.9868457
precise_stop = 528360.99038
reraise    = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
result     = None
start      = 1716820806.2819302
stop       = 1716820806.2849226
when       = 'call'

..\miniforge3\envs\scipy-dev\Lib\site-packages\_pytest\runner.py:341:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\miniforge3\envs\scipy-dev\Lib\site-packages\_pytest\runner.py:241: in <lambda>
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
        item       = <Function test_cdf[x6]>
        kwds       = {}
        runtest_hook = <HookCaller 'pytest_runtest_call'>
..\miniforge3\envs\scipy-dev\Lib\site-packages\pluggy\_hooks.py:513: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
        firstresult = False
        kwargs     = {'item': <Function test_cdf[x6]>}
        self       = <HookCaller 'pytest_runtest_call'>
..\miniforge3\envs\scipy-dev\Lib\site-packages\pluggy\_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
        firstresult = False
        hook_name  = 'pytest_runtest_call'
        kwargs     = {'item': <Function test_cdf[x6]>}
        methods    = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from 'C:\\Users\\matth\\miniforge3\\envs\\scipy-dev\\...e>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x000001C743F16110>>, ...]
        self       = <_pytest.config.PytestPluginManager object at 0x000001C73E37E350>
..\miniforge3\envs\scipy-dev\Lib\site-packages\_pytest\threadexception.py:87: in pytest_runtest_call
    yield from thread_exception_runtest_hook()
..\miniforge3\envs\scipy-dev\Lib\site-packages\_pytest\threadexception.py:63: in thread_exception_runtest_hook
    yield
        cm         = <_pytest.threadexception.catch_threading_exception object at 0x000001C92F41C910>
..\miniforge3\envs\scipy-dev\Lib\site-packages\_pytest\unraisableexception.py:90: in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
        with catch_unraisable_exception() as cm:
            try:
                yield
            finally:
                if cm.unraisable:
                    if cm.unraisable.err_msg is not None:
                        err_msg = cm.unraisable.err_msg
                    else:
                        err_msg = "Exception ignored in"
                    msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
                    msg += "".join(
                        traceback.format_exception(
                            cm.unraisable.exc_type,
                            cm.unraisable.exc_value,
                            cm.unraisable.exc_traceback,
                        )
                    )
>                   warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E                   pytest.PytestUnraisableExceptionWarning: Exception ignored in: 'scipy._lib.messagestream.MessageStream.__dealloc__'
E
E                   Traceback (most recent call last):
E                     File "messagestream.pyx", line 91, in scipy._lib.messagestream.MessageStream.close
E                   FileNotFoundError: [WinError 2] The system cannot find the file specified: b'C:\\Users\\matth\\AppData\\Local\\Temp\\scipy-1iyihy7o'

cm         = <_pytest.unraisableexception.catch_unraisable_exception object at 0x000001C92F41D9D0>
err_msg    = 'Exception ignored in'
msg        = "Exception ignored in: 'scipy._lib.messagestream.MessageStream.__dealloc__'\n\nTraceback (most recent call last):\n  F... 2] The system cannot find the file specified: b'C:\\\\Users\\\\matth\\\\AppData\\\\Local\\\\Temp\\\\scipy-1iyihy7o'\n"

..\miniforge3\envs\scipy-dev\Lib\site-packages\_pytest\unraisableexception.py:80: PytestUnraisableExceptionWarning
---------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "messagestream.pyx", line 91, in scipy._lib.messagestream.MessageStream.close
FileNotFoundError: [WinError 2] The system cannot find the file specified: b'C:\\Users\\matth\\AppData\\Local\\Temp\\scipy-1iyihy7o'

I think something like that has been reported before with the scipy.stats.sampling tests. Update: may be related to gh-17360.

from scipy.

mdhaber avatar mdhaber commented on July 20, 2024

The "Found Intel OpenMP ('libiomp') and LLVM OpenMP ('libomp')" warning suggests something is wrong with my setup, but at this point I don't think I deviate from the documentation. I do have a few other packages installed in my environment for array API testing, etc., if that could be the culprit.

from scipy.

mdhaber avatar mdhaber commented on July 20, 2024

gh-18736 reports a failure of test_hermitian_modes, but my problem is different (hangs).

from scipy.

mdhaber avatar mdhaber commented on July 20, 2024

The test_gh18086 failure is indeed flaky, and it seems that is the nature of the bug it is testing. I'll comment in gh-18086.

Also, it appears that test_import_cycles isn't hanging for me anymore, so that's good.

from scipy.

rgommers avatar rgommers commented on July 20, 2024

The "Found Intel OpenMP ('libiomp') and LLVM OpenMP ('libomp')" warning suggests something is wrong with my setup, but at this point I don't think I deviate from the documentation.

Are you by any chance using numpy from the defaults channel? That is built against MKL, which would explain how Intel OpenMP gets pulled in. I'm not sure what else could be doing that.

from scipy.

mdhaber avatar mdhaber commented on July 20, 2024

I don't think so. I had to rebuild my environment yesterday after gh-15321 (I'll try to provide more information next time this happens... probably an editable install thing), so this may not be exactly what I performed the tests with, but:

(scipy-dev) C:\Users\matth\scipy>mamba list
# packages in environment at C:\Users\matth\miniforge3\envs\scipy-dev:
#
# Name                    Version                   Build  Channel
accessible-pygments       0.0.4              pyhd8ed1ab_0    conda-forge
alabaster                 0.7.16             pyhd8ed1ab_0    conda-forge
anyio                     4.3.0              pyhd8ed1ab_0    conda-forge
argon2-cffi               23.1.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0          py312he70551f_4    conda-forge
array-api-compat          1.7                pyhd8ed1ab_0    conda-forge
array-api-strict          1.1.1              pyhd8ed1ab_0    conda-forge
arrow                     1.3.0              pyhd8ed1ab_0    conda-forge
asttokens                 2.4.1              pyhd8ed1ab_0    conda-forge
asv                       0.6.3           py312h53d5487_0    conda-forge
asv_runner                0.2.1              pyhd8ed1ab_0    conda-forge
async-lru                 2.0.4              pyhd8ed1ab_0    conda-forge
attrs                     23.2.0             pyh71513ae_0    conda-forge
babel                     2.14.0             pyhd8ed1ab_0    conda-forge
backports.zoneinfo        0.2.1           py312h2e8e312_8    conda-forge
beautifulsoup4            4.12.3             pyha770c72_0    conda-forge
beniget                   0.4.1              pyhd8ed1ab_0    conda-forge
bleach                    6.1.0              pyhd8ed1ab_0    conda-forge
brotli                    1.1.0                hcfcfb64_1    conda-forge
brotli-bin                1.1.0                hcfcfb64_1    conda-forge
brotli-python             1.1.0           py312h53d5487_1    conda-forge
bzip2                     1.0.8                hcfcfb64_5    conda-forge
ca-certificates           2024.2.2             h56e8100_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
certifi                   2024.2.2           pyhd8ed1ab_0    conda-forge
cffi                      1.16.0          py312he70551f_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
clang                     18.1.6          default_hb53fc94_0    conda-forge
clang-18                  18.1.6          default_h3a3e6c3_0    conda-forge
clangxx                   18.1.6          default_h3a3e6c3_0    conda-forge
click                     8.1.7           win_pyh7428d3b_0    conda-forge
cloudpickle               3.0.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
colorlog                  6.8.2           py312h2e8e312_0    conda-forge
comm                      0.2.2              pyhd8ed1ab_0    conda-forge
contourpy                 1.2.1           py312h0d7def4_0    conda-forge
coverage                  7.5.2           py312h4389bb4_0    conda-forge
cuda-nvrtc                12.5.40              he0c23c2_0    conda-forge
cuda-version              12.5                 hd4f0392_3    conda-forge
cupy                      13.1.0          py312hbf64fcc_4    conda-forge
cupy-core                 13.1.0          py312ha23c19a_4    conda-forge
cycler                    0.12.1             pyhd8ed1ab_0    conda-forge
cython                    3.0.10          py312h53d5487_0    conda-forge
cython-lint               0.16.2             pyhd8ed1ab_0    conda-forge
debugpy                   1.8.1           py312h53d5487_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
distlib                   0.3.8              pyhd8ed1ab_0    conda-forge
docutils                  0.21.2             pyhd8ed1ab_0    conda-forge
doit                      0.36.0             pyhd8ed1ab_0    conda-forge
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
exceptiongroup            1.2.0              pyhd8ed1ab_2    conda-forge
execnet                   2.1.1              pyhd8ed1ab_0    conda-forge
executing                 2.0.1              pyhd8ed1ab_0    conda-forge
fastrlock                 0.8.2           py312h53d5487_2    conda-forge
filelock                  3.14.0             pyhd8ed1ab_0    conda-forge
fonttools                 4.52.1          py312h4389bb4_0    conda-forge
fqdn                      1.5.1              pyhd8ed1ab_0    conda-forge
freetype                  2.12.1               hdaf720e_2    conda-forge
gast                      0.5.4              pyhd8ed1ab_0    conda-forge
glib                      2.80.2               h0df6a38_0    conda-forge
glib-tools                2.80.2               h2f9d560_0    conda-forge
gmpy2                     2.1.5           py312h73d75c0_1    conda-forge
greenlet                  3.0.3           py312h53d5487_0    conda-forge
gst-plugins-base          1.24.3               hba88be7_0    conda-forge
gstreamer                 1.24.3               h5006eae_0    conda-forge
h11                       0.14.0             pyhd8ed1ab_0    conda-forge
h2                        4.1.0              pyhd8ed1ab_0    conda-forge
hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
httpcore                  1.0.5              pyhd8ed1ab_0    conda-forge
httpx                     0.27.0             pyhd8ed1ab_0    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
hypothesis                6.102.6            pyha770c72_0    conda-forge
icu                       73.2                 h63175ca_0    conda-forge
idna                      3.7                pyhd8ed1ab_0    conda-forge
imagesize                 1.4.1              pyhd8ed1ab_0    conda-forge
importlib-metadata        7.1.0              pyha770c72_0    conda-forge
importlib_metadata        7.1.0                hd8ed1ab_0    conda-forge
importlib_resources       6.4.0              pyhd8ed1ab_0    conda-forge
iniconfig                 2.0.0              pyhd8ed1ab_0    conda-forge
ipykernel                 6.29.3             pyha63f2e9_0    conda-forge
ipython                   8.24.0             pyh7428d3b_0    conda-forge
ipywidgets                8.1.2              pyhd8ed1ab_1    conda-forge
isoduration               20.11.0            pyhd8ed1ab_0    conda-forge
jedi                      0.19.1             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.4              pyhd8ed1ab_0    conda-forge
json5                     0.9.25             pyhd8ed1ab_0    conda-forge
jsonpointer               2.4             py312h2e8e312_3    conda-forge
jsonschema                4.22.0             pyhd8ed1ab_0    conda-forge
jsonschema-specifications 2023.12.1          pyhd8ed1ab_0    conda-forge
jsonschema-with-format-nongpl 4.22.0             pyhd8ed1ab_0    conda-forge
jupyter                   1.0.0             pyhd8ed1ab_10    conda-forge
jupyter-cache             1.0.0              pyhd8ed1ab_0    conda-forge
jupyter-lsp               2.2.5              pyhd8ed1ab_0    conda-forge
jupyter_client            8.6.2              pyhd8ed1ab_0    conda-forge
jupyter_console           6.6.3              pyhd8ed1ab_0    conda-forge
jupyter_core              5.7.2           py312h2e8e312_0    conda-forge
jupyter_events            0.10.0             pyhd8ed1ab_0    conda-forge
jupyter_server            2.14.0             pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.5.3              pyhd8ed1ab_0    conda-forge
jupyterlab                4.2.1              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.3.0              pyhd8ed1ab_1    conda-forge
jupyterlab_server         2.27.2             pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        3.0.10             pyhd8ed1ab_0    conda-forge
jupyterlite-core          0.3.0              pyhd8ed1ab_0    conda-forge
jupyterlite-sphinx        0.15.0             pyhd8ed1ab_0    conda-forge
jupytext                  1.16.2             pyhd8ed1ab_1    conda-forge
kiwisolver                1.4.5           py312h0d7def4_1    conda-forge
krb5                      1.21.2               heb0366b_0    conda-forge
lcms2                     2.16                 h67d730c_0    conda-forge
lerc                      4.0.0                h63175ca_0    conda-forge
libblas                   3.9.0           22_win64_openblas    conda-forge
libbrotlicommon           1.1.0                hcfcfb64_1    conda-forge
libbrotlidec              1.1.0                hcfcfb64_1    conda-forge
libbrotlienc              1.1.0                hcfcfb64_1    conda-forge
libcblas                  3.9.0           22_win64_openblas    conda-forge
libclang13                18.1.6          default_hf64faad_0    conda-forge
libcublas                 12.5.2.13            he0c23c2_0    conda-forge
libcufft                  11.2.3.18            he0c23c2_0    conda-forge
libcurand                 10.3.6.39            he0c23c2_0    conda-forge
libcusolver               11.6.2.40            he0c23c2_0    conda-forge
libcusparse               12.4.1.24            he0c23c2_0    conda-forge
libdeflate                1.20                 hcfcfb64_0    conda-forge
libexpat                  2.6.2                h63175ca_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libflang                  5.0.0           h6538335_20180525    conda-forge
libglib                   2.80.2               h0df6a38_0    conda-forge
libiconv                  1.17                 hcfcfb64_2    conda-forge
libintl                   0.22.5               h5728263_2    conda-forge
libintl-devel             0.22.5               h5728263_2    conda-forge
libjpeg-turbo             3.0.0                hcfcfb64_1    conda-forge
liblapack                 3.9.0           22_win64_openblas    conda-forge
libnvjitlink              12.5.40              he0c23c2_0    conda-forge
libogg                    1.3.4                h8ffe710_1    conda-forge
libopenblas               0.3.27          pthreads_hc140b1d_0    conda-forge
libpng                    1.6.43               h19919ed_0    conda-forge
libsodium                 1.0.18               h8d14728_1    conda-forge
libsqlite                 3.45.3               hcfcfb64_0    conda-forge
libtiff                   4.6.0                hddb2be6_3    conda-forge
libvorbis                 1.3.7                h0e60522_0    conda-forge
libwebp-base              1.4.0                hcfcfb64_0    conda-forge
libxcb                    1.15                 hcd874cb_0    conda-forge
libzlib                   1.2.13               hcfcfb64_5    conda-forge
llvm-meta                 5.0.0                         0    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6    conda-forge
m2w64-gcc-libs            5.3.0                         7    conda-forge
m2w64-gcc-libs-core       5.3.0                         7    conda-forge
m2w64-gmp                 6.1.0                         2    conda-forge
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    conda-forge
markdown-it-py            3.0.0              pyhd8ed1ab_0    conda-forge
markupsafe                2.1.5           py312he70551f_0    conda-forge
matplotlib                3.8.4           py312h2e8e312_2    conda-forge
matplotlib-base           3.8.4           py312hfee7060_2    conda-forge
matplotlib-inline         0.1.7              pyhd8ed1ab_0    conda-forge
mdit-py-plugins           0.4.1              pyhd8ed1ab_0    conda-forge
mdurl                     0.1.2              pyhd8ed1ab_0    conda-forge
meson                     1.4.0              pyhd8ed1ab_0    conda-forge
meson-python              0.16.0             pyh0c530f3_0    conda-forge
mistune                   3.0.2              pyhd8ed1ab_0    conda-forge
mpc                       1.3.1                h4ff82f8_0    conda-forge
mpfr                      4.2.1                h64bf75a_1    conda-forge
mpir                      3.0.0             he025d50_1002    conda-forge
mpmath                    1.3.0              pyhd8ed1ab_0    conda-forge
msys2-conda-epoch         20160418                      1    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mypy                      1.10.0          py312h4389bb4_0    conda-forge
mypy_extensions           1.0.0              pyha770c72_0    conda-forge
myst-nb                   1.1.0              pyhd8ed1ab_0    conda-forge
myst-parser               3.0.1              pyhd8ed1ab_0    conda-forge
nbclient                  0.10.0             pyhd8ed1ab_0    conda-forge
nbconvert                 7.16.4               hd8ed1ab_0    conda-forge
nbconvert-core            7.16.4             pyhd8ed1ab_0    conda-forge
nbconvert-pandoc          7.16.4               hd8ed1ab_0    conda-forge
nbformat                  5.10.4             pyhd8ed1ab_0    conda-forge
nest-asyncio              1.6.0              pyhd8ed1ab_0    conda-forge
ninja                     1.12.1               hc790b64_0    conda-forge
notebook                  7.2.0              pyhd8ed1ab_0    conda-forge
notebook-shim             0.2.4              pyhd8ed1ab_0    conda-forge
numpy                     1.26.4          py312h8753938_0    conda-forge
numpydoc                  1.7.0              pyhd8ed1ab_0    conda-forge
openblas                  0.3.27          pthreads_h3721920_0    conda-forge
openjpeg                  2.5.2                h3d672ee_0    conda-forge
openmp                    5.0.0                    vc14_1    conda-forge
openssl                   3.3.0                h2466b09_3    conda-forge
overrides                 7.7.0              pyhd8ed1ab_0    conda-forge
packaging                 24.0               pyhd8ed1ab_0    conda-forge
pandoc                    3.2                  h57928b3_0    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
parso                     0.8.4              pyhd8ed1ab_0    conda-forge
pcre2                     10.43                h17e33f8_0    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    10.3.0          py312h6f6a607_0    conda-forge
pip                       24.0               pyhd8ed1ab_0    conda-forge
pkg-config                0.29.2            h2bf4dc2_1008    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_1    conda-forge
platformdirs              4.2.2              pyhd8ed1ab_0    conda-forge
pluggy                    1.5.0              pyhd8ed1ab_0    conda-forge
ply                       3.11               pyhd8ed1ab_2    conda-forge
pooch                     1.8.1              pyhd8ed1ab_0    conda-forge
prometheus_client         0.20.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.42             pyha770c72_0    conda-forge
prompt_toolkit            3.0.42               hd8ed1ab_0    conda-forge
psutil                    5.9.8           py312he70551f_0    conda-forge
pthread-stubs             0.4               hcd874cb_1001    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pybind11                  2.12.0          py312h0d7def4_0    conda-forge
pybind11-global           2.12.0          py312h0d7def4_0    conda-forge
pycodestyle               2.11.1             pyhd8ed1ab_0    conda-forge
pycparser                 2.22               pyhd8ed1ab_0    conda-forge
pydata-sphinx-theme       0.15.2             pyhd8ed1ab_0    conda-forge
pydevtool                 0.3.0              pyhd8ed1ab_0    conda-forge
pygments                  2.18.0             pyhd8ed1ab_0    conda-forge
pympler                   1.0.1              pyhd8ed1ab_0    conda-forge
pyparsing                 3.1.2              pyhd8ed1ab_0    conda-forge
pyproject-metadata        0.8.0              pyhd8ed1ab_0    conda-forge
pyqt                      5.15.9          py312he09f080_5    conda-forge
pyqt5-sip                 12.12.2         py312h53d5487_5    conda-forge
pysocks                   1.7.1              pyh0701188_6    conda-forge
pytest                    8.2.1              pyhd8ed1ab_0    conda-forge
pytest-cov                5.0.0              pyhd8ed1ab_0    conda-forge
pytest-fail-slow          0.5.0              pyhd8ed1ab_0    conda-forge
pytest-skip-slow          0.0.5              pyhd8ed1ab_0    conda-forge
pytest-timeout            2.3.1              pyhd8ed1ab_1    conda-forge
pytest-xdist              3.5.0              pyhd8ed1ab_0    conda-forge
python                    3.12.3          h2628c8c_0_cpython    conda-forge
python-dateutil           2.9.0              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.19.1             pyhd8ed1ab_0    conda-forge
python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
python_abi                3.12                    4_cp312    conda-forge
pythran                   0.15.0          py312hd42ba9a_1    conda-forge
pytz                      2024.1             pyhd8ed1ab_0    conda-forge
pywin32                   306             py312h53d5487_2    conda-forge
pywinpty                  2.0.13          py312h53d5487_0    conda-forge
pyyaml                    6.0.1           py312he70551f_1    conda-forge
pyzmq                     26.0.3          py312hd7027bb_0    conda-forge
qt-main                   5.15.8              hcef0176_21    conda-forge
qtconsole-base            5.5.2              pyha770c72_0    conda-forge
qtpy                      2.4.1              pyhd8ed1ab_0    conda-forge
referencing               0.35.1             pyhd8ed1ab_0    conda-forge
requests                  2.32.2             pyhd8ed1ab_0    conda-forge
rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
rich                      13.7.1             pyhd8ed1ab_0    conda-forge
rich-click                1.8.2              pyhd8ed1ab_0    conda-forge
rpds-py                   0.18.1          py312h2615798_0    conda-forge
ruff                      0.4.5           py312h7a6832a_0    conda-forge
scipy                     1.14.0.dev0              pypi_0    pypi
send2trash                1.8.3              pyh5737063_0    conda-forge
setuptools                67.1.0             pyhd8ed1ab_0    conda-forge
sip                       6.7.12          py312h53d5487_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
sniffio                   1.3.1              pyhd8ed1ab_0    conda-forge
snowballstemmer           2.2.0              pyhd8ed1ab_0    conda-forge
sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.5                pyhd8ed1ab_1    conda-forge
sphinx                    7.3.7              pyhd8ed1ab_0    conda-forge
sphinx-design             0.5.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-applehelp   1.0.8              pyhd8ed1ab_0    conda-forge
sphinxcontrib-devhelp     1.0.6              pyhd8ed1ab_0    conda-forge
sphinxcontrib-htmlhelp    2.0.5              pyhd8ed1ab_0    conda-forge
sphinxcontrib-jsmath      1.0.1              pyhd8ed1ab_0    conda-forge
sphinxcontrib-qthelp      1.0.7              pyhd8ed1ab_0    conda-forge
sphinxcontrib-serializinghtml 1.1.10             pyhd8ed1ab_0    conda-forge
sqlalchemy                2.0.30          py312h4389bb4_0    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
sympy                     1.12               pyh04b8f61_3    conda-forge
tabulate                  0.9.0              pyhd8ed1ab_1    conda-forge
terminado                 0.18.1             pyh5737063_0    conda-forge
threadpoolctl             3.5.0              pyhc1e730c_0    conda-forge
tinycss2                  1.3.0              pyhd8ed1ab_0    conda-forge
tk                        8.6.13               h5226925_1    conda-forge
tokenize-rt               5.2.0              pyhd8ed1ab_1    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tornado                   6.4             py312he70551f_0    conda-forge
traitlets                 5.14.3             pyhd8ed1ab_0    conda-forge
types-psutil              5.9.5.6            pyhd8ed1ab_0    conda-forge
types-python-dateutil     2.9.0.20240316     pyhd8ed1ab_0    conda-forge
typing-extensions         4.11.0               hd8ed1ab_0    conda-forge
typing_extensions         4.11.0             pyha770c72_0    conda-forge
typing_utils              0.1.0              pyhd8ed1ab_0    conda-forge
tzdata                    2024a                h0c530f3_0    conda-forge
ucrt                      10.0.22621.0         h57928b3_0    conda-forge
uri-template              1.3.0              pyhd8ed1ab_0    conda-forge
urllib3                   2.2.1              pyhd8ed1ab_0    conda-forge
vc                        14.3                ha32ba9b_20    conda-forge
vc14_runtime              14.38.33135         h835141b_20    conda-forge
virtualenv                20.26.2            pyhd8ed1ab_0    conda-forge
vs2015_runtime            14.38.33135         h22015db_20    conda-forge
wcwidth                   0.2.13             pyhd8ed1ab_0    conda-forge
webcolors                 1.13               pyhd8ed1ab_0    conda-forge
webencodings              0.5.1              pyhd8ed1ab_2    conda-forge
websocket-client          1.8.0              pyhd8ed1ab_0    conda-forge
wheel                     0.43.0             pyhd8ed1ab_1    conda-forge
widgetsnbextension        4.0.10             pyhd8ed1ab_0    conda-forge
win_inet_pton             1.1.0              pyhd8ed1ab_6    conda-forge
winpty                    0.4.3                         4    conda-forge
xorg-libxau               1.0.11               hcd874cb_0    conda-forge
xorg-libxdmcp             1.1.3                hcd874cb_0    conda-forge
xz                        5.2.6                h8d14728_0    conda-forge
yaml                      0.2.5                h8ffe710_2    conda-forge
zeromq                    4.3.5                he1f189c_4    conda-forge
zipp                      3.17.0             pyhd8ed1ab_0    conda-forge
zstd                      1.5.6                h0ea2cb4_0    conda-forge

With this environment, running pytest scipy/io/tests/test_mmio.py::test_threadpoolctl, I get:

====================================================== FAILURES =======================================================
_________________________________________ test_threadpoolctl[scipy.io._mmio] __________________________________________

    def test_threadpoolctl():
        try:
            import threadpoolctl
            if not hasattr(threadpoolctl, "register"):
                pytest.skip("threadpoolctl too old")
                return
        except ImportError:
            pytest.skip("no threadpoolctl")
            return

        with threadpoolctl.threadpool_limits(limits=4):
>           assert_equal(fmm.PARALLELISM, 4)
E           AssertionError:
E           Items are not equal:
E            ACTUAL: 0
E            DESIRED: 4

threadpoolctl = <module 'threadpoolctl' from 'C:\\Users\\matth\\miniforge3\\envs\\scipy-dev\\Lib\\site-packages\\threadpoolctl.py'>

scipy\io\tests\test_mmio.py:800: AssertionError
__________________________________ test_threadpoolctl[scipy.io._fast_matrix_market] ___________________________________

    def test_threadpoolctl():
        try:
            import threadpoolctl
            if not hasattr(threadpoolctl, "register"):
                pytest.skip("threadpoolctl too old")
                return
        except ImportError:
            pytest.skip("no threadpoolctl")
            return

        with threadpoolctl.threadpool_limits(limits=4):
>           assert_equal(fmm.PARALLELISM, 4)
E           AssertionError:
E           Items are not equal:
E            ACTUAL: 0
E            DESIRED: 4

threadpoolctl = <module 'threadpoolctl' from 'C:\\Users\\matth\\miniforge3\\envs\\scipy-dev\\Lib\\site-packages\\threadpoolctl.py'>

scipy\io\tests\test_mmio.py:800: AssertionError
=============================================== short test summary info ===============================================
FAILED scipy/io/tests/test_mmio.py::test_threadpoolctl[scipy.io._mmio] - AssertionError:
FAILED scipy/io/tests/test_mmio.py::test_threadpoolctl[scipy.io._fast_matrix_market] - AssertionError:
================================================== 2 failed in 0.96s ==================================================

from scipy.

rgommers avatar rgommers commented on July 20, 2024

With this environment, running pytest scipy/io/tests/test_mmio.py::test_threadpoolctl, I get:

Ah that is a different failure - no sign of the OpenMP conflict once all packages come from conda-forge. This may be a genuine threadpoolctl issue on Windows (the custom controller thing that fast_matrix_market uses is fairly new).

from scipy.

mdhaber avatar mdhaber commented on July 20, 2024

If after creating the environment with environment.yml I had tried to install pytorch like this, would that explain it? (I think I had used conda before to set up the environment rather than mamba like this time.)

(scipy-dev) C:\Users\matth\scipy>conda install -c conda-forge pytorch
Collecting package metadata (current_repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 23.3.1
  latest version: 24.5.0

Please update conda by running

    $ conda update -n base -c conda-forge conda

Or to minimize the number of packages updated during conda update use

     conda install conda=24.5.0



## Package Plan ##

  environment location: C:\Users\matth\miniforge3\envs\scipy-dev

  added / updated specs:
    - pytorch


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    fsspec-2024.5.0            |     pyhff2d567_0         211 KB  conda-forge
    libhwloc-2.10.0            |default_h8125262_1001         2.3 MB  conda-forge
    libxml2-2.12.7             |       h283a6d9_0         1.5 MB  conda-forge
    mkl-service-2.4.1          |  py312hd947a6f_0          60 KB  conda-forge
    pytorch-2.2.0              |cpu_py312h746a3fd_0       111.8 MB
    tbb-2021.12.0              |       hc790b64_1         158 KB  conda-forge
    ------------------------------------------------------------
                                           Total:       116.0 MB

The following NEW packages will be INSTALLED:

  blas               pkgs/main/win-64::blas-1.0-mkl
  fsspec             conda-forge/noarch::fsspec-2024.5.0-pyhff2d567_0
  intel-openmp       pkgs/main/win-64::intel-openmp-2023.1.0-h59b6b97_46320
  libhwloc           conda-forge/win-64::libhwloc-2.10.0-default_h8125262_1001
  libuv              conda-forge/win-64::libuv-1.48.0-hcfcfb64_0
  libxml2            conda-forge/win-64::libxml2-2.12.7-h283a6d9_0
  mkl                conda-forge/win-64::mkl-2023.2.0-h6a75c08_50497
  mkl-service        conda-forge/win-64::mkl-service-2.4.1-py312hd947a6f_0
  networkx           conda-forge/noarch::networkx-3.3-pyhd8ed1ab_1
  pthreads-win32     conda-forge/win-64::pthreads-win32-2.9.1-hfa6e2cd_3
  pytorch            pkgs/main/win-64::pytorch-2.2.0-cpu_py312h746a3fd_0
  tbb                conda-forge/win-64::tbb-2021.12.0-hc790b64_1

The following packages will be DOWNGRADED:

  libblas                           3.9.0-22_win64_openblas --> 3.9.0-20_win64_mkl
  libcblas                          3.9.0-22_win64_openblas --> 3.9.0-20_win64_mkl
  liblapack                         3.9.0-22_win64_openblas --> 3.9.0-20_win64_mkl```

</details>

from scipy.

rgommers avatar rgommers commented on July 20, 2024

Yes, that would definitely explain it - PyTorch depends on MKL. It may also explain also some of the other failures (test_complex_dotc & co), since that's about Fortran ABI and OpenBLAS and MKL ABI's do not match.

Installing complex packages in an existing env is inherently a bit fragile (not just for conda, also for pypi/wheels). What I do instead is edit environment.yml to add the new dependencies I want, rename the env (e.g., scipy-dev-torch in this case) and then run mamba env create -f environment.yml. That should avoid this kind of problem. Downloads are cached, so it also shouldn't increase total download size by too much.

from scipy.

mdhaber avatar mdhaber commented on July 20, 2024

I know it's fragile - so fragile that last time I tried, I couldn't add PyTorch to environment.yml without conflicts : ) I could install it after the fact, though, so I went ahead, since I have work to do.

I'll go ahead and re-run those test with this new environment, though.

from scipy.

mdhaber avatar mdhaber commented on July 20, 2024

In the pristine environment.yml environment (except for the fact that I removed compilers and added cupy, sympy, jupyter, pytest-fail-slow, pytest-skip-slow, and array-api-compat before creating the environment), I get the same failures, hangs, and access violations except:

  • scipy/sparse/linalg/_isolve/tests/test_iterative.py::test_x0_equals_Mb passes
  • None of the 150 scipy.stats.sampling failures

When I add pytorch with mamber install -c conda-forge pytorch, the failures of scipy/io/tests/test_mmio.py::test_threadpoolctl turn into RuntimeWarnings about Intel and LLVM OpenMP, and the scipy/sparse/linalg/_isolve/tests/test_iterative.py::test_x0_equals_Mb failure comes back. I still don't get the scipy.stats.sampling errors, though.

from scipy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.