Skip to content

Commit 48b465d

Browse files
author
Nikita Kulikov
committed
Squashing
1 parent b856f8f commit 48b465d

File tree

138 files changed

+8373
-1176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+8373
-1176
lines changed

.ci/pipeline/build-and-test-lnx.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ steps:
2424
displayName: "System info"
2525
- script: |
2626
conda update -y -q conda
27-
if [ $(echo $(PYTHON_VERSION) | grep '3.8\|3.9\|3.10') ]; then export DPCPP_PACKAGE="dpctl>=0.14 "; else export DPCPP_PACKAGE=""; fi
28-
conda create -q -y -n CB -c conda-forge -c intel python=$(PYTHON_VERSION) dal-devel mpich pyyaml $DPCPP_PACKAGE dpcpp-cpp-rt>=2023.2.0
27+
if [ $(echo $(PYTHON_VERSION) | grep '3.9\|3.10') ]; then export DPCPP_PACKAGE="dpctl>=0.15 "; else export DPCPP_PACKAGE=""; fi
28+
conda create -q -y -n CB -c conda-forge -c intel python=$(PYTHON_VERSION) intel::dal-devel mpich pyyaml $DPCPP_PACKAGE "dpcpp-cpp-rt>=2024.0.0"
2929
displayName: "Conda create"
3030
- script: |
3131
. /usr/share/miniconda/etc/profile.d/conda.sh
@@ -47,7 +47,7 @@ steps:
4747
bash .ci/scripts/setup_sklearn.sh $(SKLEARN_VERSION)
4848
pip install --upgrade -r requirements-test.txt
4949
pip install $(python .ci/scripts/get_compatible_scipy_version.py)
50-
if [ $(echo $(PYTHON_VERSION) | grep '3.8\|3.9\|3.10') ]; then conda install -q -y -c intel dpnp; fi
50+
if [ $(echo $(PYTHON_VERSION) | grep '3.9\|3.10') ]; then conda install -q -y -c intel dpnp; fi
5151
pip list
5252
displayName: "Install testing requirements"
5353
- script: |

.ci/pipeline/build-and-test-win.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
steps:
1717
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
1818
displayName: Add conda to PATH
19-
- script: conda create -q -y -n CB -c conda-forge -c intel python=$(PYTHON_VERSION) dal-devel impi-devel clang-format pyyaml
19+
- script: conda create -q -y -n CB -c conda-forge -c intel python=$(PYTHON_VERSION) intel::dal-devel impi-devel clang-format pyyaml
2020
displayName: 'Create Anaconda environment'
2121
- script: |
2222
call activate CB

.ci/scripts/install_dpcpp.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
2121
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
2222
sudo add-apt-repository -y "deb https://apt.repos.intel.com/oneapi all main"
2323
sudo apt-get update
24-
sudo apt-get install -y intel-dpcpp-cpp-compiler-2023.2.1
24+
sudo apt-get install -y intel-dpcpp-cpp-compiler-2024.0
2525
sudo bash -c 'echo libintelocl.so > /etc/OpenCL/vendors/intel-cpu.icd'
26-
sudo mv -f /opt/intel/oneapi/compiler/latest/linux/lib/oclfpga /opt/intel/oneapi/compiler/latest/linux/lib/oclfpga_

doc/third-party-programs-sklearnex.txt

Lines changed: 206 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ DAMAGE.
242242
-------------------------------------------------------------
243243

244244
3. Cython
245-
Apache License
245+
Apache License
246246
Version 2.0, January 2004
247247
https://www.apache.org/licenses/
248248

@@ -421,4 +421,209 @@ Apache License
421421

422422
-------------------------------------------------------------
423423

424+
3. DLPack
425+
Apache License
426+
Version 2.0, January 2004
427+
http://www.apache.org/licenses/
428+
429+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
430+
431+
1. Definitions.
432+
433+
"License" shall mean the terms and conditions for use, reproduction,
434+
and distribution as defined by Sections 1 through 9 of this document.
435+
436+
"Licensor" shall mean the copyright owner or entity authorized by
437+
the copyright owner that is granting the License.
438+
439+
"Legal Entity" shall mean the union of the acting entity and all
440+
other entities that control, are controlled by, or are under common
441+
control with that entity. For the purposes of this definition,
442+
"control" means (i) the power, direct or indirect, to cause the
443+
direction or management of such entity, whether by contract or
444+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
445+
outstanding shares, or (iii) beneficial ownership of such entity.
446+
447+
"You" (or "Your") shall mean an individual or Legal Entity
448+
exercising permissions granted by this License.
449+
450+
"Source" form shall mean the preferred form for making modifications,
451+
including but not limited to software source code, documentation
452+
source, and configuration files.
453+
454+
"Object" form shall mean any form resulting from mechanical
455+
transformation or translation of a Source form, including but
456+
not limited to compiled object code, generated documentation,
457+
and conversions to other media types.
458+
459+
"Work" shall mean the work of authorship, whether in Source or
460+
Object form, made available under the License, as indicated by a
461+
copyright notice that is included in or attached to the work
462+
(an example is provided in the Appendix below).
463+
464+
"Derivative Works" shall mean any work, whether in Source or Object
465+
form, that is based on (or derived from) the Work and for which the
466+
editorial revisions, annotations, elaborations, or other modifications
467+
represent, as a whole, an original work of authorship. For the purposes
468+
of this License, Derivative Works shall not include works that remain
469+
separable from, or merely link (or bind by name) to the interfaces of,
470+
the Work and Derivative Works thereof.
471+
472+
"Contribution" shall mean any work of authorship, including
473+
the original version of the Work and any modifications or additions
474+
to that Work or Derivative Works thereof, that is intentionally
475+
submitted to Licensor for inclusion in the Work by the copyright owner
476+
or by an individual or Legal Entity authorized to submit on behalf of
477+
the copyright owner. For the purposes of this definition, "submitted"
478+
means any form of electronic, verbal, or written communication sent
479+
to the Licensor or its representatives, including but not limited to
480+
communication on electronic mailing lists, source code control systems,
481+
and issue tracking systems that are managed by, or on behalf of, the
482+
Licensor for the purpose of discussing and improving the Work, but
483+
excluding communication that is conspicuously marked or otherwise
484+
designated in writing by the copyright owner as "Not a Contribution."
485+
486+
"Contributor" shall mean Licensor and any individual or Legal Entity
487+
on behalf of whom a Contribution has been received by Licensor and
488+
subsequently incorporated within the Work.
489+
490+
2. Grant of Copyright License. Subject to the terms and conditions of
491+
this License, each Contributor hereby grants to You a perpetual,
492+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
493+
copyright license to reproduce, prepare Derivative Works of,
494+
publicly display, publicly perform, sublicense, and distribute the
495+
Work and such Derivative Works in Source or Object form.
496+
497+
3. Grant of Patent License. Subject to the terms and conditions of
498+
this License, each Contributor hereby grants to You a perpetual,
499+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
500+
(except as stated in this section) patent license to make, have made,
501+
use, offer to sell, sell, import, and otherwise transfer the Work,
502+
where such license applies only to those patent claims licensable
503+
by such Contributor that are necessarily infringed by their
504+
Contribution(s) alone or by combination of their Contribution(s)
505+
with the Work to which such Contribution(s) was submitted. If You
506+
institute patent litigation against any entity (including a
507+
cross-claim or counterclaim in a lawsuit) alleging that the Work
508+
or a Contribution incorporated within the Work constitutes direct
509+
or contributory patent infringement, then any patent licenses
510+
granted to You under this License for that Work shall terminate
511+
as of the date such litigation is filed.
512+
513+
4. Redistribution. You may reproduce and distribute copies of the
514+
Work or Derivative Works thereof in any medium, with or without
515+
modifications, and in Source or Object form, provided that You
516+
meet the following conditions:
517+
518+
(a) You must give any other recipients of the Work or
519+
Derivative Works a copy of this License; and
520+
521+
(b) You must cause any modified files to carry prominent notices
522+
stating that You changed the files; and
523+
524+
(c) You must retain, in the Source form of any Derivative Works
525+
that You distribute, all copyright, patent, trademark, and
526+
attribution notices from the Source form of the Work,
527+
excluding those notices that do not pertain to any part of
528+
the Derivative Works; and
529+
530+
(d) If the Work includes a "NOTICE" text file as part of its
531+
distribution, then any Derivative Works that You distribute must
532+
include a readable copy of the attribution notices contained
533+
within such NOTICE file, excluding those notices that do not
534+
pertain to any part of the Derivative Works, in at least one
535+
of the following places: within a NOTICE text file distributed
536+
as part of the Derivative Works; within the Source form or
537+
documentation, if provided along with the Derivative Works; or,
538+
within a display generated by the Derivative Works, if and
539+
wherever such third-party notices normally appear. The contents
540+
of the NOTICE file are for informational purposes only and
541+
do not modify the License. You may add Your own attribution
542+
notices within Derivative Works that You distribute, alongside
543+
or as an addendum to the NOTICE text from the Work, provided
544+
that such additional attribution notices cannot be construed
545+
as modifying the License.
546+
547+
You may add Your own copyright statement to Your modifications and
548+
may provide additional or different license terms and conditions
549+
for use, reproduction, or distribution of Your modifications, or
550+
for any such Derivative Works as a whole, provided Your use,
551+
reproduction, and distribution of the Work otherwise complies with
552+
the conditions stated in this License.
553+
554+
5. Submission of Contributions. Unless You explicitly state otherwise,
555+
any Contribution intentionally submitted for inclusion in the Work
556+
by You to the Licensor shall be under the terms and conditions of
557+
this License, without any additional terms or conditions.
558+
Notwithstanding the above, nothing herein shall supersede or modify
559+
the terms of any separate license agreement you may have executed
560+
with Licensor regarding such Contributions.
561+
562+
6. Trademarks. This License does not grant permission to use the trade
563+
names, trademarks, service marks, or product names of the Licensor,
564+
except as required for reasonable and customary use in describing the
565+
origin of the Work and reproducing the content of the NOTICE file.
566+
567+
7. Disclaimer of Warranty. Unless required by applicable law or
568+
agreed to in writing, Licensor provides the Work (and each
569+
Contributor provides its Contributions) on an "AS IS" BASIS,
570+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
571+
implied, including, without limitation, any warranties or conditions
572+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
573+
PARTICULAR PURPOSE. You are solely responsible for determining the
574+
appropriateness of using or redistributing the Work and assume any
575+
risks associated with Your exercise of permissions under this License.
576+
577+
8. Limitation of Liability. In no event and under no legal theory,
578+
whether in tort (including negligence), contract, or otherwise,
579+
unless required by applicable law (such as deliberate and grossly
580+
negligent acts) or agreed to in writing, shall any Contributor be
581+
liable to You for damages, including any direct, indirect, special,
582+
incidental, or consequential damages of any character arising as a
583+
result of this License or out of the use or inability to use the
584+
Work (including but not limited to damages for loss of goodwill,
585+
work stoppage, computer failure or malfunction, or any and all
586+
other commercial damages or losses), even if such Contributor
587+
has been advised of the possibility of such damages.
588+
589+
9. Accepting Warranty or Additional Liability. While redistributing
590+
the Work or Derivative Works thereof, You may choose to offer,
591+
and charge a fee for, acceptance of support, warranty, indemnity,
592+
or other liability obligations and/or rights consistent with this
593+
License. However, in accepting such obligations, You may act only
594+
on Your own behalf and on Your sole responsibility, not on behalf
595+
of any other Contributor, and only if You agree to indemnify,
596+
defend, and hold each Contributor harmless for any liability
597+
incurred by, or claims asserted against, such Contributor by reason
598+
of your accepting any such warranty or additional liability.
599+
600+
END OF TERMS AND CONDITIONS
601+
602+
APPENDIX: How to apply the Apache License to your work.
603+
604+
To apply the Apache License to your work, attach the following
605+
boilerplate notice, with the fields enclosed by brackets "{}"
606+
replaced with your own identifying information. (Don't include
607+
the brackets!) The text should be enclosed in the appropriate
608+
comment syntax for the file format. We also recommend that a
609+
file or class name and description of purpose be included on the
610+
same "printed page" as the copyright notice for easier
611+
identification within third-party archives.
612+
613+
Copyright 2017 by Contributors
614+
615+
Licensed under the Apache License, Version 2.0 (the "License");
616+
you may not use this file except in compliance with the License.
617+
You may obtain a copy of the License at
618+
619+
http://www.apache.org/licenses/LICENSE-2.0
620+
621+
Unless required by applicable law or agreed to in writing, software
622+
distributed under the License is distributed on an "AS IS" BASIS,
623+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
624+
See the License for the specific language governing permissions and
625+
limitations under the License.
626+
627+
-------------------------------------------------------------
628+
424629
Other names and brands may be claimed as the property of others.

gen.py

Lines changed: 0 additions & 51 deletions
This file was deleted.

generator/gen_daal4py.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@
2727
import re
2828
import shutil
2929
from collections import OrderedDict, defaultdict
30+
from os.path import isdir
3031
from os.path import join as jp
3132
from shutil import copytree, rmtree
3233
from subprocess import call
34+
from sys import platform
3335

3436
from .format import mk_var
3537
from .parse import parse_header, parse_version
@@ -1196,7 +1198,15 @@ def gen_daal4py(dalroot, outdir, version, warn_all=False, no_dist=False, no_stre
11961198
global no_warn
11971199
if warn_all:
11981200
no_warn = {}
1199-
orig_path = jp(dalroot, "include")
1201+
orig_path_candidates = [
1202+
jp(dalroot, "include", "dal"),
1203+
jp(dalroot, "Library", "include", "dal"),
1204+
jp(dalroot, "include"),
1205+
]
1206+
for candidate in orig_path_candidates:
1207+
if isdir(candidate):
1208+
orig_path = candidate
1209+
break
12001210
assert os.path.isfile(jp(orig_path, "algorithms", "algorithm.h")) and os.path.isfile(
12011211
jp(orig_path, "algorithms", "model.h")
12021212
), (

onedal/cluster/dbscan.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def _fit(self, X, y, sample_weight, module, queue):
8181
).ravel()
8282
else:
8383
self.core_sample_indices_ = np.array([], dtype=np.intc)
84+
self.core_sample_indices_ = self.core_sample_indices_.astype(np.intc)
8485
self.components_ = np.take(X, self.core_sample_indices_, axis=0)
8586
self.n_features_in_ = X.shape[1]
8687
return self

onedal/cluster/kmeans.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ def _check_params_vs_input(
9191
self, X_table, policy, default_n_init=10, dtype=np.float32
9292
):
9393
# n_clusters
94-
if X_table.shape[0] < self.n_clusters:
94+
X_row_count = X_table.get_row_count()
95+
if X_row_count < self.n_clusters:
9596
raise ValueError(
96-
f"n_samples={X_table.shape[0]} should be >= n_clusters={self.n_clusters}."
97+
f"n_samples={X_row_count} should be >= n_clusters={self.n_clusters}."
9798
)
9899

99100
# tol
@@ -182,7 +183,7 @@ def _init_centroids_custom(
182183
elif _is_arraylike_not_scalar(init):
183184
centers = np.asarray(init)
184185
assert centers.shape[0] == n_clusters
185-
assert centers.shape[1] == X_table.column_count
186+
assert centers.shape[1] == X_table.get_column_count()
186187
centers = _convert_to_supported(policy, init)
187188
centers_table = to_table(centers)
188189
else:
@@ -221,10 +222,6 @@ def _init_centroids_generic(self, X, init, random_state, policy, dtype=np.float3
221222
def _fit_backend(self, X_table, centroids_table, module, policy, dtype=np.float32):
222223
params = self._get_onedal_params(dtype)
223224

224-
# TODO: check all features for having correct type
225-
meta = _backend.get_table_metadata(X_table)
226-
assert meta.get_npy_dtype(0) == dtype
227-
228225
result = module.train(policy, params, X_table, centroids_table)
229226

230227
return (
@@ -238,7 +235,7 @@ def _fit(self, X, module, queue=None):
238235
policy = self._get_policy(queue, X)
239236
_, X_table, dtype = self._get_params_and_input(X, policy)
240237

241-
self.n_features_in_ = X_table.column_count
238+
self.n_features_in_ = X_table.get_column_count()
242239

243240
best_model, best_n_iter = None, None
244241
best_inertia, best_labels = None, None

0 commit comments

Comments
 (0)