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.1-py310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eada6ee4ea589cb1e6e174ce758e0c559afaba006701c34ef7e395a37604e03 |
|
MD5 | 6f5c8ac952f3108de66a6026d4aa1de1 |
|
BLAKE2b-256 | 029d59563f4439750dc46e48748cc7f2d881938c003a2a67c85027925659fdc8 |
Hashes for scikit_learn_intelex-2023.0.1-py310-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05f165a94de06bc9374aa4dad762c7dc0a899335abe1789f1d4f376858a1d34f |
|
MD5 | 13548b5b22ca4571d122a63be90e6576 |
|
BLAKE2b-256 | 062c5268eb7accda6beb582c2ac96da6d8a263ca969bb79f33eb52b21b319a6f |
Hashes for scikit_learn_intelex-2023.0.1-py310-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc213e064e9a33acac8c45690aa263d7dffa5d51f55fc536c09abdce9a47c1b0 |
|
MD5 | aea65ec8c1d4551552d9fc01f3371a96 |
|
BLAKE2b-256 | cec624c2fb9262a05d35d11706c7cfc4ed7c6d877f0a469c6e8a47bb09461d72 |
Hashes for scikit_learn_intelex-2023.0.1-py39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ee16fd3b003bcccf74514824170da25e2ea94c4310ce88d68463b1acc603267 |
|
MD5 | 843f2febaeb5e721f81d81faf7023bc3 |
|
BLAKE2b-256 | f18113ddd729c4fdac87c1ad86fb4c546e60a62df72467ee4124850b6b807ee9 |
Hashes for scikit_learn_intelex-2023.0.1-py39-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2024d3e72e8a021a44b740308aef41916f7fa8d29fa09b0dbf9352539066929 |
|
MD5 | 5e7d56e4907b049264fc00412f481958 |
|
BLAKE2b-256 | ac8d5e4c4b3befc02f44b35d3c32a45ffb281b1e923195d1f44ffb37889ed08d |
Hashes for scikit_learn_intelex-2023.0.1-py39-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3a568fc84fe2bb589412f815c330b141c05073ccd1afde15c87cf37f5ad404f |
|
MD5 | 7b56a95657fa00d25719edaf6ff7c78f |
|
BLAKE2b-256 | b72abdad4923753be7552b32e5879802466c95d66656fea606af9ca3d38ff7a4 |
Hashes for scikit_learn_intelex-2023.0.1-py38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df8985ae59da2e4ad5e623fb7ffc7ae0253fb4dbd4a582f962c115abaabbc351 |
|
MD5 | d67531a5360997898a4c0007caaae67c |
|
BLAKE2b-256 | 7159c66429573ac05e750cfc6748f30f09710cfb9072aa3fa8fb5f55c15f5c44 |
Hashes for scikit_learn_intelex-2023.0.1-py38-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8468babeb86dd11c24ed88f50b514dfb22119f6ec6ec090995dabaf1562179b3 |
|
MD5 | 3ab81f15ad8e907ff52c55e74d3596f8 |
|
BLAKE2b-256 | 12915223203c99f28a765c2df457c7fa9a94e1b2e7eb7ed286f1cb92c5b36eee |
Hashes for scikit_learn_intelex-2023.0.1-py38-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bff0145d01968196071b2565601630ec2334a0dd58f6c2d407f7a2d732c0a7a4 |
|
MD5 | 1d1e6353e8c4d9fea5be5e85533f406c |
|
BLAKE2b-256 | 878714744d39fae3925b46223dcc2bcaeec5a4d97478922612c9ad77a00a23aa |
Hashes for scikit_learn_intelex-2023.0.1-py37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9388f1f26ce3b0bd23cddc2445af5c752b1ffe2f973da442edaa9fd6d8d211d2 |
|
MD5 | 9af1ca4df9a1dd95d50bfbca97a7351a |
|
BLAKE2b-256 | b157530f1396401ada8e3bc9a3afe8a8f32d0cb05011dc245687a6caed008508 |
Hashes for scikit_learn_intelex-2023.0.1-py37-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34fffec39268d89b0643d1f65bce0e89102b43dc51f0574f82509c01e8b194b0 |
|
MD5 | ce21a9986a8cbcf9d183e53d7fdc411f |
|
BLAKE2b-256 | 223a1c15833e77743f75760202a5a8e081729bacbab2b35a2fed7f759e653161 |
Hashes for scikit_learn_intelex-2023.0.1-py37-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc0e67af2242a8f169669a9f3f24f0349dfe3acaefeaabb6953c3ac98276fd33 |
|
MD5 | f8388ad89850a8860d2eca2a3a1edf58 |
|
BLAKE2b-256 | c3abd6876bd235030265c75b42fa37ab1af203bd45f8326dcbdd1747d42f5746 |