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.6.2-py310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40a7275d3df942e41c0477f9ff006c3f5e072641c20b0c1c698136e306348b05 |
|
MD5 | a3c413c944d8e3c3f26d1cb181e28236 |
|
BLAKE2b-256 | 0564c59f826edf1ee2478386d43cf69190435761a042fa38b5fa08158cb5f2f0 |
Hashes for scikit_learn_intelex-2021.6.2-py310-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a502109c9ea22d2b4afedc4aa2bcd162338d842e8acc6314011136eac8e6a672 |
|
MD5 | 5ed89e6b68a251c6c7bfa4abfd94f14c |
|
BLAKE2b-256 | 9062d18102c1c14a77dcd3d2a016806c7e24ba378227fddc680ee334b5c85599 |
Hashes for scikit_learn_intelex-2021.6.2-py310-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca007b59e6be86ac0fbcc6d7b99e6c931792cb13669449fa4c79eea665197976 |
|
MD5 | 46440043e579b9596ec16796f6b42082 |
|
BLAKE2b-256 | 5669ddda09c19a8b681a4343f217946d88ed89eab2fa965033c85808f335f511 |
Hashes for scikit_learn_intelex-2021.6.2-py39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbf865b02815578e77e18b92237c8cd8b79090dca4b3319dcc9aac29643f25bc |
|
MD5 | 3b0df5741ce175f166caaa7f349ae31c |
|
BLAKE2b-256 | 2a7e0acd0b0ae7bb3efba7155f91978d37297ca4225a30a42c4fed3450f663dc |
Hashes for scikit_learn_intelex-2021.6.2-py39-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90508c7e8d91ab2a1540203bf7b6d51440dae0ce58575cc56a3bc08cdf86e5c1 |
|
MD5 | 15edf6cef1859c0a3f4d206fa36ddc76 |
|
BLAKE2b-256 | 7614f368c9d2b95f369ec6decf1a649ec07b1ffaf6473d8c0bd090a745d63c14 |
Hashes for scikit_learn_intelex-2021.6.2-py39-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | affdc70e2fa92e6b42da758ebbdd768e45b5c1743faf5aeffdb7b71bb786f4ac |
|
MD5 | fef6578d351810a046f711f68a6dd64e |
|
BLAKE2b-256 | f248253477a1a880a302e07f99ca2171ffd45d26494629ef5b695cc9ded81a1f |
Hashes for scikit_learn_intelex-2021.6.2-py38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 581dc3b93279252c087c91cd9828967759f1666411bedd12a6dc241394173f98 |
|
MD5 | 7a7d4db5134ebefd9270aa3dae3224a3 |
|
BLAKE2b-256 | a6b8432778d7b2cf6d32f76505c899f4cc1a2b4ab3d5d5fb115f844dbf17e1c7 |
Hashes for scikit_learn_intelex-2021.6.2-py38-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5bcf395b1599c7001a1d45d2ba411cd742cd29bfc05740fd4278ee8c42c99f5 |
|
MD5 | 56b26ee42fe91c7ed57830e02e4bec36 |
|
BLAKE2b-256 | 575b9a289ffd8cf00763f5e76c63814e978e4766c76003c4667831ad156ef248 |
Hashes for scikit_learn_intelex-2021.6.2-py38-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbfd08d8ea91cf57280663a1f5432c66568f289589993fd621de7b6473867052 |
|
MD5 | 9e5968155be81bb49a6859f792c7995f |
|
BLAKE2b-256 | 3b68053a51751fb5c89a35c4fd64d92d959fccf8651c4fbfcfcace5eccefc6de |
Hashes for scikit_learn_intelex-2021.6.2-py37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5625e34b7a2060a4398496a17316d35f46a3409d525edb6f669d0d3542487742 |
|
MD5 | 85b7e14d7ccf9a7ef1fba8db275867da |
|
BLAKE2b-256 | c710388d0425a74bc3058ae9dae2fc44c050fe4e411ac4eb8e6931c422222a87 |
Hashes for scikit_learn_intelex-2021.6.2-py37-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af3a08cb5691bfb2f41fb9826079c1dbdb6e62215ab51ba42727bd25f6a248a4 |
|
MD5 | e03991e9618eda0ae5b4a2bb4b98d169 |
|
BLAKE2b-256 | f95154a3a7f580b9ad508bee122ac00facf8f7a58455ac28efbeeff51b69d552 |
Hashes for scikit_learn_intelex-2021.6.2-py37-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de2d7b05d698967a59cc35d33ed8c626ecc765159c4795a952ed1c48feee1bce |
|
MD5 | bb23659a4ac783e938d4596cbdd854f4 |
|
BLAKE2b-256 | ebfe62270c7c7162a936da6965897ac54febc480fee6ecbf0f378831aa145ed0 |