scikit-learn-intelex 2024.5.0__py39-none-manylinux1_x86_64.whl → 2024.7.0__py39-none-manylinux1_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of scikit-learn-intelex might be problematic. Click here for more details.

Files changed (73) hide show
  1. {scikit_learn_intelex-2024.5.0.dist-info → scikit_learn_intelex-2024.7.0.dist-info}/METADATA +2 -2
  2. scikit_learn_intelex-2024.7.0.dist-info/RECORD +122 -0
  3. sklearnex/_config.py +3 -15
  4. sklearnex/_device_offload.py +9 -168
  5. sklearnex/basic_statistics/basic_statistics.py +127 -1
  6. sklearnex/basic_statistics/tests/test_basic_statistics.py +251 -0
  7. sklearnex/basic_statistics/tests/test_incremental_basic_statistics.py +1 -1
  8. sklearnex/cluster/dbscan.py +3 -1
  9. sklearnex/cluster/k_means.py +8 -0
  10. sklearnex/cluster/tests/test_dbscan.py +8 -6
  11. sklearnex/cluster/tests/test_kmeans.py +15 -3
  12. sklearnex/conftest.py +11 -1
  13. sklearnex/covariance/incremental_covariance.py +64 -13
  14. sklearnex/covariance/tests/test_incremental_covariance.py +35 -0
  15. sklearnex/decomposition/pca.py +25 -1
  16. sklearnex/decomposition/tests/test_pca.py +4 -2
  17. sklearnex/dispatcher.py +109 -1
  18. sklearnex/ensemble/_forest.py +121 -57
  19. sklearnex/ensemble/tests/test_forest.py +7 -0
  20. sklearnex/glob/dispatcher.py +16 -2
  21. sklearnex/linear_model/coordinate_descent.py +13 -0
  22. sklearnex/linear_model/incremental_linear.py +102 -25
  23. sklearnex/linear_model/linear.py +25 -39
  24. sklearnex/linear_model/logistic_regression.py +92 -74
  25. sklearnex/linear_model/ridge.py +7 -0
  26. sklearnex/linear_model/tests/test_incremental_linear.py +10 -10
  27. sklearnex/linear_model/tests/test_linear.py +30 -5
  28. sklearnex/linear_model/tests/test_logreg.py +45 -3
  29. sklearnex/manifold/t_sne.py +4 -0
  30. sklearnex/metrics/pairwise.py +5 -0
  31. sklearnex/metrics/ranking.py +3 -0
  32. sklearnex/model_selection/split.py +3 -0
  33. sklearnex/neighbors/_lof.py +9 -0
  34. sklearnex/neighbors/common.py +45 -1
  35. sklearnex/neighbors/knn_classification.py +1 -20
  36. sklearnex/neighbors/knn_regression.py +25 -20
  37. sklearnex/neighbors/knn_unsupervised.py +31 -7
  38. sklearnex/preview/__init__.py +1 -1
  39. sklearnex/preview/decomposition/__init__.py +19 -0
  40. sklearnex/preview/decomposition/incremental_pca.py +228 -0
  41. sklearnex/preview/decomposition/tests/test_incremental_pca.py +266 -0
  42. sklearnex/preview/linear_model/__init__.py +19 -0
  43. sklearnex/preview/linear_model/ridge.py +419 -0
  44. sklearnex/preview/linear_model/tests/test_ridge.py +102 -0
  45. sklearnex/spmd/basic_statistics/tests/test_basic_statistics_spmd.py +107 -0
  46. sklearnex/spmd/cluster/tests/test_dbscan_spmd.py +97 -0
  47. sklearnex/spmd/cluster/tests/test_kmeans_spmd.py +172 -0
  48. sklearnex/spmd/covariance/tests/test_covariance_spmd.py +107 -0
  49. sklearnex/spmd/decomposition/tests/test_pca_spmd.py +128 -0
  50. sklearnex/spmd/ensemble/tests/test_forest_spmd.py +265 -0
  51. sklearnex/spmd/linear_model/tests/test_linear_regression_spmd.py +145 -0
  52. sklearnex/spmd/linear_model/tests/test_logistic_regression_spmd.py +163 -0
  53. sklearnex/spmd/neighbors/tests/test_neighbors_spmd.py +288 -0
  54. sklearnex/svm/_common.py +163 -20
  55. sklearnex/svm/nusvc.py +40 -4
  56. sklearnex/svm/nusvr.py +31 -2
  57. sklearnex/svm/svc.py +40 -4
  58. sklearnex/svm/svr.py +31 -2
  59. sklearnex/svm/tests/test_svm.py +12 -20
  60. sklearnex/tests/_utils.py +185 -30
  61. sklearnex/tests/_utils_spmd.py +185 -0
  62. sklearnex/tests/test_common.py +54 -0
  63. sklearnex/tests/test_config.py +4 -0
  64. sklearnex/tests/test_memory_usage.py +185 -126
  65. sklearnex/tests/test_monkeypatch.py +12 -4
  66. sklearnex/tests/test_patching.py +21 -25
  67. sklearnex/tests/test_run_to_run_stability.py +295 -0
  68. sklearnex/utils/_namespace.py +1 -1
  69. scikit_learn_intelex-2024.5.0.dist-info/RECORD +0 -104
  70. sklearnex/tests/test_run_to_run_stability_tests.py +0 -428
  71. {scikit_learn_intelex-2024.5.0.dist-info → scikit_learn_intelex-2024.7.0.dist-info}/LICENSE.txt +0 -0
  72. {scikit_learn_intelex-2024.5.0.dist-info → scikit_learn_intelex-2024.7.0.dist-info}/WHEEL +0 -0
  73. {scikit_learn_intelex-2024.5.0.dist-info → scikit_learn_intelex-2024.7.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scikit-learn-intelex
3
- Version: 2024.5.0
3
+ Version: 2024.7.0
4
4
  Summary: Intel(R) Extension for Scikit-learn is a seamless way to speed up your Scikit-learn application.
5
5
  Home-page: https://github.com/intel/scikit-learn-intelex
6
6
  Author: Intel Corporation
@@ -31,7 +31,7 @@ Classifier: Topic :: Software Development
31
31
  Requires-Python: >=3.7
32
32
  Description-Content-Type: text/markdown
33
33
  License-File: LICENSE.txt
34
- Requires-Dist: daal4py (==2024.5.0)
34
+ Requires-Dist: daal4py (==2024.7.0)
35
35
  Requires-Dist: scikit-learn (>=0.22)
36
36
 
37
37
 
@@ -0,0 +1,122 @@
1
+ sklearnex/__init__.py,sha256=DVpGCMMQcUlrOGj_iy1jk3ZhCfa0_TFISYLqaUDRqC0,1780
2
+ sklearnex/__main__.py,sha256=Le9BJq6aLEGSSoZwJLsOADxsV89ynBfA8BcoJHk9F24,1921
3
+ sklearnex/_config.py,sha256=38wvKg2wG79ZctkvICl-Ay7hy8InXdR0t-P3n3h1NUs,3613
4
+ sklearnex/_device_offload.py,sha256=h5lw46OS2shk5w3Nd-1Dk2eb4jV2eq5oTl3RtR7Xusc,3456
5
+ sklearnex/_utils.py,sha256=EV4jC3plVdndsgrfPBsJZTzggrRdYWLwOpoIRWtTXt4,3812
6
+ sklearnex/conftest.py,sha256=ODuhlscC0HNGXiA8olEfHTDULzjevqG9_sn0yMGRkHg,2376
7
+ sklearnex/dispatcher.py,sha256=xxIcQ6YLSW37bvaDitlqE7qBeKfZx-c7cPAXGLNjbhk,18695
8
+ sklearnex/basic_statistics/__init__.py,sha256=-lNh54F2FO0BuHDBLjhW7zp3yBcgFZ-DrXHj2H5hLXE,920
9
+ sklearnex/basic_statistics/basic_statistics.py,sha256=1U_60TqIaNoWxA6XX1LQf18PP-1oOEjkyrskTBFBS7g,5482
10
+ sklearnex/basic_statistics/incremental_basic_statistics.py,sha256=NNWF9zdxBz2jT7dzt5hL6HRvjQIGosvViQE3KJMF1L4,10048
11
+ sklearnex/basic_statistics/tests/test_basic_statistics.py,sha256=dsJCHOPdjwZt5Kod1VdD8sdQrpoabPPUJNGN5S8cVvU,9533
12
+ sklearnex/basic_statistics/tests/test_incremental_basic_statistics.py,sha256=0a5zE0iMzAQMiRyKTpcvQjGHBM86aNhnQZ0l_Ry1fNY,14914
13
+ sklearnex/cluster/__init__.py,sha256=TsDzdbKzEubaP86iY8a7mSW0ZQzgjzGYuPkhc5lZmlQ,853
14
+ sklearnex/cluster/dbscan.py,sha256=hpP-R2VTdeXjyoZkSw8AegdGtEa2kRt2KHIokZNHFXo,6824
15
+ sklearnex/cluster/k_means.py,sha256=vo9NXztaphr3LWdsnwqPndycIbFsispSD2QldInyGRw,1262
16
+ sklearnex/cluster/tests/test_dbscan.py,sha256=JYpwyuPkGQHdbE_IPbQv4qNj7clMm4UPdz_lrpRzKXE,1504
17
+ sklearnex/cluster/tests/test_kmeans.py,sha256=TCPlrO0hrFkP3Aba_sHe2ZEAR0q16_YCLFMBBymQjdI,1643
18
+ sklearnex/covariance/__init__.py,sha256=_c86wiKDGBH50ofN-_tn7lO4M2YVEWO5AHhJIfimUDk,859
19
+ sklearnex/covariance/incremental_covariance.py,sha256=JnB6On_9MvDsNcDsSIb-4G9P38cx2A2qmomO3XjVi5I,13045
20
+ sklearnex/covariance/tests/test_incremental_covariance.py,sha256=mhH66DSlqBweySB3HZ4a9GQhz_a8BngB0HQSQkJ5Oc8,8010
21
+ sklearnex/decomposition/__init__.py,sha256=RJBYDWyvnn5DA-j5r4IqVdXLp6H4mdPySsSjnXhlv-U,805
22
+ sklearnex/decomposition/pca.py,sha256=eoNighcTXtuVbH4KP1fBaHbAUUBLup2Bqbjd5fs_J1Q,16586
23
+ sklearnex/decomposition/tests/test_pca.py,sha256=EoCgpSojE2S2e7hOUwW0Bh3vVGTUywawAhU7ThVAlW0,2319
24
+ sklearnex/doc/third-party-programs.txt,sha256=qA1XbOqYkMRnp29p8VxXjfcH0kHE8NSO5s2heea83-8,21773
25
+ sklearnex/ensemble/__init__.py,sha256=2xB2KfG7l7uJv0p3kfVhrs4KLM174SCsigZhYqwSYAA,1035
26
+ sklearnex/ensemble/_forest.py,sha256=J3TN37gIIuWkPrVTY8xLKQNh4Xr3LSi7wAH7zCsl9X0,72353
27
+ sklearnex/ensemble/tests/test_forest.py,sha256=uBpxWlhIOkaSzfd_nS6Ui0O7PcS-fVDzB5my2WQWOi0,4843
28
+ sklearnex/glob/__main__.py,sha256=--FAjkhh5E6a1TFOGu6_BM3MHe78jP8oSpl0xKiRtTI,2531
29
+ sklearnex/glob/dispatcher.py,sha256=o6XKGKM3M91F7FlXBOt1IhnpWQK4R1VY2WS-0uIghcw,3906
30
+ sklearnex/linear_model/__init__.py,sha256=mzZ0EaBhDH66ETNt2vylznSoZbCYexgL2qE_jKppYYc,1144
31
+ sklearnex/linear_model/coordinate_descent.py,sha256=h7ATAXbLTPisnRRQjt4nZiFzRjR53F2M_XSeZi_pFNw,1547
32
+ sklearnex/linear_model/incremental_linear.py,sha256=iDad4Z4xMDImvG-Jgtt0Hz3Qp9MVhSi-IjUPcV0Y_ks,16101
33
+ sklearnex/linear_model/linear.py,sha256=BDexE22Nl6egzHoMiruBp6L_biUfy0eWaZWbHMG9rJc,10740
34
+ sklearnex/linear_model/logistic_path.py,sha256=Nq3JPXSzE4bjamnP3gGQtsMKks2v7s6bSiuYRnFqrRw,849
35
+ sklearnex/linear_model/logistic_regression.py,sha256=e7tZhQX6URfoyuZ5OweiGGgTY19vfMrGGH02qiTXT0M,14881
36
+ sklearnex/linear_model/ridge.py,sha256=ZrBcYGylPMRqFj3jUvJ7nQAioh8YbvCd8CttJlx1RgM,1183
37
+ sklearnex/linear_model/tests/test_incremental_linear.py,sha256=e0ZADjB0myq1QcdwYxlVYl6tGFs4tVZIfBoV1xkdFuw,7337
38
+ sklearnex/linear_model/tests/test_linear.py,sha256=7PN4sCZ0bdcknKPdxoV0WtFg__-GHm_0PeNVOAz6HGY,5553
39
+ sklearnex/linear_model/tests/test_logreg.py,sha256=h_5X-IeKDE7TOSyCiP05WEa4ZbnZIQZ66Nwz9r8NzdM,4881
40
+ sklearnex/manifold/__init__.py,sha256=3FU5fY1YvHAyNeSlUHsZfPnAbvlAUtZpum0Obmok2KE,809
41
+ sklearnex/manifold/t_sne.py,sha256=EsyViHWIGt5vzHDUkGXBF3LGO6g10503ENLIHvdiv_Q,1005
42
+ sklearnex/manifold/tests/test_tsne.py,sha256=SNqe1yg45mL4qIsxpX5hDpBsIyrv9r__6wfrerjp3yU,1063
43
+ sklearnex/metrics/__init__.py,sha256=EHOCTU9RERa0Rrkr4dgmyO9ippbN5kjH_FwK3BqIROc,907
44
+ sklearnex/metrics/pairwise.py,sha256=OVbb4F-NdHDIfxf9ThkZXD1wqIaFTOZ1J-_EEYIlv90,980
45
+ sklearnex/metrics/ranking.py,sha256=ktFsbK6ILIQTwHM134KOf5MNTo0DoJYzfxV8GMHjRr8,957
46
+ sklearnex/metrics/tests/test_metrics.py,sha256=Nwfz8UV4V4fKLLY7f9P9eg8uY09xLXaFx1GC49TOiA8,1579
47
+ sklearnex/model_selection/__init__.py,sha256=64045Y-nzLDBepO6IRjt88LhL2DM3KdvpCF2vvj_RpA,842
48
+ sklearnex/model_selection/split.py,sha256=IdUeCJghfifj5n2VCoxXfbHtIIRBaimyOEixB_UUKbM,974
49
+ sklearnex/model_selection/tests/test_model_selection.py,sha256=3kZIq8kba8SW93DBWXupoRymNStR1_mGGYSErQRnwME,1338
50
+ sklearnex/neighbors/__init__.py,sha256=_GMJ2L-6YechRYI2fOFwHjy0kebUncE81z4FmdXUlb8,1078
51
+ sklearnex/neighbors/_lof.py,sha256=AtmBVdYBUpk7kqDNXbtvBNWkGNcmE0Lq_VtFgjelwhE,9120
52
+ sklearnex/neighbors/common.py,sha256=G79Ifl656rSOHDoBWhBMoqBUer65BOeLFWo9ttdEpEU,12527
53
+ sklearnex/neighbors/knn_classification.py,sha256=EJAColAfBUpUuBxBhWD3XmMDFqlPcgIotQa4RoJsdfU,7835
54
+ sklearnex/neighbors/knn_regression.py,sha256=eKVqlEB-S2dPgeq8BOzaZwqPnKR2ZNeUBlvJkSSCUlg,6779
55
+ sklearnex/neighbors/knn_unsupervised.py,sha256=GhvVlvcarq681OYHkmWqJ16z62HW_kAkDsrf6KErXmU,6067
56
+ sklearnex/neighbors/tests/test_neighbors.py,sha256=yAlMnLt9GrdT6Ceph5B7iFuMJXpDURiHWTE99oO8EDw,3417
57
+ sklearnex/preview/__init__.py,sha256=hZfIgTkkkUVaQ-SKaqI-S_SiXCkUzCUYxpSnbrhhEJU,813
58
+ sklearnex/preview/cluster/__init__.py,sha256=FONzOuTGAb5NwdfFhLco99P_VccRk9NBkDHU3EKuAIs,794
59
+ sklearnex/preview/cluster/_common.py,sha256=bgpzijxgyrAtdNCCHyCNsZ-N70KQYNwMuoCTNdUna6o,2718
60
+ sklearnex/preview/cluster/k_means.py,sha256=RdF9mwgvZ1xgyeLhCQA2WaPvPsS1ndktXXcaNj6S460,10464
61
+ sklearnex/preview/covariance/__init__.py,sha256=DPYTk8lwcVphtwU8J3CyUYH8Uz6Zr0Uz4S6nn-RY5iM,825
62
+ sklearnex/preview/covariance/covariance.py,sha256=NjRTWLie7UbpfN16wGSxJSRHRhUnvTn03cPPc8PpPd8,5131
63
+ sklearnex/preview/covariance/tests/test_covariance.py,sha256=FOgvhJxFQo9sNG4Uo-ebuw3ZXJ9tSxdk8qKm0ZJzTdc,2487
64
+ sklearnex/preview/decomposition/__init__.py,sha256=9VcJPWKgSrWDFEXUY6ZCpAT2XGbOVA4a1j_XgfJBnTM,839
65
+ sklearnex/preview/decomposition/incremental_pca.py,sha256=SsY1-AQt0mFTJGP5yzVxZvopNz2tSeXUO9p9c_3uVus,7820
66
+ sklearnex/preview/decomposition/tests/test_incremental_pca.py,sha256=tsAlM18nzfIQxic7Ry986Ue0ovUdbopWFNckqQLK5xU,10776
67
+ sklearnex/preview/linear_model/__init__.py,sha256=azZix9bU9zjwl12g0gB_K5RiVPJvkrinHHCwqVTLQLY,792
68
+ sklearnex/preview/linear_model/ridge.py,sha256=SmUYSeBrBALJQUxsD3h4bWxuhU4oO7JhLGNnS3hxb1w,15343
69
+ sklearnex/preview/linear_model/tests/test_ridge.py,sha256=Ru6D9fY2o6bXyxSeUo6O7sHF8jKHX30J545yBk0LRSo,4056
70
+ sklearnex/spmd/__init__.py,sha256=ChQy2kEWlo4KGvs0RnbPoPEVhdgl8URV099B1rZtF5Y,889
71
+ sklearnex/spmd/basic_statistics/__init__.py,sha256=NA5RGlwcp27UEeCgz0ngzYYd3MAIRpxlTy86uhM2-RE,821
72
+ sklearnex/spmd/basic_statistics/basic_statistics.py,sha256=_dQ9mhVYxeuChATEpAmHpXDpgW3YvtK1qrG-kLr2MtI,886
73
+ sklearnex/spmd/basic_statistics/tests/test_basic_statistics_spmd.py,sha256=I-VV-JTCR7Pu5Z36XtRxoLY6EUoeNp62DmM0vPu-NGY,3787
74
+ sklearnex/spmd/cluster/__init__.py,sha256=qBBfrCHh6_82EROLbu54XKk7SmmRwS1XJyCj0zwkoUw,1029
75
+ sklearnex/spmd/cluster/dbscan.py,sha256=23YNzPhx4MZijU0md-E3ZkHpTkhUh5cmtS3loHe-KhI,1824
76
+ sklearnex/spmd/cluster/kmeans.py,sha256=Rnb9tr9LXVto5vCAumk7ZJfa9BYYDhdD1qUWL-QK5bY,868
77
+ sklearnex/spmd/cluster/tests/test_dbscan_spmd.py,sha256=lGh7tWhoQaYMrwS3_BWcUkX2-GjsstWjLRw4JxMQgGA,3494
78
+ sklearnex/spmd/cluster/tests/test_kmeans_spmd.py,sha256=ll4WL1TJDuLg-t3-Qvcl18J9uZLBJHEraf5jH3HQBKQ,5857
79
+ sklearnex/spmd/covariance/__init__.py,sha256=5xeL1REMIxCv5M1ya99GGKaVjctUngboZ3uXgxcZ04o,823
80
+ sklearnex/spmd/covariance/covariance.py,sha256=_oIlr1W1vqDHqIPnsCb04HcBCen5oBHQr5-_n9OSvIA,884
81
+ sklearnex/spmd/covariance/tests/test_covariance_spmd.py,sha256=xH4jZ2F77KqVGYK5fyHTM28xNew7qN814lHAfrY1f50,3918
82
+ sklearnex/spmd/decomposition/__init__.py,sha256=dBh0ZMIiaqdf3DKbt8FWNB2K9Iacs395m8OxaDFQg_M,784
83
+ sklearnex/spmd/decomposition/pca.py,sha256=CUrsVD2jae-A9H8RB_emza_fe82CwnFa5PEy0fW_EZ8,871
84
+ sklearnex/spmd/decomposition/tests/test_pca_spmd.py,sha256=9OktZfMTGz5fZfPLBSdOcDKtkcKl7I06CbLnqDajtW4,4709
85
+ sklearnex/spmd/ensemble/__init__.py,sha256=B3yi7hWoVogMIiw0QRT_x5atsAFS-OO72YPLGeUQJ8M,873
86
+ sklearnex/spmd/ensemble/forest.py,sha256=vIJJd10wIigFMtJMsiNDNLJ_PP2om-60zpQY_fd11-U,2909
87
+ sklearnex/spmd/ensemble/tests/test_forest_spmd.py,sha256=YOE2sDXWvVHAPj4sswc8iPuWgnXzUSl_AKXDlN1w4zM,9245
88
+ sklearnex/spmd/linear_model/__init__.py,sha256=WwqCr2DOyUnkSIHlP0yq0UI2yFDgSl5MHV7wu3QGJtA,893
89
+ sklearnex/spmd/linear_model/linear_model.py,sha256=7QPCIQTWKBiZBTDZZbpZXi-REgxQCfRMt6rHPJAnc5E,883
90
+ sklearnex/spmd/linear_model/logistic_regression.py,sha256=q_HkfWcg0RgFbk2t9FeV0ZY28HHAOtkGEnUj4tLuwt4,885
91
+ sklearnex/spmd/linear_model/tests/test_linear_regression_spmd.py,sha256=l9bC5gDTNAS2QqZwUAgdbgG0GPvvQOT9XuyqajoAvic,5202
92
+ sklearnex/spmd/linear_model/tests/test_logistic_regression_spmd.py,sha256=NweDwFyElY5HSwGRLH8IPNFqSnvynPCvQ97OFFe6Z68,6187
93
+ sklearnex/spmd/neighbors/__init__.py,sha256=S16sH8N_18LN_8AgC_wGK5EDSNyuN-F-gI6GVlaiWVE,906
94
+ sklearnex/spmd/neighbors/neighbors.py,sha256=SiKAS_RVt34MUcGytBS5pHnI_5vFNxJn8jqt1MOhDh8,940
95
+ sklearnex/spmd/neighbors/tests/test_neighbors_spmd.py,sha256=aetHv4hdun2FaaHJTokCLc02szhkp0Yi552EdfboWeA,10488
96
+ sklearnex/svm/__init__.py,sha256=f3e4ZFwZfx6MsXsn94VK1xVm6mWKT5XCiHczo6zNyAQ,1057
97
+ sklearnex/svm/_common.py,sha256=2ml2e44mWvAufo6wCoJX3w6RbNON3OnyCaykZX0nkr8,12700
98
+ sklearnex/svm/nusvc.py,sha256=-SfYz2bUMLaosYg_qeTBYf1Ra-bFuGmI62xIerf3XeE,11262
99
+ sklearnex/svm/nusvr.py,sha256=9nbRaPCoDQ5SBGH_jLgcaX_PWGDh667w-gW5X2YbHBM,4764
100
+ sklearnex/svm/svc.py,sha256=fZ9oVpKkgH5OYBXo4mPdZ-8cP07hSzPHoJsyItpXmcQ,12470
101
+ sklearnex/svm/svr.py,sha256=NIWVUu7NjV4Fe4L-Y4vIqd3KePFdMJ1-jupeH4ZvNsg,4733
102
+ sklearnex/svm/tests/test_svm.py,sha256=KnjWVfmHzU0sJqlhDdfLdhFJA_BV_tULPqNlOLXShXg,4194
103
+ sklearnex/tests/_utils.py,sha256=rkZhH5VbMAIBBLBm2Mi5y5DQ_wMXQUq2LqR5X4wcEK0,10556
104
+ sklearnex/tests/_utils_spmd.py,sha256=Kj6TdQXHyCUcI43H2qjcySyuHt4oy6OEqvX8BC8BiyM,6909
105
+ sklearnex/tests/test_common.py,sha256=MYx0y7oomArxWu9qe2zNs7YL-ScPGFnzvw8PZ1or04A,1813
106
+ sklearnex/tests/test_config.py,sha256=9ek00NtpWSU7HXNqXXM1kFX09FFS8DCHejVIFMii6kM,1540
107
+ sklearnex/tests/test_memory_usage.py,sha256=FTtQgaa7p5ScDGscB93LkpU4B3DzfqnVMi84b2vSL30,10957
108
+ sklearnex/tests/test_monkeypatch.py,sha256=Qeq0Z84UMKLEAVoQP7WEScouf6gNPbp21fjQ2erxMQo,9962
109
+ sklearnex/tests/test_n_jobs_support.py,sha256=NziTP4GwZEDoBe1CDvhHZnp8JpwjYQmCNvXEDfS7Wo4,4313
110
+ sklearnex/tests/test_parallel.py,sha256=0zzlh2VJZWcHw5W4QSUthtAygOb6K0Bg1ekNsrdGJQE,1770
111
+ sklearnex/tests/test_patching.py,sha256=_-0IZ8n0tim0GRpZECzecOPebUUVmfKBA0yOUc7hbCw,14958
112
+ sklearnex/tests/test_run_to_run_stability.py,sha256=Q4O7l1_0O4tZ_SM3kW1OxcOCuB73ugX_I4GZMi3Lrdg,10735
113
+ sklearnex/utils/__init__.py,sha256=FFlM8zc2qnSdPYpLjSt4Ma_9FjC8qk8wXJa-5B8hCs0,898
114
+ sklearnex/utils/_namespace.py,sha256=ohr8gOgEFgrccLecllMVYQPqbqqyye9uT-cWLtyxHFs,3167
115
+ sklearnex/utils/parallel.py,sha256=VBcS-KUdyq7XpJUN6ygmNjyWtYLroghbvCxQ8nVU3YI,2085
116
+ sklearnex/utils/validation.py,sha256=fjfhQiKnBQnD7LCBlacMyvsrhGnlMLRXk5Q69uoZIP4,827
117
+ sklearnex/utils/tests/test_finite.py,sha256=AzJRY71X0VvDUicUI8Ey9Le6_yKp5O-3ZikhDVJNWms,2943
118
+ scikit_learn_intelex-2024.7.0.dist-info/LICENSE.txt,sha256=7micbUpzQXphq9e_2oL7PpZcvoXzPuQHIDEXyKXC81s,10797
119
+ scikit_learn_intelex-2024.7.0.dist-info/METADATA,sha256=3bnFVcELT6fXGuuN7F6toAcw45_HPE_sh7s-_mvdnPQ,12449
120
+ scikit_learn_intelex-2024.7.0.dist-info/WHEEL,sha256=rxMEw7jRW2YnjujGudhK0a-ZC6J_VMIRJJ7uhbmewD4,107
121
+ scikit_learn_intelex-2024.7.0.dist-info/top_level.txt,sha256=kzKChSWGJEYFmdj5PwE63HNuP_PVOhWfD32ytH9rL9Q,10
122
+ scikit_learn_intelex-2024.7.0.dist-info/RECORD,,
sklearnex/_config.py CHANGED
@@ -14,24 +14,12 @@
14
14
  # limitations under the License.
15
15
  # ==============================================================================
16
16
 
17
- import threading
18
17
  from contextlib import contextmanager
19
18
 
20
19
  from sklearn import get_config as skl_get_config
21
20
  from sklearn import set_config as skl_set_config
22
21
 
23
- _default_global_config = {
24
- "target_offload": "auto",
25
- "allow_fallback_to_host": False,
26
- }
27
-
28
- _threadlocal = threading.local()
29
-
30
-
31
- def _get_sklearnex_threadlocal_config():
32
- if not hasattr(_threadlocal, "global_config"):
33
- _threadlocal.global_config = _default_global_config.copy()
34
- return _threadlocal.global_config
22
+ from onedal._config import _get_config as onedal_get_config
35
23
 
36
24
 
37
25
  def get_config():
@@ -46,7 +34,7 @@ def get_config():
46
34
  set_config : Set global configuration.
47
35
  """
48
36
  sklearn = skl_get_config()
49
- sklearnex = _get_sklearnex_threadlocal_config().copy()
37
+ sklearnex = onedal_get_config()
50
38
  return {**sklearn, **sklearnex}
51
39
 
52
40
 
@@ -70,7 +58,7 @@ def set_config(target_offload=None, allow_fallback_to_host=None, **sklearn_confi
70
58
  """
71
59
  skl_set_config(**sklearn_configs)
72
60
 
73
- local_config = _get_sklearnex_threadlocal_config()
61
+ local_config = onedal_get_config(copy=False)
74
62
 
75
63
  if target_offload is not None:
76
64
  local_config["target_offload"] = target_offload
@@ -14,141 +14,21 @@
14
14
  # limitations under the License.
15
15
  # ==============================================================================
16
16
 
17
- import logging
18
- import sys
19
- from collections.abc import Iterable
20
17
  from functools import wraps
21
18
 
22
- import numpy as np
19
+ from onedal._device_offload import (
20
+ _copy_to_usm,
21
+ _get_global_queue,
22
+ _transfer_to_host,
23
+ dpnp_available,
24
+ )
23
25
 
24
- try:
25
- from dpctl import SyclQueue
26
- from dpctl.memory import MemoryUSMDevice, as_usm_memory
27
- from dpctl.tensor import usm_ndarray
28
-
29
- dpctl_available = True
30
- except ImportError:
31
- dpctl_available = False
32
-
33
- try:
26
+ if dpnp_available:
34
27
  import dpnp
28
+ from onedal._device_offload import _convert_to_dpnp
35
29
 
36
- dpnp_available = True
37
- except ImportError:
38
- dpnp_available = False
39
30
 
40
31
  from ._config import get_config
41
- from ._utils import get_patch_message
42
-
43
- oneapi_is_available = "daal4py.oneapi" in sys.modules
44
- if oneapi_is_available:
45
- from daal4py.oneapi import _get_device_name_sycl_ctxt, _get_sycl_ctxt_params
46
-
47
-
48
- class DummySyclQueue:
49
- """This class is designed to act like dpctl.SyclQueue
50
- to allow device dispatching in scenarios when dpctl is not available"""
51
-
52
- class DummySyclDevice:
53
- def __init__(self, filter_string):
54
- self._filter_string = filter_string
55
- self.is_cpu = "cpu" in filter_string
56
- self.is_gpu = "gpu" in filter_string
57
- # TODO: check for possibility of fp64 support
58
- # on other devices in this dummy class
59
- self.has_aspect_fp64 = self.is_cpu
60
-
61
- if not (self.is_cpu):
62
- logging.warning(
63
- "Device support is limited. "
64
- "Please install dpctl for full experience"
65
- )
66
-
67
- def get_filter_string(self):
68
- return self._filter_string
69
-
70
- def __init__(self, filter_string):
71
- self.sycl_device = self.DummySyclDevice(filter_string)
72
-
73
-
74
- def _get_device_info_from_daal4py():
75
- if oneapi_is_available:
76
- return _get_device_name_sycl_ctxt(), _get_sycl_ctxt_params()
77
- return None, dict()
78
-
79
-
80
- def _get_global_queue():
81
- target = get_config()["target_offload"]
82
- d4p_target, _ = _get_device_info_from_daal4py()
83
- if d4p_target == "host":
84
- d4p_target = "cpu"
85
-
86
- QueueClass = DummySyclQueue if not dpctl_available else SyclQueue
87
-
88
- if target != "auto":
89
- if d4p_target is not None and d4p_target != target:
90
- if not isinstance(target, str):
91
- if d4p_target not in target.sycl_device.get_filter_string():
92
- raise RuntimeError(
93
- "Cannot use target offload option "
94
- "inside daal4py.oneapi.sycl_context"
95
- )
96
- else:
97
- raise RuntimeError(
98
- "Cannot use target offload option "
99
- "inside daal4py.oneapi.sycl_context"
100
- )
101
- if isinstance(target, QueueClass):
102
- return target
103
- return QueueClass(target)
104
- if d4p_target is not None:
105
- return QueueClass(d4p_target)
106
- return None
107
-
108
-
109
- def _transfer_to_host(queue, *data):
110
- has_usm_data, has_host_data = False, False
111
-
112
- host_data = []
113
- for item in data:
114
- usm_iface = getattr(item, "__sycl_usm_array_interface__", None)
115
- if usm_iface is not None:
116
- if not dpctl_available:
117
- raise RuntimeError(
118
- "dpctl need to be installed to work "
119
- "with __sycl_usm_array_interface__"
120
- )
121
- if queue is not None:
122
- if queue.sycl_device != usm_iface["syclobj"].sycl_device:
123
- raise RuntimeError(
124
- "Input data shall be located " "on single target device"
125
- )
126
- else:
127
- queue = usm_iface["syclobj"]
128
-
129
- buffer = as_usm_memory(item).copy_to_host()
130
- order = "C"
131
- if usm_iface["strides"] is not None:
132
- if usm_iface["strides"][0] < usm_iface["strides"][1]:
133
- order = "F"
134
- item = np.ndarray(
135
- shape=usm_iface["shape"],
136
- dtype=usm_iface["typestr"],
137
- buffer=buffer,
138
- order=order,
139
- )
140
- has_usm_data = True
141
- else:
142
- has_host_data = True
143
-
144
- mismatch_host_item = usm_iface is None and item is not None and has_usm_data
145
- mismatch_usm_item = usm_iface is not None and has_host_data
146
-
147
- if mismatch_host_item or mismatch_usm_item:
148
- raise RuntimeError("Input data shall be located on single target device")
149
-
150
- host_data.append(item)
151
- return queue, host_data
152
32
 
153
33
 
154
34
  def _get_backend(obj, queue, method_name, *data):
@@ -162,10 +42,7 @@ def _get_backend(obj, queue, method_name, *data):
162
42
  else:
163
43
  return "sklearn", None, patching_status
164
44
 
165
- _, d4p_options = _get_device_info_from_daal4py()
166
- allow_fallback_to_host = get_config()["allow_fallback_to_host"] or d4p_options.get(
167
- "host_offload_on_fail", False
168
- )
45
+ allow_fallback_to_host = get_config()["allow_fallback_to_host"]
169
46
 
170
47
  if gpu_device:
171
48
  patching_status = obj._onedal_gpu_supported(method_name, *data)
@@ -203,42 +80,6 @@ def dispatch(obj, method_name, branches, *args, **kwargs):
203
80
  )
204
81
 
205
82
 
206
- def _copy_to_usm(queue, array):
207
- if not dpctl_available:
208
- raise RuntimeError(
209
- "dpctl need to be installed to work " "with __sycl_usm_array_interface__"
210
- )
211
-
212
- if hasattr(array, "__array__"):
213
-
214
- try:
215
- mem = MemoryUSMDevice(array.nbytes, queue=queue)
216
- mem.copy_from_host(array.tobytes())
217
- return usm_ndarray(array.shape, array.dtype, buffer=mem)
218
- except ValueError as e:
219
- # ValueError will raise if device does not support the dtype
220
- # retry with float32 (needed for fp16 and fp64 support issues)
221
- # try again as float32, if it is a float32 just raise the error.
222
- if array.dtype == np.float32:
223
- raise e
224
- return _copy_to_usm(queue, array.astype(np.float32))
225
- else:
226
- if isinstance(array, Iterable):
227
- array = [_copy_to_usm(queue, i) for i in array]
228
- return array
229
-
230
-
231
- if dpnp_available:
232
-
233
- def _convert_to_dpnp(array):
234
- if isinstance(array, usm_ndarray):
235
- return dpnp.array(array, copy=False)
236
- elif isinstance(array, Iterable):
237
- for i in range(len(array)):
238
- array[i] = _convert_to_dpnp(array[i])
239
- return array
240
-
241
-
242
83
  def wrap_output_data(func):
243
84
  @wraps(func)
244
85
  def wrapper(self, *args, **kwargs):
@@ -14,4 +14,130 @@
14
14
  # limitations under the License.
15
15
  # ==============================================================================
16
16
 
17
- from onedal.basic_statistics import BasicStatistics
17
+ import numpy as np
18
+ from sklearn.base import BaseEstimator
19
+ from sklearn.utils import check_array
20
+ from sklearn.utils.validation import _check_sample_weight
21
+
22
+ from daal4py.sklearn._n_jobs_support import control_n_jobs
23
+ from daal4py.sklearn._utils import sklearn_check_version
24
+ from onedal.basic_statistics import BasicStatistics as onedal_BasicStatistics
25
+
26
+ from .._device_offload import dispatch
27
+ from .._utils import PatchingConditionsChain
28
+
29
+
30
+ @control_n_jobs(decorated_methods=["fit"])
31
+ class BasicStatistics(BaseEstimator):
32
+ """
33
+ Estimator for basic statistics.
34
+ Allows to compute basic statistics for provided data.
35
+ Parameters
36
+ ----------
37
+ result_options: string or list, default='all'
38
+ List of statistics to compute
39
+
40
+ Attributes (are existing only if corresponding result option exists)
41
+ ----------
42
+ min : ndarray of shape (n_features,)
43
+ Minimum of each feature over all samples.
44
+ max : ndarray of shape (n_features,)
45
+ Maximum of each feature over all samples.
46
+ sum : ndarray of shape (n_features,)
47
+ Sum of each feature over all samples.
48
+ mean : ndarray of shape (n_features,)
49
+ Mean of each feature over all samples.
50
+ variance : ndarray of shape (n_features,)
51
+ Variance of each feature over all samples.
52
+ variation : ndarray of shape (n_features,)
53
+ Variation of each feature over all samples.
54
+ sum_squares : ndarray of shape (n_features,)
55
+ Sum of squares for each feature over all samples.
56
+ standard_deviation : ndarray of shape (n_features,)
57
+ Standard deviation of each feature over all samples.
58
+ sum_squares_centered : ndarray of shape (n_features,)
59
+ Centered sum of squares for each feature over all samples.
60
+ second_order_raw_moment : ndarray of shape (n_features,)
61
+ Second order moment of each feature over all samples.
62
+ """
63
+
64
+ def __init__(self, result_options="all"):
65
+ self.options = result_options
66
+
67
+ _onedal_basic_statistics = staticmethod(onedal_BasicStatistics)
68
+
69
+ def _save_attributes(self):
70
+ assert hasattr(self, "_onedal_estimator")
71
+
72
+ if self.options == "all":
73
+ result_options = onedal_BasicStatistics.get_all_result_options()
74
+ else:
75
+ result_options = self.options
76
+
77
+ if isinstance(result_options, str):
78
+ setattr(self, result_options, getattr(self._onedal_estimator, result_options))
79
+ elif isinstance(result_options, list):
80
+ for option in result_options:
81
+ setattr(self, option, getattr(self._onedal_estimator, option))
82
+
83
+ def _onedal_supported(self, method_name, *data):
84
+ patching_status = PatchingConditionsChain(
85
+ f"sklearnex.basic_statistics.{self.__class__.__name__}.{method_name}"
86
+ )
87
+ return patching_status
88
+
89
+ _onedal_cpu_supported = _onedal_supported
90
+ _onedal_gpu_supported = _onedal_supported
91
+
92
+ def _onedal_fit(self, X, sample_weight=None, queue=None):
93
+ if sklearn_check_version("1.0"):
94
+ X = self._validate_data(X, dtype=[np.float64, np.float32], ensure_2d=False)
95
+ else:
96
+ X = check_array(X, dtype=[np.float64, np.float32])
97
+
98
+ if sample_weight is not None:
99
+ sample_weight = _check_sample_weight(sample_weight, X)
100
+
101
+ onedal_params = {
102
+ "result_options": self.options,
103
+ }
104
+
105
+ if not hasattr(self, "_onedal_estimator"):
106
+ self._onedal_estimator = self._onedal_basic_statistics(**onedal_params)
107
+ self._onedal_estimator.fit(X, sample_weight, queue)
108
+ self._save_attributes()
109
+
110
+ def compute(self, data, weights=None, queue=None):
111
+ return self._onedal_estimator.compute(data, weights, queue)
112
+
113
+ def fit(self, X, y=None, *, sample_weight=None):
114
+ """Compute statistics with X, using minibatches of size batch_size.
115
+
116
+ Parameters
117
+ ----------
118
+ X : array-like of shape (n_samples, n_features)
119
+ Data for compute, where `n_samples` is the number of samples and
120
+ `n_features` is the number of features.
121
+
122
+ y : Ignored
123
+ Not used, present for API consistency by convention.
124
+
125
+ sample_weight : array-like of shape (n_samples,), default=None
126
+ Weights for compute weighted statistics, where `n_samples` is the number of samples.
127
+
128
+ Returns
129
+ -------
130
+ self : object
131
+ Returns the instance itself.
132
+ """
133
+ dispatch(
134
+ self,
135
+ "fit",
136
+ {
137
+ "onedal": self.__class__._onedal_fit,
138
+ "sklearn": None,
139
+ },
140
+ X,
141
+ sample_weight,
142
+ )
143
+ return self