In [1]:
from sklearn_benchmarks.reporting.hp_match import HpMatchReporting
from sklearn_benchmarks.utils import default_results_directory
from pathlib import Path
import pandas as pd
pd.set_option('display.max_colwidth', None)
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)

scikit-learn-intelex (Intel® oneAPI) vs. scikit-learn¶

In [2]:
results_dir = default_results_directory()
In [3]:
# Parameters
results_dir = "./results/local/20220314T000704/"
In [4]:
results_dir = Path(results_dir)
In [5]:
reporting = HpMatchReporting(other_library="sklearnex", config="config.yml", log_scale=True, results_dir=results_dir)
reporting.make_report()

We assume here there is a perfect match between the hyperparameters of both librairies. For a given set of parameters and a given dataset, we compute the speed-up time scikit-learn / time sklearnex. For instance, a speed-up of 2 means that sklearnex is twice as fast as scikit-learn for a given set of parameters and a given dataset.

¶

scikit-learn-intelex (2021.20220207.123530) vs. scikit-learn (1.0.2)

Speedup barplots ¶

All estimators share the following parameters: algorithm=brute.

Raw results ¶

fit

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency n_jobs n_neighbors mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
0 fit 100000 100000 100 1.288 0.014 0.062 0.0 -1 1 0.046 0.006 27.987 28.245 Download Download
3 fit 100000 100000 100 1.258 0.013 0.064 0.0 -1 5 0.044 0.000 28.452 28.453 Download Download
6 fit 100000 100000 100 1.253 0.009 0.064 0.0 1 100 0.044 0.000 28.227 28.227 Download Download
9 fit 100000 100000 100 1.255 0.011 0.064 0.0 -1 100 0.044 0.000 28.469 28.471 Download Download
12 fit 100000 100000 100 1.256 0.014 0.064 0.0 1 5 0.044 0.000 28.433 28.434 Download Download
15 fit 100000 100000 100 1.256 0.028 0.064 0.0 1 1 0.044 0.000 28.610 28.611 Download Download
18 fit 100000 100000 2 0.048 0.001 0.033 0.0 -1 1 0.009 0.000 5.679 5.680 Download Download
21 fit 100000 100000 2 0.048 0.000 0.034 0.0 -1 5 0.009 0.000 5.583 5.584 Download Download
24 fit 100000 100000 2 0.048 0.000 0.034 0.0 1 100 0.009 0.000 5.587 5.588 Download Download
27 fit 100000 100000 2 0.048 0.001 0.033 0.0 -1 100 0.009 0.000 5.636 5.637 Download Download
30 fit 100000 100000 2 0.048 0.000 0.033 0.0 1 5 0.009 0.000 5.599 5.600 Download Download
33 fit 100000 100000 2 0.048 0.000 0.033 0.0 1 1 0.009 0.000 5.598 5.598 Download Download

predict

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency n_jobs n_neighbors mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
1 predict 100000 1000 100 2.244 0.228 0.000 0.002 -1 1 0.171 0.004 13.112 13.116 Download Download
2 predict 100000 1 100 0.021 0.002 0.000 0.021 -1 1 0.008 0.000 2.682 2.683 Download Download
4 predict 100000 1000 100 2.865 0.089 0.000 0.003 -1 5 0.172 0.001 16.658 16.658 Download Download
5 predict 100000 1 100 0.021 0.002 0.000 0.021 -1 5 0.008 0.000 2.765 2.765 Download Download
7 predict 100000 1000 100 1.861 0.003 0.000 0.002 1 100 0.211 0.003 8.814 8.815 Download Download
8 predict 100000 1 100 0.018 0.000 0.000 0.018 1 100 0.008 0.000 2.326 2.327 Download Download
10 predict 100000 1000 100 2.621 0.048 0.000 0.003 -1 100 0.210 0.001 12.471 12.472 Download Download
11 predict 100000 1 100 0.021 0.002 0.000 0.021 -1 100 0.008 0.000 2.695 2.696 Download Download
13 predict 100000 1000 100 1.843 0.007 0.000 0.002 1 5 0.173 0.002 10.674 10.675 Download Download
14 predict 100000 1 100 0.018 0.000 0.000 0.018 1 5 0.008 0.000 2.441 2.441 Download Download
16 predict 100000 1000 100 1.140 0.004 0.001 0.001 1 1 0.170 0.002 6.690 6.690 Download Download
17 predict 100000 1 100 0.020 0.004 0.000 0.020 1 1 0.008 0.000 2.615 2.616 Download Download
19 predict 100000 1000 2 1.691 0.030 0.000 0.002 -1 1 0.026 0.000 63.901 63.908 Download Download
20 predict 100000 1 2 0.005 0.004 0.000 0.005 -1 1 0.001 0.000 7.424 7.464 Download Download
22 predict 100000 1000 2 2.447 0.024 0.000 0.002 -1 5 0.028 0.000 88.900 88.904 Download Download
23 predict 100000 1 2 0.006 0.004 0.000 0.006 -1 5 0.001 0.000 7.867 7.937 Download Download
25 predict 100000 1000 2 1.799 0.002 0.000 0.002 1 100 0.063 0.001 28.658 28.661 Download Download
26 predict 100000 1 2 0.003 0.000 0.000 0.003 1 100 0.001 0.000 3.308 3.321 Download Download
28 predict 100000 1000 2 2.465 0.021 0.000 0.002 -1 100 0.062 0.000 39.653 39.654 Download Download
29 predict 100000 1 2 0.009 0.005 0.000 0.009 -1 100 0.001 0.000 10.433 10.482 Download Download
31 predict 100000 1000 2 1.788 0.003 0.000 0.002 1 5 0.028 0.000 64.990 64.991 Download Download
32 predict 100000 1 2 0.003 0.000 0.000 0.003 1 5 0.001 0.000 3.507 3.524 Download Download
34 predict 100000 1000 2 1.029 0.002 0.000 0.001 1 1 0.027 0.000 38.439 38.442 Download Download
35 predict 100000 1 2 0.002 0.000 0.000 0.002 1 1 0.001 0.000 2.377 2.389 Download Download

¶

scikit-learn-intelex (2021.20220207.123530) vs. scikit-learn (1.0.2)

Speedup barplots ¶

All estimators share the following parameters: algorithm=kd_tree.

Raw results ¶

fit

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency n_jobs n_neighbors mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
0 fit 1000000 1000000 10 2.654 0.035 0.030 0.0 -1 1 0.687 0.003 3.865 3.865 Download Download
3 fit 1000000 1000000 10 2.650 0.037 0.030 0.0 -1 5 0.700 0.018 3.788 3.789 Download Download
6 fit 1000000 1000000 10 2.671 0.045 0.030 0.0 1 100 0.696 0.009 3.839 3.839 Download Download
9 fit 1000000 1000000 10 2.662 0.043 0.030 0.0 -1 100 0.696 0.008 3.822 3.822 Download Download
12 fit 1000000 1000000 10 2.644 0.033 0.030 0.0 1 5 0.695 0.016 3.806 3.807 Download Download
15 fit 1000000 1000000 10 2.639 0.032 0.030 0.0 1 1 0.693 0.011 3.806 3.807 Download Download
18 fit 1000 1000 2 0.001 0.000 0.031 0.0 -1 1 0.001 0.000 0.583 0.584 Download Download
21 fit 1000 1000 2 0.001 0.000 0.031 0.0 -1 5 0.001 0.000 0.566 0.568 Download Download
24 fit 1000 1000 2 0.001 0.000 0.031 0.0 1 100 0.001 0.000 0.608 0.609 Download Download
27 fit 1000 1000 2 0.001 0.000 0.031 0.0 -1 100 0.001 0.000 0.609 0.609 Download Download
30 fit 1000 1000 2 0.001 0.000 0.031 0.0 1 5 0.001 0.000 0.580 0.580 Download Download
33 fit 1000 1000 2 0.001 0.000 0.032 0.0 1 1 0.001 0.000 0.554 0.554 Download Download

predict

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency n_jobs n_neighbors mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
1 predict 1000000 1000 10 0.375 0.003 0.000 0.000 -1 1 0.096 0.001 3.897 3.897 Download Download
2 predict 1000000 1 10 0.002 0.000 0.000 0.002 -1 1 0.000 0.000 9.477 9.860 Download Download
4 predict 1000000 1000 10 0.691 0.010 0.000 0.001 -1 5 0.172 0.002 4.027 4.027 Download Download
5 predict 1000000 1 10 0.003 0.001 0.000 0.003 -1 5 0.000 0.000 9.747 10.098 Download Download
7 predict 1000000 1000 10 4.187 0.020 0.000 0.004 1 100 0.520 0.006 8.058 8.059 Download Download
8 predict 1000000 1 10 0.002 0.001 0.000 0.002 1 100 0.001 0.000 4.362 4.552 Download Download
10 predict 1000000 1000 10 2.250 0.016 0.000 0.002 -1 100 0.518 0.013 4.346 4.347 Download Download
11 predict 1000000 1 10 0.004 0.001 0.000 0.004 -1 100 0.001 0.000 7.176 7.384 Download Download
13 predict 1000000 1000 10 1.264 0.017 0.000 0.001 1 5 0.171 0.001 7.375 7.376 Download Download
14 predict 1000000 1 10 0.001 0.000 0.000 0.001 1 5 0.000 0.000 4.079 4.243 Download Download
16 predict 1000000 1000 10 0.666 0.009 0.000 0.001 1 1 0.097 0.002 6.854 6.855 Download Download
17 predict 1000000 1 10 0.001 0.000 0.000 0.001 1 1 0.000 0.000 3.647 3.849 Download Download
19 predict 1000 1000 2 0.022 0.001 0.001 0.000 -1 1 0.001 0.000 35.542 35.780 Download Download
20 predict 1000 1 2 0.002 0.000 0.000 0.002 -1 1 0.000 0.000 16.646 17.063 Download Download
22 predict 1000 1000 2 0.023 0.000 0.001 0.000 -1 5 0.001 0.000 33.227 33.273 Download Download
23 predict 1000 1 2 0.002 0.000 0.000 0.002 -1 5 0.000 0.000 16.603 17.012 Download Download
25 predict 1000 1000 2 0.034 0.000 0.000 0.000 1 100 0.005 0.000 7.551 7.551 Download Download
26 predict 1000 1 2 0.001 0.000 0.000 0.001 1 100 0.000 0.000 4.254 4.346 Download Download
28 predict 1000 1000 2 0.034 0.000 0.000 0.000 -1 100 0.005 0.000 7.508 7.508 Download Download
29 predict 1000 1 2 0.002 0.000 0.000 0.002 -1 100 0.000 0.000 15.092 15.635 Download Download
31 predict 1000 1000 2 0.021 0.000 0.001 0.000 1 5 0.001 0.000 31.307 31.358 Download Download
32 predict 1000 1 2 0.001 0.000 0.000 0.001 1 5 0.000 0.000 4.224 4.368 Download Download
34 predict 1000 1000 2 0.020 0.000 0.001 0.000 1 1 0.000 0.000 45.202 45.447 Download Download
35 predict 1000 1 2 0.001 0.000 0.000 0.001 1 1 0.000 0.000 4.287 4.444 Download Download

¶

scikit-learn-intelex (2021.20220207.123530) vs. scikit-learn (1.0.2)

Speedup barplots ¶

All estimators share the following parameters: algorithm=full, n_clusters=3, max_iter=30, n_init=1, tol=1e-16.

Raw results ¶

fit

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency n_iter init mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
0 fit 1000000 1000000 2 0.471 0.006 0.034 0.0 30 random 0.384 0.020 1.226 1.228 Download Download
3 fit 1000000 1000000 2 0.539 0.013 0.030 0.0 30 k-means++ 0.405 0.017 1.332 1.333 Download Download
6 fit 1000000 1000000 100 4.607 0.376 0.174 0.0 30 random 2.443 0.010 1.886 1.886 Download Download
9 fit 1000000 1000000 100 4.547 0.025 0.176 0.0 30 k-means++ 2.601 0.006 1.748 1.748 Download Download

predict

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency n_iter init mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
1 predict 1000000 1000 2 0.0 0.0 0.073 0.0 30 random 0.0 0.0 1.124 1.205 Download Download
2 predict 1000000 1 2 0.0 0.0 0.000 0.0 30 random 0.0 0.0 1.316 1.361 Download Download
4 predict 1000000 1000 2 0.0 0.0 0.074 0.0 30 k-means++ 0.0 0.0 1.120 1.213 Download Download
5 predict 1000000 1 2 0.0 0.0 0.000 0.0 30 k-means++ 0.0 0.0 1.337 1.376 Download Download
7 predict 1000000 1000 100 0.0 0.0 1.999 0.0 30 random 0.0 0.0 1.373 1.454 Download Download
8 predict 1000000 1 100 0.0 0.0 0.005 0.0 30 random 0.0 0.0 1.298 1.353 Download Download
10 predict 1000000 1000 100 0.0 0.0 1.975 0.0 30 k-means++ 0.0 0.0 1.478 1.579 Download Download
11 predict 1000000 1 100 0.0 0.0 0.005 0.0 30 k-means++ 0.0 0.0 1.250 1.289 Download Download

¶

scikit-learn-intelex (2021.20220207.123530) vs. scikit-learn (1.0.2)

Speedup barplots ¶

All estimators share the following parameters: algorithm=full, n_clusters=300, max_iter=20, n_init=1, tol=1e-16.

Mismatches between validation scores¶

WARNING! Mismatch between validation scores for 2 predictions (25.0%).
The observed differences can be found in the diff_adjusted_rand_scores column.
The chosen difference threshold is 0.01 for adjusted_rand_score.
The biggest difference is 0.033 for adjusted_rand_score.
See details in the dataframe below.
estimator library diff_adjusted_rand_scores function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency n_iter algorithm init max_iter n_clusters n_init tol adjusted_rand_score_sklearn mean_duration_sklearnex std_duration_sklearnex adjusted_rand_score_sklearnex speedup std_speedup
7 sklearn_KMeans_short sklearn 0.032069 predict 10000 1000 100 0.001237 0.000138 0.646465 0.000001 20 full random 20 300 1 1.000000e-16 0.293414 0.001080 0.000102 0.325483 1.145791 1.150860
10 sklearn_KMeans_short sklearn 0.032656 predict 10000 1000 100 0.001991 0.001764 0.401870 0.000002 20 full k-means++ 20 300 1 1.000000e-16 0.283247 0.001059 0.000088 0.315903 1.879897 1.886312

Raw results ¶

fit

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency n_iter init mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
0 fit 10000 10000 2 0.081 0.002 0.002 0.0 20 random 0.033 0.001 2.429 2.430 Download Download
3 fit 10000 10000 2 0.199 0.002 0.001 0.0 20 k-means++ 0.091 0.003 2.189 2.190 Download Download
6 fit 10000 10000 100 0.197 0.003 0.041 0.0 20 random 0.131 0.003 1.505 1.505 Download Download
9 fit 10000 10000 100 0.554 0.004 0.014 0.0 20 k-means++ 0.314 0.005 1.762 1.762 Download Download

predict

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency n_iter init mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
1 predict 10000 1000 2 0.001 0.000 0.026 0.0 20 random 0.001 0.0 1.040 1.042 Download Download
2 predict 10000 1 2 0.000 0.000 0.000 0.0 20 random 0.000 0.0 1.249 1.286 Download Download
4 predict 10000 1000 2 0.001 0.000 0.026 0.0 20 k-means++ 0.001 0.0 1.000 1.005 Download Download
5 predict 10000 1 2 0.000 0.000 0.000 0.0 20 k-means++ 0.000 0.0 1.267 1.305 Download Download
7 predict 10000 1000 100 0.001 0.000 0.646 0.0 20 random 0.001 0.0 1.146 1.151 Download Download
8 predict 10000 1 100 0.000 0.000 0.004 0.0 20 random 0.000 0.0 1.209 1.232 Download Download
10 predict 10000 1000 100 0.002 0.002 0.402 0.0 20 k-means++ 0.001 0.0 1.880 1.886 Download Download
11 predict 10000 1 100 0.000 0.000 0.004 0.0 20 k-means++ 0.000 0.0 1.273 1.287 Download Download

¶

scikit-learn-intelex (2021.20220207.123530) vs. scikit-learn (1.0.2)

Speedup barplots ¶

All estimators share the following parameters: penalty=l2, dual=False, tol=0.0001, C=1.0, fit_intercept=True, intercept_scaling=1.0, class_weight=nan, random_state=nan, solver=lbfgs, max_iter=100, multi_class=auto, verbose=0, warm_start=False, n_jobs=nan, l1_ratio=nan.

Raw results ¶

fit

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency n_iter mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
0 fit 1000000 1000000 100 10.009 0.147 0.080 0.000 [20] 1.72 0.015 5.818 5.818 Download Download
3 fit 1000 1000 10000 0.721 0.034 0.111 0.001 [27] 0.70 0.029 1.029 1.030 Download Download

predict

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency n_iter mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
1 predict 1000000 1000 100 0.000 0.0 2.915 0.0 [20] 0.001 0.001 0.450 0.773 Download Download
2 predict 1000000 1 100 0.000 0.0 0.013 0.0 [20] 0.000 0.000 0.336 0.339 Download Download
4 predict 1000 100 10000 0.002 0.0 5.239 0.0 [27] 0.005 0.001 0.323 0.327 Download Download
5 predict 1000 1 10000 0.000 0.0 0.967 0.0 [27] 0.001 0.000 0.056 0.057 Download Download

¶

scikit-learn-intelex (2021.20220207.123530) vs. scikit-learn (1.0.2)

Speedup barplots ¶

All estimators share the following parameters:

Raw results ¶

fit

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency copy_X fit_intercept normalize positive mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
0 fit 1000 1000 10000 1.237 0.004 0.065 0.001 True True deprecated False 1.403 0.011 0.882 0.882 Download Download
3 fit 1000000 1000000 100 7.599 0.537 0.105 0.000 True True deprecated False 0.185 0.003 41.183 41.187 Download Download

predict

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency copy_X fit_intercept normalize positive mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
1 predict 1000 1000 10000 0.01 0.0 8.306 0.0 True True deprecated False 0.016 0.0 0.584 0.584 Download Download
2 predict 1000 10 10000 0.00 0.0 6.286 0.0 True True deprecated False 0.000 0.0 0.430 0.440 Download Download
4 predict 1000000 1000 100 0.00 0.0 5.751 0.0 True True deprecated False 0.000 0.0 0.310 0.343 Download Download
5 predict 1000000 10 100 0.00 0.0 0.137 0.0 True True deprecated False 0.000 0.0 0.396 0.403 Download Download

¶

scikit-learn-intelex (2021.20220207.123530) vs. scikit-learn (1.0.2)

Speedup barplots ¶

All estimators share the following parameters: alpha=1e-06.

Raw results ¶

fit

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
0 fit 1000 1000 10000 0.164 0.001 0.487 0.0 0.169 0.001 0.973 0.974 Download Download
3 fit 1000000 1000000 100 1.005 0.007 0.796 0.0 0.214 0.001 4.703 4.703 Download Download

predict

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
1 predict 1000 1000 10000 0.01 0.0 8.110 0.0 0.016 0.0 0.602 0.602 Download Download
2 predict 1000 10 10000 0.00 0.0 5.913 0.0 0.000 0.0 0.331 0.499 Download Download
4 predict 1000000 1000 100 0.00 0.0 6.127 0.0 0.000 0.0 0.454 0.476 Download Download
5 predict 1000000 10 100 0.00 0.0 0.131 0.0 0.000 0.0 0.415 0.424 Download Download

¶

scikit-learn-intelex (2021.20220207.123530) vs. scikit-learn (1.0.2)

Speedup barplots ¶

All estimators share the following parameters:

Raw results ¶

fit

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency n_iter angle early_exaggeration init learning_rate method metric min_grad_norm n_components n_iter_without_progress perplexity square_distances verbose mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
0 fit 1000 1000 3 3.427 0.172 0.0 0.003 1000 0.5 12.0 warn warn barnes_hut euclidean 0.0 2 300 30.0 legacy 0 3.504 0.321 0.978 0.982 Download Download

¶

scikit-learn-intelex (2021.20220207.123530) vs. scikit-learn (1.0.2)

Speedup barplots ¶

All estimators share the following parameters: n_components=10.

Raw results ¶

fit

function n_samples_train n_samples n_features mean_duration_sklearn std_duration_sklearn iteration_throughput latency mean_duration_sklearnex std_duration_sklearnex speedup std_speedup sklearn_profiling sklearnex_profiling
0 fit 100000 100000 100 0.421 0.010 0.190 0.0 0.027 0.004 15.771 15.944 Download Download
1 fit 10000 10000 1000 0.368 0.002 0.217 0.0 0.181 0.003 2.032 2.033 Download Download

Benchmark environment information¶

System¶

python 3.8.12 | packaged by conda-forge | (default, Jan 30 2022, 23:42:07) [GCC 9.4.0]
executable /usr/share/miniconda/envs/sklbench/bin/python
machine Linux-5.11.0-1028-azure-x86_64-with-glibc2.10

Dependencies¶

version
pip 22.0.4
setuptools 60.9.3
sklearn 1.0.2
numpy 1.22.3
scipy 1.8.0
Cython None
pandas 1.4.1
matplotlib 3.5.1
joblib 1.1.0
threadpoolctl 3.1.0

Threadpool¶

user_api internal_api prefix filepath version threading_layer architecture num_threads
0 blas openblas libopenblas /usr/share/miniconda/envs/sklbench/lib/libopenblasp-r0.3.18.so 0.3.18 pthreads SkylakeX 2
1 openmp openmp libgomp /usr/share/miniconda/envs/sklbench/lib/libgomp.so.1.0.0 None NaN NaN 2

CPU count¶

cpu_count 2
physical_cpu_count 2