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.7.0-py310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97029e57add42e1740351dba38919d6a022d48327158ac2b4f1a3068f01bb5fe |
|
MD5 | 1a091cb5e384ded9fa6e52913d7f6c8e |
|
BLAKE2b-256 | 7681799d91481c39f62021cf7756c356b0a899f425c7ed9f52b8f34261654213 |
Hashes for scikit_learn_intelex-2021.7.0-py310-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d31f719e96d525ebf93b93dec792f190bcfddf64011f70a9d1b030610177583 |
|
MD5 | 8057ba19c642586d27c9b36e14929ae6 |
|
BLAKE2b-256 | d9c6af80a42ac7d29ac7e066caf55a4fd8b00f95858a1a6d9c443b2c674a77a9 |
Hashes for scikit_learn_intelex-2021.7.0-py310-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66efb997ff4d890092d5825c924d5168a9a3267a04ff90e3529cad3340653103 |
|
MD5 | 56d64f02cccc2cb14cbde8d8e0242015 |
|
BLAKE2b-256 | b62b151b13361e48868d31c40e5bfbf3a64cea15c94ff96c9ec2ad283cbcc48b |
Hashes for scikit_learn_intelex-2021.7.0-py39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02cd2990f634dce03e6180c301851410d172527868500bb8012ee37fa6a83867 |
|
MD5 | 51de5b0d72a4300fac5c4489f94da161 |
|
BLAKE2b-256 | 1dceaa4f88b4929bb39f5ed40fba83760966ef0aeda81ab9a590523bfc7abc09 |
Hashes for scikit_learn_intelex-2021.7.0-py39-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d33ec38618288ea7a69b5a927943ee805da077965677d8d207bda0a0c2735218 |
|
MD5 | ab4fa61ac45dac804c61631781119a06 |
|
BLAKE2b-256 | a27eb9d8b5d18b8d92c1e4e17e93afebdb151ea15300dd1cff2376b0825efe2f |
Hashes for scikit_learn_intelex-2021.7.0-py39-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 772e1e8bd6f528a0d0d356329967c6b2fda923791f5d9b680520ee99d41379d2 |
|
MD5 | dfd05b6465f943659eea46c54375b1d1 |
|
BLAKE2b-256 | 46c3f7b387d5f2b2fe8577d7d08ca9252979adb73dc26047fbd7e454087bb600 |
Hashes for scikit_learn_intelex-2021.7.0-py38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 433cc07ccc65fab28074f21939dd03953a3a4fab376c301794a579b367615116 |
|
MD5 | bf955a5d121e5216d823d210c9e95e3f |
|
BLAKE2b-256 | 3633f6e886ee860c489a4a5873e14322ceb8ef5223729daf8cd8f6f114dd4e98 |
Hashes for scikit_learn_intelex-2021.7.0-py38-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1641fe733b81d97c3163eb760ff141ee41e9a7595aa0cc7e9bc60b60fc1d5f76 |
|
MD5 | 390f5e5ebfee15593d92135f96e26b98 |
|
BLAKE2b-256 | e173fea520d83a9387ca845417561932a5a78ecd2f354dae3d8d856d3b2cdcf5 |
Hashes for scikit_learn_intelex-2021.7.0-py38-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f5dca28f7c94e51832d164a19ec717d1d8695dbf06fb7cfb0d133d8fb832f38 |
|
MD5 | 28602a67001ba2de7c1e7db58f6cb421 |
|
BLAKE2b-256 | a5e89ac2c932f77c4abe08b9e1bba5ce2249f91e21a064952cc83a9db2ad85b1 |
Hashes for scikit_learn_intelex-2021.7.0-py37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b671d9fa5ddcc35afb34f19a90255daaa32586f233f05189017481489676957 |
|
MD5 | 287fff961012a06c00f0cfc6bc81f52f |
|
BLAKE2b-256 | e7f4ce96147ffda058efb4afdf4c4f989a677670d2042f1fe8a8f8ada8d2c681 |
Hashes for scikit_learn_intelex-2021.7.0-py37-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a7a6fbe5ee535fa26d555a7a0e4c71e2cb7523b265c3e6cc22601799c3beb56 |
|
MD5 | 6c4de3cde01984c074a80ecd4b94b39b |
|
BLAKE2b-256 | 7e4e7bb189e788535518bd1128d78f7440b731a917dc3334c3c12b1a335b0df4 |
Hashes for scikit_learn_intelex-2021.7.0-py37-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e30867b69154dc0a8a36cce4a9b1fe91b4baf10c9ece7d2e31258f3a4989da0e |
|
MD5 | eecc31c9715c741a3ac2c125dcc375d0 |
|
BLAKE2b-256 | 4cb3cffbce5f05d42832ccb8dffbb97fa22ed0699f211537fdc5a1d6cb7ba48f |