Skip to content

Commit 7aff323

Browse files
authored
Merge branch 'uxlfoundation:main' into dev/pytorch_testing_2
2 parents d0a47db + 42096dd commit 7aff323

38 files changed

+161
-350
lines changed

.ci/scripts/run_sklearn_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
# limitations under the License.
1515
# ===============================================================================
1616

17+
import os
18+
19+
os.environ["SCIPY_ARRAY_API"] = "1"
1720
from sklearnex import patch_sklearn
1821

1922
patch_sklearn()
2023

2124
import argparse
22-
import os
2325
import sys
2426

2527
import pytest
@@ -43,8 +45,6 @@
4345
if os.environ["SELECTED_TESTS"] == "all":
4446
os.environ["SELECTED_TESTS"] = ""
4547

46-
os.environ["SCIPY_ARRAY_API"] = "1"
47-
4848
pytest_args = (
4949
f"--rootdir={sklearn_file_dir} "
5050
f'{os.environ["DESELECTED_TESTS"]} {os.environ["SELECTED_TESTS"]}'.split(" ")

.github/workflows/docs-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ jobs:
4242

4343
steps:
4444
- name: Checkout Repository
45-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
45+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4646
with:
4747
fetch-depth: 0 # Ensures all tags are fetched
4848

4949
- name: Set Up Python
50-
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
50+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
5151
with:
5252
python-version: "3.11"
5353

.github/workflows/openssf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
steps:
4242
- name: "Checkout code"
43-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
43+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4444
with:
4545
persist-credentials: false
4646

.github/workflows/skywalking-eyes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-24.04
3838
steps:
3939
- name: "Checkout code"
40-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
40+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4141
- name: "Run check"
4242
uses: apache/skywalking-eyes/header@61275cc80d0798a405cb070f7d3a8aaf7cf2c2c1 # v0.8.0
4343
with:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
hooks:
2929
- id: clang-format
3030
- repo: https://github.com/numpy/numpydoc
31-
rev: v1.9.0
31+
rev: v1.10.0
3232
hooks:
3333
- id: numpydoc-validation
3434
exclude: |

conda-recipe/run_test.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if "%PYTHON%"=="python" (
2828
set NO_DIST=1
2929
)
3030

31-
31+
set SCIPY_ARRAY_API=1
3232

3333
%PYTHON% -c "from sklearnex import patch_sklearn; patch_sklearn()" || set exitcode=1
3434

conda-recipe/run_test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ if [ -z "${PYTHON}" ]; then
3636
export PYTHON=python
3737
fi
3838

39+
export SCIPY_ARRAY_API=1
40+
3941
# Note: execute with argument --json-report in order to produce
4042
# a JSON report under folder '.pytest_reports'. Other arguments
4143
# will also be forwarded to pytest.

daal4py/sklearn/linear_model/tests/test_linear.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,14 @@
1414
# limitations under the License.
1515
# ==============================================================================
1616

17-
18-
from os import environ
19-
20-
from daal4py.sklearn._utils import sklearn_check_version
21-
22-
# sklearn requires manual enabling of Scipy array API support
23-
# if `array-api-compat` package is present in environment
24-
# TODO: create generic approach to handle this for all tests
25-
if sklearn_check_version("1.6"):
26-
environ["SCIPY_ARRAY_API"] = "1"
27-
28-
2917
import numpy as np
3018
import pytest
3119
from sklearn.datasets import make_regression
3220
from sklearn.linear_model import LinearRegression
3321
from sklearn.utils._testing import assert_array_almost_equal
3422

23+
from daal4py.sklearn._utils import sklearn_check_version
24+
3525

3626
def make_dataset(n_samples, n_features, kind=np.array, random_state=0, types=None):
3727
try:

doc/sources/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ def setup(app):
272272
linkcheck_ignore = [
273273
re.compile(r"https://github\.com/.+"), # Avoid rate error
274274
re.compile(r"https://.*intel\.com/.+"), # Avoid permission error
275+
re.compile(r"https://medium\.com/.*"), # Avoid Medium paywall/rate limit
275276
]
276277

277278
# Speed up link-check and fail faster

examples/sklearnex/basic_statistics_spmd.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515
# ==============================================================================
1616

17-
import dpctl.tensor as dpt
17+
import dpnp
1818
import numpy as np
1919
from dpctl import SyclQueue
2020
from mpi4py import MPI
@@ -51,14 +51,14 @@ def generate_data(par, size, seed=777):
5151
data, weights = generate_data(params_spmd, size, seed=rank)
5252
weighted_data = np.diag(weights) @ data
5353

54-
dpt_data = dpt.asarray(data, usm_type="device", sycl_queue=q)
55-
dpt_weights = dpt.asarray(weights, usm_type="device", sycl_queue=q)
54+
dpnp_data = dpnp.asarray(data, usm_type="device", sycl_queue=q)
55+
dpnp_weights = dpnp.asarray(weights, usm_type="device", sycl_queue=q)
5656

5757
gtr_mean = np.mean(weighted_data, axis=0)
5858
gtr_std = np.std(weighted_data, axis=0)
5959

6060
bss = BasicStatisticsSpmd(["mean", "standard_deviation"])
61-
bss.fit(dpt_data, dpt_weights)
61+
bss.fit(dpnp_data, dpnp_weights)
6262

6363
print(f"Computed mean on rank {rank}:\n", bss.mean_)
6464
print(f"Computed std on rank {rank}:\n", bss.standard_deviation_)

0 commit comments

Comments
 (0)