Skip to content

Commit 30e49fa

Browse files
better instructions for MPI installs (#2638)
1 parent 5ad1bbb commit 30e49fa

File tree

3 files changed

+65
-23
lines changed

3 files changed

+65
-23
lines changed

doc/sources/distributed-mode.rst

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,57 @@ Several :doc:`GPU-supported algorithms <oneapi-gpu>`
2626
also provide distributed, multi-GPU computing capabilities via integration with |mpi4py|. The prerequisites
2727
match those of GPU computing, along with an MPI backend of your choice (`Intel MPI recommended
2828
<https://www.intel.com/content/www/us/en/developer/tools/oneapi/mpi-library.html>`_, available
29-
via ``impi_rt`` python package) and the |mpi4py| python package. If using |sklearnex|
29+
via the ``impi_rt`` python/conda package) and the |mpi4py| python package. If using |sklearnex|
3030
`installed from sources <https://github.com/uxlfoundation/scikit-learn-intelex/blob/main/INSTALL.md#build-from-sources>`_,
3131
ensure that the spmd_backend is built.
3232

3333
.. important::
34-
SMPD mode requires the |mpi4py| package used at runtime to be compiled with the same MPI backend as the |sklearnex|. The PyPI and Conda distributions of |sklearnex| both use Intel's MPI as backend, and hence require an |mpi4py| also built with Intel's MPI - it can be easily installed from Intel's conda channel as follows::
35-
36-
conda install -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels mpi4py
34+
SMPD mode requires the |mpi4py| package used at runtime to be compiled with the same MPI backend as the |sklearnex|, or with an ABI-compatible MPI backend. The PyPI and Conda distributions of |sklearnex| are both built with Intel's MPI as backend, which follows the MPICH ABI and hence require an |mpi4py| also built with either Intel's MPI, or with another MPICH-compatible MPI backend (such as MPICH itself) - versions of |mpi4py| built with Intel's MPI can be installed as follows:
3735

38-
.. warning:: Packages from the Intel channel are meant to be compatible with dependencies from ``conda-forge``, and might not work correctly in environments that have packages installed from the ``anaconda`` channel.
36+
.. tabs::
37+
.. tab:: From conda-forge
38+
::
3939

40-
It also requires the MPI runtime executable (``mpiexec`` / ``mpirun``) to be from the same library that was used to compile |sklearnex|. Intel's MPI runtime library is offered as a Python package ``impi_rt`` and will be installed together with the ``mpi4py`` package if executing the command above, but otherwise, it can be installed separately from different distribution channels:
40+
conda install -c conda-forge mpi4py mpi=*=impi
4141

42-
- Conda-Forge::
42+
.. tab:: From Intel's conda channel
43+
::
4344

44-
conda install -c conda-forge impi_rt
45+
conda install -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels mpi4py mpi=*=impi
4546

46-
.. tip:: ``impi_rt`` is also available from the Intel channel: ``https://software.repos.intel.com/python/conda``.
47+
.. warning:: Packages from the Intel channel are meant to be compatible with dependencies from ``conda-forge``, and might not work correctly in environments that have packages installed from the ``anaconda`` channel.
4748

48-
- PyPI (not recommended, might require setting additional environment variables)::
49+
.. tab:: From Intel's pip Index
50+
::
4951

50-
pip install impi_rt
52+
pip install --index-url https://software.repos.intel.com/python/pypi mpi4py impi_rt
53+
54+
It also requires the MPI runtime executable (``mpiexec`` / ``mpirun``) to be from the same library that was used to compile |sklearnex| or from a compatible library. Intel's MPI runtime library is offered as a Python package ``impi_rt`` and will be installed together with the ``mpi4py`` package if executing the commands above, but otherwise, it can be installed separately from different distribution channels:
55+
56+
.. tabs::
57+
.. tab:: From conda-forge
58+
::
59+
60+
conda install -c conda-forge impi_rt mpi=*=impi
61+
62+
.. tab:: From Intel's conda channel
63+
::
64+
65+
conda install -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels impi_rt mpi=*=impi
66+
67+
.. tab:: From PyPI
68+
::
69+
70+
pip install impi_rt
71+
72+
.. tab:: From Intel's pip Index
73+
::
74+
75+
pip install --index-url https://software.repos.intel.com/python/pypi impi_rt
76+
77+
78+
Using other MPI backends that are not MPICH-compatible (e.g. OpenMPI) requires building |sklearnex| from source with that backend, and using an |mpi4py| built with that same backend.
5179

52-
Using other MPI backends (e.g. OpenMPI) requires building |sklearnex| from source with that backend.
5380

5481
Note that |sklearnex| supports GPU offloading to speed up MPI operations. This is supported automatically with
5582
some MPI backends, but in order to use GPU offloading with Intel MPI, it is required to set the environment variable ``I_MPI_OFFLOAD`` to ``1`` (providing

doc/sources/distributed_daal4py.rst

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,29 +43,42 @@ same algorithms to much larger problem sizes.
4343

4444
Just like SPMD mode in ``sklearnex``, using distributed mode in ``daal4py`` requires
4545
the MPI runtime library managing the computations to be the same MPI backend library
46-
with which the |sklearnex| library was compiled. Distributions of the |sklearnex| in
47-
PyPI and conda are both compiled with `Intel's MPI <https://www.intel.com/content/www/us/en/developer/tools/oneapi/mpi-library.html>`__
46+
with which the |sklearnex| library was compiled, or to be ABI compatible with it.
47+
Distributions of the |sklearnex| in PyPI and conda-forge are both compiled with `Intel's MPI <https://www.intel.com/content/www/us/en/developer/tools/oneapi/mpi-library.html>`__
4848
as MPI backend (offered as Python package ``impi_rt`` in both PyPI and conda): ::
4949

50-
conda install -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels impi_rt
50+
conda install -c conda-forge impi_rt mpi=*=impi
5151

52-
Using distributed mode with other backends such as OpenMPI requires compiling the
52+
Using distributed mode with non-MPICH-compatible backends such as OpenMPI requires compiling the
5353
library from source with that backend.
5454

5555
See the docs for :ref:`SPMD mode <distributed>` for more details.
5656

5757
.. warning::
5858

5959
If using distributed mode with the |mpi4py| library, that library must also be compiled
60-
with the same MPI backend as the |sklearnex|. A version of ``mpi4py`` compiled with
61-
Intel's MPI backend can be easily installed from Intel's conda channel (see docs for
62-
:ref:`SPMD mode <distributed>` for more details): ::
60+
with the same MPI backend as the |sklearnex|, or with a compatible MPI backend. A version
61+
of ``mpi4py`` compiled with Intel's MPI backend can be easily installed as follows (see docs
62+
for :ref:`SPMD mode <distributed>` for more details):
6363

64-
conda install -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels mpi4py
64+
.. tabs::
65+
.. tab:: From conda-forge
66+
::
67+
68+
conda install -c conda-forge mpi4py mpi=*=impi
69+
70+
.. tab:: From Intel's conda channel
71+
::
72+
73+
conda install -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels mpi4py mpi=*=impi
74+
75+
.. warning:: Packages from the Intel channel are meant to be compatible with dependencies from ``conda-forge``, and might not work correctly in environments that have packages installed from the ``anaconda`` channel.
76+
77+
.. tab:: From Intel's pip Index
78+
::
79+
80+
pip install --index-url https://software.repos.intel.com/python/pypi mpi4py impi_rt
6581

66-
.. warning::
67-
Packages from the Intel channel are meant to be compatible with dependencies from ``conda-forge``, and might not work correctly
68-
in environments that have packages installed from the ``anaconda`` channel.
6982

7083
Using distributed mode
7184
----------------------

doc/sources/quick-start.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ To install |sklearnex|, run:
189189

190190
pip install scikit-learn-intelex
191191

192+
.. tip:: Wheels are also available through Intel's index: ``https://software.repos.intel.com/python/pypi``
193+
192194
**Supported Configurations**
193195

194196
.. list-table::

0 commit comments

Comments
 (0)