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-2023.2.1-py311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ccbe673c7584445df4b1fdeebeb50fbb8466120a0d9b4a46bddf14b30fe387f |
|
MD5 | 47522f7e92ca6a060ca5b796d8b6d9bf |
|
BLAKE2b-256 | c4cbdbb84fa0f32990950da461c7c7d02d4ac14f72dd7314626a8d089c2d3dc8 |
Hashes for scikit_learn_intelex-2023.2.1-py311-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d86b58f63abe53b471398a0dc2cfd22a0fc060d5e43e6d98dff189214554fb0b |
|
MD5 | d2fd2709dfd8f425267ffa08ccc3f04a |
|
BLAKE2b-256 | 11c9765c9bc93c190730412ceee0d87b9c287d5e63ffeb28c803e27dc0bc3057 |
Hashes for scikit_learn_intelex-2023.2.1-py311-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63b64f7e9a6ef733cb2c59db163d8508a0977d31547f6177fba4867bec35cc89 |
|
MD5 | 142f6c243b4b0082b112cdef67bcb0fd |
|
BLAKE2b-256 | a027ab0e45d5c51471514f48845ad3df4bd69276c49ab2221a243e7fee77d9b3 |
Hashes for scikit_learn_intelex-2023.2.1-py310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a69e1f385dbb503e57355aee9c653e3fe9eb08a5804825549061b6d7dd91529c |
|
MD5 | 7f2724a3615fad8aca1b0d01919870bc |
|
BLAKE2b-256 | 0ca6cbd8bec83920978affd4d9488012c2e663eb916515053bf8c26ef2b24102 |
Hashes for scikit_learn_intelex-2023.2.1-py310-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8218e02c10161e646d50e9bef790c6f7b1da31d614140a1a17d772226284f853 |
|
MD5 | d636ee518176e6d1e57765dfc43ca092 |
|
BLAKE2b-256 | 3d8936bf3b024b86ae3c1de86fcaa11ef6e6dfc4d223f491cc648ce6edeea74f |
Hashes for scikit_learn_intelex-2023.2.1-py310-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a62bf2c7b6bc9f086ae0c2e532235b3d53c6a4c25284275c7cda5dfd4eafc1d |
|
MD5 | 7767c2be091b0222b44653ebd750ac56 |
|
BLAKE2b-256 | ae37771809d1a96e25e6ceed9c1d9dfc5de4343f71758e9f90357c6c57e1c8a8 |
Hashes for scikit_learn_intelex-2023.2.1-py39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c6e9b23bcd5d53e9aca8ac3354027c4bbf913ff57ee6141016f15ea87004017 |
|
MD5 | 5bb66063cd051cd359f95f686d8c79ab |
|
BLAKE2b-256 | b5997e67e864c03233ce86e9a4c6b871bd5821ea570d2c54322aa08d9bf75689 |
Hashes for scikit_learn_intelex-2023.2.1-py39-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a85073748f31451132f2913abeebdce342e63d171642155ed46528034465f82 |
|
MD5 | 6184e365773e0b813f9c6d994c869712 |
|
BLAKE2b-256 | dfcbbd7884773d26f931acfc774d6cdd03227b75ca9d70da553215beb4be76db |
Hashes for scikit_learn_intelex-2023.2.1-py39-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5afa0c6af292f05de3cf8c681682877d6d9bd64de20a8695dfd311a68499c6c4 |
|
MD5 | 9ddfbd7cc3f0f1a9a629943f54104b69 |
|
BLAKE2b-256 | a66ae9863178f35b3550bbb29e0044d7dc8c023b88211c398091dd05421dc84e |
Hashes for scikit_learn_intelex-2023.2.1-py38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 440f8a353089e0d769c6f21fa33df9c2959e4bf7954a6bfd0cb1d7aacee82428 |
|
MD5 | 506e2f46a144e4d20d4cb60c757c4371 |
|
BLAKE2b-256 | cc7f4dd2d1f70e39647e89fa441fbc7970092061b07fe660100c5caf19b756d0 |
Hashes for scikit_learn_intelex-2023.2.1-py38-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 404909773ab7eb5a56aff0146fea5629de0260ca9657af7a4650bf1690ebc4f5 |
|
MD5 | 8f8336c58cc24688db0654001753d093 |
|
BLAKE2b-256 | 7e5f9d18a4262214c64846c8591ec074e5c8bae75a764bf70f33290dab589c7e |
Hashes for scikit_learn_intelex-2023.2.1-py38-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b343e204d7980021358a0bfd37bdc030f1c0778d812f0efefeda1a44eab5043 |
|
MD5 | bd6a3e43c3803e3a5efb80ef50b9966d |
|
BLAKE2b-256 | abf32352f9d339ca72d42bc4bcbadb510ddffbd3f1a2623435a087cd30326561 |
Hashes for scikit_learn_intelex-2023.2.1-py37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f56ecc4e72e22010df3d35b270d83b45f653d260f2839304980c8ab2fa7d2030 |
|
MD5 | cafaa2255f7d356fa53b0e49878da451 |
|
BLAKE2b-256 | 46bf7a8ea84059f5a4aaa2084d1da657dca767e2a6a0bbffec071d6c81bf3366 |
Hashes for scikit_learn_intelex-2023.2.1-py37-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 204ad065244fcc8dfa1163ffa289a4c514d899d58b824240912d697fa9b34ef6 |
|
MD5 | efb5f94218d09bd044de9d33a512b0fa |
|
BLAKE2b-256 | d68de5e1957d25e27e36a76f8f15a31d0bf3b90a26fd8a5450a02f9acfabe8fb |