Skip to content

Latest commit

 

History

History
executable file
·
225 lines (155 loc) · 8.97 KB

INSTALL.md

File metadata and controls

executable file
·
225 lines (155 loc) · 8.97 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.6 Python 3.7 Python 3.8 Python 3.9
Linux [CPU, GPU] [CPU, GPU] [CPU, GPU] [CPU, GPU]
Windows [CPU, GPU] [CPU, GPU] [CPU, GPU] [CPU, GPU]
OsX [CPU] [CPU] [CPU] [CPU]

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 create -n env -c conda-forge python=3.9 scikit-learn-intelex

    If you do not specify the version of Python (python=3.9 in the example above), then Python 3.10 is downloaded by default, which is not supported.

  • Install into your current environment:

    conda install scikit-learn-intelex -c conda-forge
📦 Supported configurations for Anaconda Cloud from Conda-Forge channel
OS / Python version Python 3.6 Python 3.7 Python 3.8 Python 3.9
Linux [CPU] [CPU] [CPU] [CPU]
Windows [CPU] [CPU] [CPU] [CPU]
MacOS [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 create -n env -c intel python scikit-learn-intelex
  • Install into your current environment:

    conda install scikit-learn-intelex -c intel
📦 Supported configurations for Anaconda Cloud from Intel channel
OS / Python version Python 3.6 Python 3.7 Python 3.8 Python 3.9
Linux [CPU, GPU] [CPU, GPU] [CPU, GPU] [CPU, GPU]
Windows [CPU, GPU] [CPU, GPU] [CPU, GPU] [CPU, GPU]
MacOS [CPU] [CPU] [CPU] [CPU]

Install via Anaconda Cloud from Main channel

  • Install into a newly created environment (recommended):

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

    If you do not specify the version of Python (python=3.9 in the example above), then Python 3.10 is downloaded by default, which is not supported.

  • Install into your current environment:

    conda install scikit-learn-intelex
📦 Supported configurations for Anaconda Cloud from Main channel
OS / Python version Python 3.6 Python 3.7 Python 3.8 Python 3.9
Linux [CPU, GPU] [CPU, GPU] [CPU, GPU] [CPU, GPU]
Windows [CPU, GPU] [CPU, GPU] [CPU, GPU] [CPU, GPU]
MacOS [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.6, < 3.10
  • daal4py >= 2021.4

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

Configure the build with environment variables

  • SKLEARNEX_VERSION: sets package version

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.