You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.. Licensed under the Apache License, Version 2.0 (the "License");
4
+
.. you may not use this file except in compliance with the License.
5
+
.. You may obtain a copy of the License at
6
+
..
7
+
.. http://www.apache.org/licenses/LICENSE-2.0
8
+
..
9
+
.. Unless required by applicable law or agreed to in writing, software
10
+
.. distributed under the License is distributed on an "AS IS" BASIS,
11
+
.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+
.. See the License for the specific language governing permissions and
13
+
.. limitations under the License.
14
+
.. include:: substitutions.rst
15
+
16
+
=====================
17
+
About the |sklearnex|
18
+
=====================
19
+
20
+
The |sklearnex| is a free and open-source software accelerator built atop of the |sklearn| and the :external+onedal:doc:`oneDAL <index>` (|onedal|) libraries.
21
+
22
+
It mostly works by replacing selected calls to algorithms in |sklearn| with calls to the |onedal| library, which offers more optimized versions of the same routines (see :doc:`algorithms`). The optimizations in the |onedal| in turn are achieved by leveraging SIMD instructions and exploiting cache structures of modern hardware, along with using the `oneMKL <https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl.html>`__ library for linear algebra operations in place of the `OpenBLAS <https://www.openmathlib.org/OpenBLAS/>`__ library used by default by |sklearn|.
23
+
24
+
Unlike other libraries in the Python ecosystem, classes and functions in the |sklearnex| are not just :external+sklearn:doc:`scikit-learn-compatible <developers/develop>`, but rather are built atop of |sklearn| itself by inheriting from their classes directly, defining the same attributes that the stock version of |sklearn| would do for each estimator, and reusing most of scikit-learn's estimator methods where appropriate.
25
+
26
+
The |sklearnex| is regularly tested for API compatibility and for correctness against |sklearn|'s own test suite (see :ref:`conformance_tests` for more information), and can be easily swapped in place of the stock |sklearn| library by :doc:`patching <patching>` it.
27
+
28
+
The |sklearnex| aims to be compatible with the last 3 minor releases of |sklearnex| available at any given time, in addition to the 1.0 release as a special case, and ensures this compatibility by offering different code routes according to the |sklearn| version encountered at runtime - for example, if a given attribute of a class is removed in version 1.x of |sklearn|, the |sklearnex| will not set that attribute when running with |sklearn| >=1.x, but will still do so when running with |sklearn| <1.x, in order to guarantee full API compatibility.
29
+
30
+
Performance of the |sklearnex| is regularly measured and compared against that of other libraries using public and synthetic datasets through `sklbench <https://github.com/IntelPython/scikit-learn_bench>`__, which is also free and fully open-source.
31
+
32
+
Initially developed by Intel as the Intel Extension for Scikit-learn*, the |sklearnex| and the |onedal| are now projects under the `UXL Foundation <https://uxlfoundation.org>`__ umbrella, and can be built from source to provide accelerated routines for other platforms such as ARM and RISCV - see :doc:`building-from-source` for more information.
Copy file name to clipboardExpand all lines: doc/sources/building-from-source.rst
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,8 @@ The |sklearnex| predominantly functions as a frontend to the |onedal| by leverag
24
24
25
25
.. note:: Python packages ``dal`` (conda) and ``daal`` (PyPI) provide the same components, but due to naming availability in these repositories, they are distributed under different names.
26
26
27
+
.. note:: When installing the |onedal| through ``pip`` or ``conda``, the files required for running on GPU are contained in a different package ``dal-gpu`` / ``daal-gpu``, while the standalone intallers, APT/YUM packages and others have the required files for GPU in the same package.
28
+
27
29
As a library, the |sklearnex| consists of a Python codebase with Python extension modules written in C++ and Cython, with some of those modules being optional. These extension modules require compilation before being used, for which a C++ compiler along with other dependencies is required. In the case of GPU-related modules, a SYCL compiler (such as `Intel's DPC++ <https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html>`__) is required, and in the case of distributed mode, whether on CPU or on GPU, an MPI backend is required, such as `Intel MPI <https://www.intel.com/content/www/us/en/developer/tools/oneapi/mpi-library.html>`__.
28
30
29
31
The extension modules are as follows:
@@ -246,9 +248,9 @@ The following environment variables can be used to control setup aspects:
246
248
- ``DALROOT``: sets the |onedal| path.
247
249
- ``MKLROOT``: path to the oneMKL runtime libraries, which are used for the DPC module. This variable is optional and only has an effect when using the option ``abs-rpath`` on Linux* (see the rest of this page for details).
248
250
- ``MPIROOT``: sets the path to the MPI library. If this variable is not set but ``I_MPI_ROOT`` is found, will use ``I_MPI_ROOT`` instead. Not used when using ``NO_DIST=1``.
249
-
- ``NO_DIST``: set to '1', 'yes' or alike to build without support for distributed mode.
251
+
- ``NO_DIST``: set to '1', 'yes' or alike to build without support for distributed mode. Note that distributed mode in the ``sklearnex`` module requires building with DPC++ support.
250
252
- ``NO_STREAM``: set to '1', 'yes' or alike to build without support for streaming mode.
251
-
- ``NO_DPC``: set to '1', 'yes' or alike to build without support of oneDAL DPC++ interfaces.
253
+
- ``NO_DPC``: set to '1', 'yes' or alike to build without support of the |onedal| DPC++ interfaces (GPU). Note that building the DPC++ component (default) of this library requires also the DPC++ components of the |onedal| (packages ``dal-gpu`` / ``daal-gpu`` if installing it from ``conda`` or ``pip``).
252
254
- ``MAKEFLAGS``: the last `-j` flag determines the number of threads for building the onedal extension. It will default to the number of CPU threads when not set.
253
255
254
256
.. note:: The ``-j`` flag in the ``MAKEFLAGS`` environment variable is superseded in ``setup.py`` modes which support the ``--parallel`` and ``-j`` command line flags.
.. 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.
47
-
48
41
.. tab:: From PyPI
49
42
::
50
43
@@ -64,22 +57,11 @@ via the ``impi_rt`` / ``impi-rt`` python/conda package) and the |mpi4py| python
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.
|sklearnex| is a **free software AI accelerator** designed to deliver up to **100X** faster performance for your existing |sklearn| code.
24
104
The software acceleration is achieved with vector instructions, AI hardware-specific memory optimizations, threading, and optimizations.
25
105
26
-
.. rubric:: Designed for Data Scientists and Framework Designers
27
-
28
-
29
-
Use |sklearnex|, to:
106
+
Benefits:
30
107
31
-
* Speed up training and inference by up to 100x with equivalent mathematical accuracy
32
-
* Benefit from performance improvements across different x86-64 CPUs and Intel(R) GPUs (including iGPUs)
33
-
* Integrate the extension into your existing |sklearn| applications without code modifications
34
-
* Enable and disable the extension with a couple of lines of code or at the command line
108
+
* Speed up training and inference by up to 100x with equivalent mathematical accuracy.
109
+
* Benefit from performance improvements across different hardware configurations, including :doc:`GPUs <oneapi-gpu>` and :doc:`multi-GPU <distributed-mode>` configurations.
110
+
* Integrate the extension into your existing |sklearn| applications without code modifications.
111
+
* Continue to use the open-source |sklearn| API.
112
+
* Enable and disable the extension with a couple of lines of code or at the command line.
Note: executing on GPU has `additional system software requirements <https://www.intel.com/content/www/us/en/developer/articles/system-requirements/intel-oneapi-dpcpp-system-requirements.html>`__ - see :doc:`oneapi-gpu`.
84
174
@@ -150,77 +240,3 @@ Note: executing on GPU has `additional system software requirements <https://www
150
240
151
241
152
242
See :ref:`oneapi_gpu` for other ways of executing on GPU.
0 commit comments