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.5.0-py39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54ff46020c33db3ed9773d4566a03c0def8ba56b911de5b0c23c035f47dabe2a |
|
MD5 | bceee990e49ef0e943f66c766bdc5ef4 |
|
BLAKE2b-256 | dfa2fb6f2a80fcb179d950527c57fb5909aeb00e877fd3fc01f536ed2199a4e7 |
Hashes for scikit_learn_intelex-2021.5.0-py39-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de963f602d84d5f73d374f89b048f471e4365aca57b4365fb8131a33b8e1364a |
|
MD5 | 210a2b51b3932ec764a20a820e6c276f |
|
BLAKE2b-256 | 8e3c7d8834650ec2874e7bbd9e0e0b13fb5031b21546aead4ef5af7778bfeaa5 |
Hashes for scikit_learn_intelex-2021.5.0-py38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 644e1455ab6c266a25315960cd9b08344a3e0ecf3273d0ad01557c448e3e3848 |
|
MD5 | 69156a651d12ed3d54f53ba00bdbbba1 |
|
BLAKE2b-256 | bb9a417e3a5cd8f68007e7c4ba9285cac1067671bc5c85dca2447e02af55bfe0 |
Hashes for scikit_learn_intelex-2021.5.0-py38-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3e04c47eef4a3b40f8022eb10e045feb46210114e75197da7cb3e9cf81d4beb |
|
MD5 | 3b768453360bf9b3a4dcb7b25ea47177 |
|
BLAKE2b-256 | 0fd472e3b131f9c9bb8cfe4a0fe9e828fc6d1a7014c7339955c620753b5f6eb1 |
Hashes for scikit_learn_intelex-2021.5.0-py37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c97d9189d24aaeef4bf3ef84e0f9ed696f0db8394569c447607f1037b1c63d5a |
|
MD5 | 7d01ad00e8b07fc046cb556410f72f93 |
|
BLAKE2b-256 | 9b07dde949a6caf8c35829da12657ad528ba84008c2df967179fef47da772669 |
Hashes for scikit_learn_intelex-2021.5.0-py37-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d492ab3916b432f1427754ef95b7dd5be6593e33078d628ee6d4b4ba4d8b268c |
|
MD5 | 2ad8928cde28bb8029e94652786f8681 |
|
BLAKE2b-256 | 38cc31c832748d12953a043d9992c8518c5c73687ee5a814b454fbcb32bfb8d4 |
Hashes for scikit_learn_intelex-2021.5.0-py36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 936d66dab9e4e2ccb3210299a2712b3fb9db790592ce6ffa14e03dd0dd92126c |
|
MD5 | 88677ceb427c3f29aad36040b14d00e5 |
|
BLAKE2b-256 | faf01b7fdd3c7387a9d414735789fad08c6dd7ac6c909a517bae5ef6eadda0a8 |
Hashes for scikit_learn_intelex-2021.5.0-py36-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f1c669dc69508ab321ed5d0430b08bc6abf72c5261c73057673f31eeb5e817a |
|
MD5 | 98994f072a8b58532d4f4918158d3081 |
|
BLAKE2b-256 | bc1e901fd2b9901298784a1ed8dc6232dd687fccfc798f3c5c0b057493d8f718 |