tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: math/py-scikit-learn with OPENMP, at least on Linux?



Hi all.

To conclude this: The discussion is rather irrelevant. I will just
remove the line that does nothing anyway! Observe.

Well, let's revisit what actually happens. Developer docs say:

--------
Building Scikit-learn also requires:

..
    # The following places need to be in sync with regard to Cython version:
    # - .circleci config file
    # - sklearn/_build_utils/__init__.py
    # - advanced installation guide

- Cython >= 0.28.5
- A C/C++ compiler and a matching OpenMP_ runtime library. See the
  :ref:`platform system specific instructions
  <platform_specific_instructions>` for more details.

.. note::

   If OpenMP is not supported by the compiler, the build will be done with
   OpenMP functionalities disabled. This is not recommended since it will force
   some estimators to run in sequential mode instead of leveraging thread-based
   parallelism. Setting the ``SKLEARN_FAIL_NO_OPENMP`` environment variable
   (before cythonization) will force the build to fail if OpenMP is not
   supported.
---------

No mention of SKLEARN_NO_OPENMP, actually. Let's check:

$ find . -type f | xargs grep SKLEARN_NO_OPENMP
$ 

Hah. The setting in our Makefile has no effect anyway!

$ find . -type f | xargs grep NO_OPENMP
./doc/developers/advanced_installation.rst:   parallelism. Setting the ``SKLEARN_FAIL_NO_OPENMP`` environment variable
./sklearn/_build_utils/openmp_helpers.py:        if os.getenv("SKLEARN_FAIL_NO_OPENMP"):

So we could set that variable to make the build intentionally fail
without OpenMP, but not to prevent opportunistic usage.

Of course the question of OpenMP esp. on Darwin could get some better
handling … as well as those unconditional includes of parallel/openmp.

I am inclined to at least put !Darwin around those:

./graphics/darktable/Makefile:.include "../../parallel/openmp/buildlink3.mk"
./graphics/luminance-hdr/Makefile:.include "../../parallel/openmp/buildlink3.mk"

Seeing that parallel/openmp even installs a libgomp.so, this is calling
for trouble. Note that my recent commit to luminance-hdr did not touch
this part, only fftw (and OpenMP _there_).

Of course a proper solution for packages to depend on OpenMP support
also on Dawin is in order, but I feel unable to help with that.


Alrighty then,

Thomas

-- 
Dr. Thomas Orgis
HPC @ Universität Hamburg


Home | Main Index | Thread Index | Old Index