Skip to content

Latest commit

 

History

History
executable file
·
234 lines (162 loc) · 9.07 KB

INSTALL.md

File metadata and controls

executable file
·
234 lines (162 loc) · 9.07 KB

Installation

Intel(R) Extension for Scikit-learn is available at the Python Package Index, on Anaconda Cloud in Conda-Forge channel and in Intel channel. You can also build the extension from sources.

The extension is also available as a part of Intel® AI Analytics Toolkit (AI Kit). If you already have AI Kit installed, you do not need to separately install the extension.

Installation scenarios

Next steps after installation:

Install via pip or conda

Install from PyPI channel (recommended by default)

  1. [Optional step] [Recommended] To prevent version conflicts, create and activate a new environment:

    • On Linux:

      python -m venv env
      source env/bin/activate
    • On Windows:

      python -m venv env
      .\env\Scripts\activate
  2. Install scikit-learn-intelex:

    pip install scikit-learn-intelex

📦 Supported configurations for PyPI

OS / Python version Python 3.8 Python 3.9 Python 3.10 Python 3.11
Linux [CPU, GPU] [CPU, GPU] [CPU, GPU] [CPU, GPU]
Windows [CPU, GPU] [CPU, GPU] [CPU, GPU] [CPU, GPU]

Install from Anaconda Cloud

To prevent version conflicts, we recommend installing scikit-learn-intelex into a new conda environment.

Install via Anaconda Cloud from Conda-Forge channel

  • Install into a newly created environment (recommended):

    conda config --add channels conda-forge
    conda config --set channel_priority strict
    conda create -n env python=3.10 scikit-learn-intelex

..note: If you do not specify the version of Python, the latest one is downloaded.

  • Install into your current environment:

    conda config --add channels conda-forge
    conda config --set channel_priority strict
    conda install scikit-learn-intelex
📦 Supported configurations for Anaconda Cloud from Conda-Forge channel
OS / Python version Python 3.8 Python 3.9 Python 3.10 Python 3.11
Linux [CPU] [CPU] [CPU] [CPU]
Windows [CPU] [CPU] [CPU] [CPU]

Install via Anaconda Cloud from Intel channel

We recommend this installation for the users of Intel® Distribution for Python.

  • Install into a newly created environment (recommended):

    conda config --add channels intel
    conda config --set channel_priority strict
    conda create -n env python=3.10 scikit-learn-intelex

..note: If you do not specify the version of Python, the latest one is downloaded.

  • Install into your current environment:

    conda config --add channels intel
    conda config --set channel_priority strict
    conda install scikit-learn-intelex
📦 Supported configurations for Anaconda Cloud from Intel channel
OS / Python version Python 3.8 Python 3.9 Python 3.10 Python 3.11
Linux [CPU, GPU] [CPU, GPU] [CPU, GPU] [CPU, GPU]
Windows [CPU, GPU] [CPU, GPU] [CPU, GPU] [CPU, GPU]

Install via Anaconda Cloud from Main channel

NOTE: Anaconda Main channel usually lags behind on versions deployed. You likely will not find latest version there.

  • Install into a newly created environment (recommended):

    conda create -n env python=3.10 scikit-learn-intelex

..note: If you do not specify the version of Python, the latest one is downloaded.

  • Install into your current environment:

    conda install scikit-learn-intelex
📦 Supported configurations for Anaconda Cloud from Main channel
OS / Python version Python 3.8 Python 3.9 Python 3.10 Python 3.11
Linux [CPU] [CPU] [CPU] [CPU]
Windows [CPU] [CPU] [CPU] [CPU]

Build from sources

Intel(R) Extension for Scikit-learn is easily built from sources with the majority of the necessary prerequisites available on conda or pip. The instructions below detail how to gather the prerequisites and build and install the completed package. The package can be built for all three major platforms (Windows, Linux, macOS).

Prerequisites

  • Python version >= 3.8, <= 3.11
  • daal4py >= 2024.0

NOTE: You can build daal4py from sources or get it from distribution channels.

Configure the build with environment variables

  • SKLEARNEX_VERSION: sets package version
  • DALROOT: sets the oneAPI Data Analytics Library path

Build Intel(R) Extension for Scikit-learn

  • To install the package:

    cd <checkout-dir>
    python setup_sklearnex.py install
  • To install the package in the development mode:

    cd <checkout-dir>
    python setup_sklearnex.py develop
  • To install scikit-learn-intelex without downloading daal4py:

    cd <checkout-dir>
    python setup_sklearnex.py install --single-version-externally-managed --record=record.txt
    cd <checkout-dir>
    python setup_sklearnex.py develop --no-deps

⚠️ Keys --single-version-externally-managed and --no-deps are required so that daal4py is not downloaded after installation of Intel(R) Extension for Scikit-learn

⚠️ The develop mode will not install the package but it will create a .egg-link in the deployment directory back to the project source code directory. That way you can edit the source code and see the changes without having to reinstall package every time you make a small change.

⚠️ --single-version-externally-managed is an option used for Python packages instructing the setuptools module to create a Python package that can be easily managed by the package manager on the host.

Build documentation for Intel(R) Extension for Scikit-learn

Prerequisites for creating documentation

Build documentation

Run:

cd doc
./build-doc.sh

The documentation will be in doc/_build/html.