Intel(R) Extension for Scikit-learn is a seamless way to speed up your Scikit-learn application.
Project description
Intel(R) Extension for Scikit-learn*
Intel(R) Extension for Scikit-learn is a seamless way to speed up your Scikit-learn application. The acceleration is achieved through the use of the Intel(R) oneAPI Data Analytics Library (oneDAL). Patching scikit-learn makes it a well-suited machine learning framework for dealing with real-life problems.
⚠️Intel(R) Extension for Scikit-learn contains scikit-learn patching functionality that was originally available in daal4py package. All future updates for the patches will be available only in Intel(R) Extension for Scikit-learn. We recommend you to use scikit-learn-intelex package instead of daal4py. You can learn more about daal4py in daal4py documentation.
Running the latest scikit-learn test suite with Intel(R) Extension for Scikit-learn:
👀 Follow us on Medium
We publish blogs on Medium, so follow us to learn tips and tricks for more efficient data analysis with the help of Intel(R) Extension for Scikit-learn. Here are our latest blogs:
- Save Time and Money with Intel Extension for Scikit-learn
- Superior Machine Learning Performance on the Latest Intel Xeon Scalable Processors
- Leverage Intel Optimizations in Scikit-Learn
- Intel Gives Scikit-Learn the Performance Boost Data Scientists Need
- From Hours to Minutes: 600x Faster SVM
- Improve the Performance of XGBoost and LightGBM Inference
- Accelerate Kaggle Challenges Using Intel AI Analytics Toolkit
- Accelerate Your scikit-learn Applications
- Accelerate Linear Models for Machine Learning
- Accelerate K-Means Clustering
🔗 Important links
- Notebook examples
- Documentation
- scikit-learn API and patching
- Benchmark code
- Building from Sources
- About Intel(R) oneAPI Data Analytics Library
- About Intel(R) daal4py
💬 Support
Report issues, ask questions, and provide suggestions using:
You may reach out to project maintainers privately at onedal.maintainers@intel.com
🛠 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. Intel(R) Extension for Scikit-learn is also available as a part of Intel® oneAPI AI Analytics Toolkit (AI Kit).
- PyPi (recommended by default)
pip install scikit-learn-intelex
- Anaconda Cloud from Conda-Forge channel (recommended for conda users by default)
conda install scikit-learn-intelex -c conda-forge
- Anaconda Cloud from Intel channel (recommended for Intel® Distribution for Python users)
conda install scikit-learn-intelex -c intel
[Click to expand] ℹ️ Supported configurations
📦 PyPi channel
OS / Python version | Python 3.6 | Python 3.7 | Python 3.8 | Python 3.9 |
---|---|---|---|---|
Linux | [CPU, GPU] | [CPU, GPU] | [CPU, GPU] | ❌ |
Windows | [CPU, GPU] | [CPU, GPU] | [CPU, GPU] | ❌ |
OsX | [CPU] | [CPU] | [CPU] | ❌ |
📦 Anaconda Cloud: 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] |
OsX | [CPU] | [CPU] | [CPU] | [CPU] |
📦 Anaconda Cloud: Intel channel
OS / Python version | Python 3.6 | Python 3.7 | Python 3.8 | Python 3.9 |
---|---|---|---|---|
Linux | [CPU, GPU] | [CPU, GPU] | [CPU, GPU] | ❌ |
Windows | [CPU, GPU] | [CPU, GPU] | [CPU, GPU] | ❌ |
OsX | [CPU] | [CPU] | [CPU] | ❌ |
⚠️ Note: GPU support is an optional dependency. Required dependencies for GPU support will not be downloaded. You need to manually install dpcpp_cpp_rt package.
[Click to expand] ℹ️ How to install dpcpp_cpp_rt package
- PyPi
pip install --upgrade dpcpp_cpp_rt
- Anaconda Cloud
conda install dpcpp_cpp_rt -c intel
You can build the package from sources as well.
⚡️ Get Started
Intel CPU optimizations patching
import numpy as np
from sklearnex import patch_sklearn
patch_sklearn()
from sklearn.cluster import DBSCAN
X = np.array([[1., 2.], [2., 2.], [2., 3.],
[8., 7.], [8., 8.], [25., 80.]], dtype=np.float32)
clustering = DBSCAN(eps=3, min_samples=2).fit(X)
Intel GPU optimizations patching
import numpy as np
from sklearnex import patch_sklearn
from daal4py.oneapi import sycl_context
patch_sklearn()
from sklearn.cluster import DBSCAN
X = np.array([[1., 2.], [2., 2.], [2., 3.],
[8., 7.], [8., 8.], [25., 80.]], dtype=np.float32)
with sycl_context("gpu"):
clustering = DBSCAN(eps=3, min_samples=2).fit(X)
🚀 Scikit-learn patching
Configurations:
- HW: c5.24xlarge AWS EC2 Instance using an Intel Xeon Platinum 8275CL with 2 sockets and 24 cores per socket
- SW: scikit-learn version 0.24.2, scikit-learn-intelex version 2021.2.3, Python 3.8
[Click to expand] ℹ️ Reproduce results
- With Intel® Extension for Scikit-learn enabled:
python runner.py --configs configs/blogs/skl_conda_config.json –report
- With the original Scikit-learn:
python runner.py --configs configs/blogs/skl_conda_config.json –report --no-intel-optimized
Intel(R) Extension for Scikit-learn patching affects performance of specific Scikit-learn functionality. Refer to the list of supported algorithms and parameters for details. In cases when unsupported parameters are used, the package fallbacks into original Scikit-learn. If the patching does not cover your scenarios, submit an issue on GitHub.
⚠️ We support optimizations for the last four versions of scikit-learn. The latest release of Intel(R) Extension for Scikit-learn 2021.3.X supports scikit-learn 0.22.X, 0.23.X, 0.24.X and 1.0.X.
📜 Intel(R) Extension for Scikit-learn verbose
To find out which implementation of the algorithm is currently used (Intel(R) Extension for Scikit-learn or original Scikit-learn), set the environment variable:
- On Linux and Mac OS:
export SKLEARNEX_VERBOSE=INFO
- On Windows:
set SKLEARNEX_VERBOSE=INFO
For example, for DBSCAN you get one of these print statements depending on which implementation is used:
SKLEARNEX INFO: sklearn.cluster.DBSCAN.fit: running accelerated version on CPU
SKLEARNEX INFO: sklearn.cluster.DBSCAN.fit: fallback to original Scikit-learn
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for scikit_learn_intelex-2021.4.0-py39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76666b6641752e4cd2a373e48f171a6a739771d169a1aa111ba603ae64beaed7 |
|
MD5 | cc836bc5f9f4d387c52156e33a8ade84 |
|
BLAKE2b-256 | 9b2373093e0508848421d2bded3672c514cce069cb575023fde064da3c44d496 |
Hashes for scikit_learn_intelex-2021.4.0-py39-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c09d4e0ef72d2fe73b75df737ff5180d99b466135f98a25d72b74b29f3024e33 |
|
MD5 | d1f1d0cc3dc3be74eb78910182df4e1f |
|
BLAKE2b-256 | 8616c31533b4514b0188968072299996dd74b913548c27902427ff1c3f8ea814 |
Hashes for scikit_learn_intelex-2021.4.0-py39-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8d79a1356f2d45b818072e224ed6aa305605ccc333758b9ac40ab9f3818d7c2 |
|
MD5 | 9d20df2227b3513ea7e814eaa7d46d4d |
|
BLAKE2b-256 | fa9bc834029726a25388eee1d5476357757d0f55a046d839a73e51b21b6dab05 |
Hashes for scikit_learn_intelex-2021.4.0-py38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef4f455c03cf3bcc0425222e0fa0086ff93c7af9f9bc46c49fc17bf9d0a6c465 |
|
MD5 | 41015bdd91059c523a7d1295f4d20a25 |
|
BLAKE2b-256 | a708c3d75f7842edaf1ff6c32230541c1fcbe3bd5178a67801f69f569777a727 |
Hashes for scikit_learn_intelex-2021.4.0-py38-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2af2545a09ca262d272b1a70675e32f46db436103e1d8d2f6612a7d0ceff43de |
|
MD5 | ba714defb617b4bc91b52e06ea1bdfd4 |
|
BLAKE2b-256 | de8d1d522e42db9279cee84bc1f32fd6b2304a32d5dfe34c7e4c7b9ad4d16321 |
Hashes for scikit_learn_intelex-2021.4.0-py38-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19abda9d46b34476ba4ff017f811d1bd59a1ba25679ca1ed8fb232d662f47046 |
|
MD5 | f08a16e2a435e4007b632532e5465e3c |
|
BLAKE2b-256 | 5d38d7da0eb99d9e62f3f3fbf961f0d411ea85cf4d1590912e4eba5b5850710e |
Hashes for scikit_learn_intelex-2021.4.0-py37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fe470a486e1b4216fac69f1202a670c330053121583e2c94265abb277ed59f7 |
|
MD5 | 5d05c73a0648c19a86c01ed3c2a487e2 |
|
BLAKE2b-256 | e62d64137b7a03c6a2ad3aa6108c75efdb5cf7c03855b1623278915f3abdc51b |
Hashes for scikit_learn_intelex-2021.4.0-py37-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce3a053ad40f166a203406a76b73067a3d83252ba9812a037991bf733d19dcad |
|
MD5 | b0f7f78eac7886c876495f33a0b6784d |
|
BLAKE2b-256 | 39321d979e6de3323e33d687015b597080a28058795713e8c2e66deb6584ba8a |
Hashes for scikit_learn_intelex-2021.4.0-py37-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54589f61023e45ff3d951137cbe410614ef5348a4cdfcd08853309515554b6c1 |
|
MD5 | 45368d3ab720781e157deb7657c242da |
|
BLAKE2b-256 | 0aa9f0a6383df6bfd4dc28660983a3abb0fecf991ebe82d61982589328033980 |
Hashes for scikit_learn_intelex-2021.4.0-py36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6ade92c26aede0a8ed8235eec908994978b371fff587fa46cda8bc00161feee |
|
MD5 | 2e282e2c271048392860a900cee38d9f |
|
BLAKE2b-256 | 6ccb8e9027d3b980fce09d93b9fd29318c257832ba72545a552204c8401ce8e1 |
Hashes for scikit_learn_intelex-2021.4.0-py36-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a7b05bfb5801727457d3b9f126833f5c3dcb1eb1cdfc7c07519bc440675e939 |
|
MD5 | 0b15e461b3597eb1bc639acdb4452368 |
|
BLAKE2b-256 | 7d871ef0102e4ba231c93f4624390654daab74309a26f1f8958b70fceb672aa3 |
Hashes for scikit_learn_intelex-2021.4.0-py36-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97ed6e4213f6959495252209587442f04949125c5e8a1ca3685ad14788343cc9 |
|
MD5 | e775e4dfff767791ccb5e48cd013ac9f |
|
BLAKE2b-256 | 6698df5d6fb80264ce8430b24434e451f68089088759d32c2e9103821836539b |