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.1.0-py311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 389856cf07e5bcd40ce450e9ab2c32533adbf48e11b38063a72c3b356ca6c459 |
|
MD5 | a931c7cf0098ef3517bc6d420313eca5 |
|
BLAKE2b-256 | 081000891edf7825b02ed4a14b97afe452fa695cf3b135fddb435f99c399a367 |
Hashes for scikit_learn_intelex-2023.1.0-py311-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05b6fe4885a39786325bd552b4e6346604c5c21851c62c36e959d919efd3d2d8 |
|
MD5 | a1d2f1fc10a7dad6c439df72481e75fa |
|
BLAKE2b-256 | 11f921dd1229d6dc07b3aa2c479240f691356164225bfff6d66d1c5e0963fe32 |
Hashes for scikit_learn_intelex-2023.1.0-py311-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53f33597c3d37e3de5beb81d0bbcdefebbcdf64d2e9bb305ba7b6bdb1a6d5649 |
|
MD5 | 64188eb95bc5d804c6bd693dc4ed02e8 |
|
BLAKE2b-256 | 2313c36fdf4b475db52199e6abe5c8f7cd25e73d98f9d7a979a5abf3bb50a86f |
Hashes for scikit_learn_intelex-2023.1.0-py310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fea3327f01f705622e030ea7a38343bff653b0408dad4862d11bf3e9471b0c9 |
|
MD5 | 23de57207b1e8b7c89baef6a74cef38b |
|
BLAKE2b-256 | 05a65e27b7815c55d74f8d510bddab0a7faf083df87b86178bd09d3f1b2e0fb5 |
Hashes for scikit_learn_intelex-2023.1.0-py310-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13c345966bf6e13e2d07825aa85fabf393f4bbf07449acabab3eab15baf474ec |
|
MD5 | 8ea8a46b522aacb4e346a7f562da921d |
|
BLAKE2b-256 | a2ec06bc4195895157b6e4917d71a0df194324fb86b8dbee4ac237a2162e39df |
Hashes for scikit_learn_intelex-2023.1.0-py310-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9619a3f3578360c0167451c617c0248b89e2f0be05c5588292c8961b8e3c57dc |
|
MD5 | 600d424a64d8c16e2addddb9737d369a |
|
BLAKE2b-256 | 222ce645211ca2744f55ee2ba1c7b9f6bf51b429a8938d7883083d3fe713ddc4 |
Hashes for scikit_learn_intelex-2023.1.0-py39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c44121c5fe073eb941bbdc6f0b1b0d2e0b96591b6bded7621301bcb570e5fd3a |
|
MD5 | a889392aff1fc5beb588dcca80bba711 |
|
BLAKE2b-256 | a2151adb7498780db3fff4aefbb668a9b656b517702e78ed4a0126f27c82260c |
Hashes for scikit_learn_intelex-2023.1.0-py39-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96b680c90747cbe1adf9af22d073f228ca855a9f7c9c5630ebd9d4efd64ac72b |
|
MD5 | 4625bc9b02bc889113a193e6b5c76799 |
|
BLAKE2b-256 | 21443d66c25af078076ac8bbe88a74696333b942af929e0177009192a8ed1971 |
Hashes for scikit_learn_intelex-2023.1.0-py39-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9de836e1a67d23b6347ba9e6dd0437526cf8832359b17f99d8d0b88e09bdd0d |
|
MD5 | bc8f263835ec142dc68456ec901458d7 |
|
BLAKE2b-256 | bed9f52148fa085e492db653ac05c48177b375051cc68fe86228dc9baeb05aed |
Hashes for scikit_learn_intelex-2023.1.0-py38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca54b5c914c1cfcb94df74e60df9803a0d5049007965e122e82d0155704957f5 |
|
MD5 | 67eee5598cf65e1bbc48d3f7eae5fd11 |
|
BLAKE2b-256 | 627ca3d787c5202a19d47540eaa42cecf95802d477d263e78d4babab382d9291 |
Hashes for scikit_learn_intelex-2023.1.0-py38-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b22a66f8e751524df67d4fba1361d7487ad649eac0e974f439daaca94ed4879 |
|
MD5 | 73dbcfc15adc6fe301c1aaf70e8c1703 |
|
BLAKE2b-256 | f88a71c332caaf0a5fc493a170361771d63e9df79b3ef793de55be2a7a967c75 |
Hashes for scikit_learn_intelex-2023.1.0-py38-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 973ef8161d0b01681780177b627700b94f57b099a8ae9687b1adc6a3ab4d83e8 |
|
MD5 | 5bb356239526437ef0320dc0732fcf52 |
|
BLAKE2b-256 | 15791cb2f3eecb6e176cb2406b631e7bad8e376b39d9dcb2cbdd1af50349070f |
Hashes for scikit_learn_intelex-2023.1.0-py37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a81a3e21bdb16e35c787619f711219dd563b1f8693757e6c80f9138a478a7096 |
|
MD5 | 0db982025526c677e56438935ad146af |
|
BLAKE2b-256 | 48790857e6c3fbcbbeffc7e982d7cde8684b270af6f90f0f9d3fbbb93cd08972 |
Hashes for scikit_learn_intelex-2023.1.0-py37-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a76e2ddd5c05f7750f98377e9a08b8c2c7fa7c5051cb6e04f792b8a42723c72 |
|
MD5 | 91f49d53ff9be3b537ce3a99b5e521e0 |
|
BLAKE2b-256 | e917fdbe4f6baedc44c64ab2fb0849dfdf55e8b19a35940f2cae0c6ee57158e3 |
Hashes for scikit_learn_intelex-2023.1.0-py37-none-macosx_10_15_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b85c5d3928bbe1a2658820c8bee67c910d3b91d61102f5cadc6f7554f386e213 |
|
MD5 | ef38c352ce53241ae82c72b34a5708cd |
|
BLAKE2b-256 | 641bd723439f81d0c134368f2c65eaf39193615bdef6430318eee0653dbf04ac |