Skip to content

NumPy with Intel MKL as BLAS/LAPACK hangs in Intel OpenMP 2018.0.2 runtime #10060

Closed

Description

@jmwoloso

Hello!

Linux Mint: 18.3 (Sylvia)
Python: 3.6.3
NumPy: 1.13.3
Cython 0.27.3

I am trying to build numpy and scipy wheels from source using the intel mkl compilers. Numpy compiles just fine, however when I run the test suite, the suite hangs on test_path_type_input within test_einsum.TestEinSumPath (or maybe the test after it? not sure because the last test name visible is this one; see screen cap)

Running the test suite for scipy results in the suite hanging on test_lapack within test_build.TestF77Mismatch

In both cases (numpy and scipy) the tests run and pass fine when run individually, so I'm not sure what else might be the cause.

Any help is greatly appreciated. See screen shot for images of the test suites when they're stuck is included.
numpy
scipy

Activity

  1. mattip commented on Nov 25, 2017

    @mattip
    Member

    A couple of things to try, since this might be specific to your setup:

    • what happens when you use a different compiler?
    • what is your memory use/cpu use when it is hung? Perhaps you are running out of memory and hitting a swap file?
  2. jmwoloso commented on Nov 27, 2017

    @jmwoloso
    Author

    @mattip Thank you for the suggestions. I tried compiling with gcc instead of mkl and the tests run fine now and pass, so it's obviously an intel mkl issue (once again, go figure). Closing. Thank you again!

  3. oleksandr-pavlyk commented on Apr 16, 2018

    @oleksandr-pavlyk
    Contributor

    It is an Intel OpenMP issue. A work-around is to either set KMP_INIT_AT_FORK=FALSE prior to launching the NumPy’s test suite, or to use the TBB threading layer, by setting MKL_THREADING_LAYER=TBB prior to launching python, i.e.

    # work-around 1:
    KMP_INIT_AT_FORK=FALSE python script.py
    # work-around 2:
    MKL_THREADING_LAYER=TBB python script.py` 
    

    Yet another work-around is to use an older version of libiomp5 (get the shared object library for 2018 update 1 from Anaconda's cloud and overwrite what is installed with MKL).

  4. mattip commented on Apr 16, 2018

    @mattip
    Member

    Does this issue also come up in production environments?
    We should at least document this somewhere, perhaps in doc/source/dev/development_environment.rst

    @oleksandr-pavlyk can you suggest some wording that would maximize the likeleyhood that google will point people in the right direction?

  5. changed the title [-]test_path_type_input hangs when running the test suite[/-] [+]intel compiler hangs in openmp[/+] on Apr 16, 2018
  6. oleksandr-pavlyk commented on Apr 16, 2018

    @oleksandr-pavlyk
    Contributor

    @mattip Yes, hangs can occur in a production environment as well, and afflict problems that do not use MKL, but use Intel OpenMP. It's just that MKL uses Open MP as its default threading layer.

    The new title of this issue is a little misleading, I'd say. The hang occurs in the compiler's run-time library, not in the compiler itself.

  7. changed the title [-]intel compiler hangs in openmp[/-] [+]intel openmp as used by intel mkl ocmpiler can hang at runtime[/+] on Apr 17, 2018
  8. mattip commented on Apr 17, 2018

    @mattip
    Member

    @oleksandr-pavlyk now is the titile closer to correct?

  9. changed the title [-]intel openmp as used by intel mkl ocmpiler can hang at runtime[/-] [+]intel openmp as used by intel mkl compiler can hang at runtime[/+] on Apr 17, 2018
  10. oleksandr-pavlyk commented on Apr 17, 2018

    @oleksandr-pavlyk
    Contributor

    @mattip Please change it to "NumPy with Intel MKL as BLAS/LAPACK hangs in Intel OpenMP runtime".

    It is important to state that this problem is specific to Intel OpenMP 2018.0.2, and is already fixed in sources, therefore the fix will be available at the next release cadence.

  11. changed the title [-]intel openmp as used by intel mkl compiler can hang at runtime[/-] [+]NumPy with Intel MKL as BLAS/LAPACK hangs in Intel OpenMP runtime[/+] on Apr 17, 2018
  12. changed the title [-]NumPy with Intel MKL as BLAS/LAPACK hangs in Intel OpenMP runtime[/-] [+]NumPy with Intel MKL as BLAS/LAPACK hangs in Intel OpenMP 2018.0.2 runtime[/+] on Apr 17, 2018
  13. mattip commented on Apr 17, 2018

    @mattip
    Member

    thanks for the clarification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions