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.3-py310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f210ed0ca7e65d89e312cef2b69525a594a6d9a0de199a36deff6447a8b1353 |
|
MD5 | e6985196ab74fb5384c92e5f8c4db458 |
|
BLAKE2b-256 | 0a027ff232528177f412ec2d738d1e753efa4c341ef4604f18511f0fbf339d67 |
Hashes for scikit_learn_intelex-2021.6.3-py310-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f70c4625c0a976afbd5e5fc4b058559d7c88b9aed316e2aa2a522e9d19e86f40 |
|
MD5 | b593de5b403d9f57a5d2d307a2282f1b |
|
BLAKE2b-256 | b708d4adeff555782ca4f4d9d8188405e370fb9e46f80cd264e2e6f19b1918d0 |
Hashes for scikit_learn_intelex-2021.6.3-py310-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c084f8c4b24560bccdc26f6ffa3e1cb640fbe86201c77b289d40df7e02f44921 |
|
MD5 | 39613007dd4c93321d5478962a6ae4b3 |
|
BLAKE2b-256 | 5fc00069a054157edea777b80fea0757f4bd473ddee3bac6f24298010c5e2a9b |
Hashes for scikit_learn_intelex-2021.6.3-py39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30e4b357938b958ea9798d0c93ec1fabe32261d4137a9b166d1e46d858c307b7 |
|
MD5 | 68af7fc056d5aa143930eff863e7ed83 |
|
BLAKE2b-256 | 2f9461f6d00bfa727f42b10613730d2c975af3c1b3acee25cdc3944fc9c4707b |
Hashes for scikit_learn_intelex-2021.6.3-py39-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac37e4b802c95aa0f71b5d1072517161a42c1211408a3e380d5a7efb307ac51c |
|
MD5 | 78987ed1f3335b86cfe5b5eb4a83efd0 |
|
BLAKE2b-256 | 088ba99bb53d69db783e578e30efe336bfccde76044d1bcd8d6a94de44760b65 |
Hashes for scikit_learn_intelex-2021.6.3-py39-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f8018beaaa278645822f77d112edd1d99f99bff1815b561a16595b5ba34398d |
|
MD5 | f217f4be3f21cb05e2dc19310fc29c75 |
|
BLAKE2b-256 | a04413d4458ad7b982d28039c89a55f59bb1e12e0f0ff63ab0cf864f5645f61c |
Hashes for scikit_learn_intelex-2021.6.3-py38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ab8895140c7919beb77c2940adc04fdf190231861a7a861e7d27b9a1fb0a897 |
|
MD5 | ec35d75186bc20944cb8a4388d29ea57 |
|
BLAKE2b-256 | 9ffc92252889eb12e9f6a1370e174aa5aa6ab55af9d7006704175f5ffab96b3e |
Hashes for scikit_learn_intelex-2021.6.3-py38-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7316b725f5c9912dae0cbc0314439d08e3c86e4084a8789ea8376c4682a9e2c |
|
MD5 | a723b398530a6ef9762e622d6f4d5b8f |
|
BLAKE2b-256 | 11a8cc364aea336cbfd8609d870d2c6c5beb6e2c722de32e83517c19433a9bd0 |
Hashes for scikit_learn_intelex-2021.6.3-py38-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93eab22bb09d7f33b48855ec89ed23ec0a1cb8674602d8e5259e5b7afe2adce4 |
|
MD5 | b83de123680244afb1349078a2474888 |
|
BLAKE2b-256 | cc5e14ec5d4ac1eca33fba33ab2fb74a78c8a344cc65c085b06011406b996266 |
Hashes for scikit_learn_intelex-2021.6.3-py37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb782872264891860f90f33264c407a5dfc16585277f538c526be5f91ae99b4d |
|
MD5 | 28451b6208f2506aa23a7c870c3cbd56 |
|
BLAKE2b-256 | c0401177eb7ea55fb86672aa24f2290a21528585c4822f42eb5b048397ace80b |
Hashes for scikit_learn_intelex-2021.6.3-py37-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fe13bd792f2b5e9056e3816acb74efb85a2de53d2215d9982d3590d2172a252 |
|
MD5 | c134376ca1e3e326193750ab5ad9c87d |
|
BLAKE2b-256 | 039494f16004ba7efb07e03cc7505c909d29a02147d36d756a4f762b1fcf653d |
Hashes for scikit_learn_intelex-2021.6.3-py37-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4820d8953c55573239bb5569e10826bb4f4db3650cbe3608ca1b1d03944532e8 |
|
MD5 | a83c062365b5b702c618c93d50cf5d53 |
|
BLAKE2b-256 | 0b41ce02af1efe3a5a1acf87ae6356b6ed85c241e07189494837e807d0c940ea |