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.0.0-py310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a5f9bbcb8d9a09a778a7a45ba63c790bf00aeb6309e21f0f45beacc919fe5ba |
|
MD5 | 5b7756000d9e70afcfadd28e9525c283 |
|
BLAKE2b-256 | 5cd97ef04758c2c128504959d89716ed8b8ff213990410226d9770958540d86d |
Hashes for scikit_learn_intelex-2023.0.0-py310-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2953f9dd37c725620050800452fd2e757db34bcf46c7606139cc7bb163d61afa |
|
MD5 | 5b42d5dd6ff16060055570a3a6a29fd7 |
|
BLAKE2b-256 | e8267f09a0774c0d77b9ff0eb53e48cfc3e8a86f21bde0b3d19555d4aed2606b |
Hashes for scikit_learn_intelex-2023.0.0-py310-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0509fab0793c3c1dfec0ff9fe83b423064ef440df9f224920d0879e72c458b3 |
|
MD5 | 919365371c008cc737a3429146440c61 |
|
BLAKE2b-256 | 20cd3358ef308bc45bb56dd53e0add1d7e82dbe6316605fba8917f10ffff2327 |
Hashes for scikit_learn_intelex-2023.0.0-py39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5288821e6890d81c164be887123d5044303381bae9c7e33411503a40b80f10a |
|
MD5 | 38089be56333279d59a7e2a7c00cd4f1 |
|
BLAKE2b-256 | ac7aacd0cc63b76594c6f3d72fab088c524b426e8349fb011a2ab394114c3f35 |
Hashes for scikit_learn_intelex-2023.0.0-py39-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad7a78774ea678d66020787cf554cb1c03abef6b608ae9ebc19c670f92345c25 |
|
MD5 | 876609c6989c146b62eb6c56a74d0a34 |
|
BLAKE2b-256 | 26fd0168f6cb21fbd6030aafd3275f6d8d6ad39ea652d1c5fdac05db34bd4e15 |
Hashes for scikit_learn_intelex-2023.0.0-py39-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37365c6a42f03f45f66ee3eebfa6f1a4f9aa026277f158db04119de2027a92a4 |
|
MD5 | a7efab4d9125b819af2c8edc41f74dd7 |
|
BLAKE2b-256 | c84883e93d34a9a7dbfa8837ad052a5f31b1f2d04296c1405462215d8d43d0c7 |
Hashes for scikit_learn_intelex-2023.0.0-py38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b61dae93fbe0194923812bd8e1162d6a6b1b39bcfd609464257967c13d390b6 |
|
MD5 | ac4825df5adf54cfbc4b1b6c25fa9502 |
|
BLAKE2b-256 | 079591a6469d3a4e05b8a70c6adcaf639d8f486dc9ed340c3e46e485ee01d49d |
Hashes for scikit_learn_intelex-2023.0.0-py38-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd2128031c61ffdb32a06d38273727d9625b90d510f5c9f79e47ec8ed95bb374 |
|
MD5 | ea187086abb4d58146a629a6db030162 |
|
BLAKE2b-256 | e908d64569bfe5d7c0e9eaadfda9e08e61a71961b676e2377a707add341c4917 |
Hashes for scikit_learn_intelex-2023.0.0-py38-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a849a02a7f1ba85d24cea321726cabacde9ae507072b375a983885775fc5258b |
|
MD5 | 543b4d5005f439287025c97db80e4dab |
|
BLAKE2b-256 | 3476e8a6a753d6c718b6badcb02fa2df245dd87ffa7226be165fb4e749620052 |
Hashes for scikit_learn_intelex-2023.0.0-py37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81db79d1e58eb0d0497038b26b9da0b528b689fdf395f33033fbbafd04408689 |
|
MD5 | 908f1fc2336e067d29498ea6078e54b0 |
|
BLAKE2b-256 | 3df41faad709dac051bb6d8e29ececc9a57e5b06c9db630213f248372a170b1b |
Hashes for scikit_learn_intelex-2023.0.0-py37-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92249f478bca8ae6a1e18d6c8646c57eb385a116355966819aa8893c19ebafd6 |
|
MD5 | 2c4a6d020d707ffb8fa2afe1be1a5227 |
|
BLAKE2b-256 | b740b48599f83be489a67976258e9924718bd385f325d760a353ddb817f678cc |
Hashes for scikit_learn_intelex-2023.0.0-py37-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 537a4fe40c69a8b977c8ba87778b2ea9fc50b4772dfdb165669486674632c072 |
|
MD5 | c3f63bc1c3b092c97e91635627c63355 |
|
BLAKE2b-256 | 54d725887c14686bc9d358d421b5b64065e8f68aa028320170508bbfa286ff65 |