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.1-py310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d40dce4a6575c179cf49508a16a55b9bcf55f641bf8aa1e33fafe9546889ef7 |
|
MD5 | a9b561ac3524fb1675105dd5ede9d40b |
|
BLAKE2b-256 | d7bcc36adedd5b03177ab70e58049d2883996bf42ed1f35561fe6b5234fe7a41 |
Hashes for scikit_learn_intelex-2021.7.1-py310-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03d22caeb8b3784120f4a99f12bd37674c62b3a6a6f7ff5b5ebbac7afabb71d1 |
|
MD5 | 44d834c3f3536d8c25d241649bc4572b |
|
BLAKE2b-256 | a444c900808eff55e74a7c331fb1435c5b9f15d678fd6dee53331e2432fa4663 |
Hashes for scikit_learn_intelex-2021.7.1-py310-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 617e85a94f7533c3417ca286b29fb38fd6edc88f6484506899260d96fedbc4d7 |
|
MD5 | e13b189a924ba5fff8a4f2a953be1ed9 |
|
BLAKE2b-256 | 99cfef8a5463d4b579ad2871396477bb58f49a7a832c37fbfb32a5db6f0572c7 |
Hashes for scikit_learn_intelex-2021.7.1-py39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4725516c650e621a98af778e0b90f81ea6aa37ea36305eda2929b048fb94ac48 |
|
MD5 | 4eba2e7de4817d741ae84471b7050c4f |
|
BLAKE2b-256 | f9896ff42cb448173fd7c061d46e199f73eedbca3b626f3258bdbb21c28ca16c |
Hashes for scikit_learn_intelex-2021.7.1-py39-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28d7fc3680315e68bc07d416ae0768c9f37290ac70aa7e286c22f5b7fd29432a |
|
MD5 | 1601c7f6fd925931e7c1efc265ed3f38 |
|
BLAKE2b-256 | 15644605ebc97edf31261c2f3100473172eb392347271bc0a4172e039053a684 |
Hashes for scikit_learn_intelex-2021.7.1-py39-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0db9db978a69efdc9cb7b28b61175c5a18517eab60769fd0a4e2622ffc0f004b |
|
MD5 | 374fee4b031ba264ab4df065d68160b5 |
|
BLAKE2b-256 | 320d5c4f47526353812ee430d1a654c386761344cd5c0b697bf54b89134eb093 |
Hashes for scikit_learn_intelex-2021.7.1-py38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70a94792810c9566b689ab787441a74c59903d155d3687e92a7007e77c0029de |
|
MD5 | 2d4d818de07719445287d87d8d363289 |
|
BLAKE2b-256 | 7975e0611ff39ab19974d7d10dbae00404e6038fee99b0acfce4fbe392b827db |
Hashes for scikit_learn_intelex-2021.7.1-py38-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8360fd72d389dbb2110625ff73c3755a9cfdfc979fba4f02cc8fa982f816ea1 |
|
MD5 | 4108122818d7ffc2324396d69bf993c9 |
|
BLAKE2b-256 | 300229a31e31021dd5e3c303d0665f4951b28e1fc9f284eb69b42a4c5a9a534e |
Hashes for scikit_learn_intelex-2021.7.1-py38-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1608d456067b1463bd2ac575f54706f967faeb0857ec294ea449b949b6392ba |
|
MD5 | a9cc6deea281b375f54126ffd19fdd49 |
|
BLAKE2b-256 | d5c654884354cf9a75e22d3e9a091e8d50f4c20aea81616c6ef53ccabda95190 |
Hashes for scikit_learn_intelex-2021.7.1-py37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 930add38255c8192cc8e0863b0896f51c269441c66d01161862581e2a6198054 |
|
MD5 | 9a367fca885bc2193a248a20422fcd5e |
|
BLAKE2b-256 | 62f9f4b41ba1e6e051ea2b5bc23fff93b0009d6188e82df070ee76a67d0fbe8c |
Hashes for scikit_learn_intelex-2021.7.1-py37-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14d522d37d94f50a2101a3eb4891cc0e75d0fbfdb6a1dbc620c0fe005a33b155 |
|
MD5 | 1b18810d3cbb0feffb16c2502b8b1029 |
|
BLAKE2b-256 | fb37fe6d8aa4351d1c61b917fc094367c23934a062632a50c3b440c5856d16e6 |
Hashes for scikit_learn_intelex-2021.7.1-py37-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a520c2f0e0bc105ce22fde0dee762b68c57f749f412896a08df57b5cb704431 |
|
MD5 | fbc964914318419c5e5a62b337caac81 |
|
BLAKE2b-256 | 17a404ab68afbbf24cfa96529ef63dc475a60c32a65ac4316b9325351cb90b5f |