Skip to content

Remove raw inputs#3095

Merged
ethanglaser merged 6 commits intouxlfoundation:mainfrom
ethanglaser:dev/eglaser-rm-raw-inputs
Apr 1, 2026
Merged

Remove raw inputs#3095
ethanglaser merged 6 commits intouxlfoundation:mainfrom
ethanglaser:dev/eglaser-rm-raw-inputs

Conversation

@ethanglaser
Copy link
Copy Markdown
Contributor

Description


Checklist:

Completeness and readability

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes or created a separate PR with updates and provided its number in the description, if necessary.
  • Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • I have resolved any merge conflicts that might occur with the base branch.

Testing

  • I have run it locally and tested the changes extensively.
  • All CI jobs are green or I have provided justification why they aren't.
  • I have extended testing suite if new functionality was introduced in this PR.

Performance

  • I have measured performance for affected algorithms using scikit-learn_bench and provided at least a summary table with measured data, if performance change is expected.
  • I have provided justification why performance and/or quality metrics have changed or why changes are not expected.
  • I have extended the benchmarking suite and provided a corresponding scikit-learn_bench PR if new measurable functionality was introduced in this PR.

@ethanglaser
Copy link
Copy Markdown
Contributor Author

/intelci: run

@ethanglaser
Copy link
Copy Markdown
Contributor Author

/intelci: run

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 82.19178% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
sklearnex/ensemble/_forest.py 66.66% 4 Missing and 2 partials ⚠️
sklearnex/linear_model/logistic_regression.py 0.00% 4 Missing ⚠️
sklearnex/neighbors/knn_classification.py 66.66% 0 Missing and 2 partials ⚠️
sklearnex/neighbors/knn_regression.py 75.00% 0 Missing and 1 partial ⚠️
Flag Coverage Δ
azure ?
github 81.99% <82.19%> (+0.63%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
onedal/_config.py 100.00% <ø> (ø)
onedal/_device_offload.py 90.00% <100.00%> (+8.27%) ⬆️
sklearnex/_config.py 100.00% <ø> (+5.55%) ⬆️
sklearnex/_device_offload.py 81.81% <100.00%> (+4.39%) ⬆️
sklearnex/basic_statistics/basic_statistics.py 88.23% <100.00%> (+1.44%) ⬆️
...x/basic_statistics/incremental_basic_statistics.py 100.00% <100.00%> (+1.14%) ⬆️
sklearnex/cluster/dbscan.py 76.00% <100.00%> (+0.67%) ⬆️
sklearnex/cluster/k_means.py 82.67% <100.00%> (+1.60%) ⬆️
sklearnex/covariance/incremental_covariance.py 79.88% <100.00%> (+0.46%) ⬆️
sklearnex/decomposition/pca.py 93.85% <100.00%> (+1.18%) ⬆️
... and 8 more

... and 24 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@david-cortes-intel david-cortes-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, pending CI results.

Comment thread sklearnex/neighbors/common.py
hasattr(r, "__sycl_usm_array_interface__") for r in result
):
return result
if usm_iface := getattr(data, "__sycl_usm_array_interface__", None):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @yuejiaointel for review.

@david-cortes-intel
Copy link
Copy Markdown
Contributor

/intelci: run

@david-cortes-intel
Copy link
Copy Markdown
Contributor

/azp run Nightly

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@david-cortes-intel
Copy link
Copy Markdown
Contributor

/intelci: run

@david-cortes-intel
Copy link
Copy Markdown
Contributor

/azp run Nightly

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ethanglaser ethanglaser changed the title Dev/eglaser rm raw inputs Remove raw inputs Apr 1, 2026
@ethanglaser ethanglaser marked this pull request as ready for review April 1, 2026 15:06
@ethanglaser ethanglaser requested a review from razdoburdin as a code owner April 1, 2026 15:06
Copilot AI review requested due to automatic review settings April 1, 2026 15:06
@ethanglaser
Copy link
Copy Markdown
Contributor Author

/intelci: run

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the deprecated use_raw_input configuration path and updates estimators/tests to always validate inputs rather than bypassing validation via raw inputs.

Changes:

  • Remove use_raw_input from sklearnex / onedal configuration and offload logic.
  • Update many estimators to always call validate_data (and adjust classification target processing accordingly).
  • Simplify/adjust SPMD test parametrization by removing use_raw_input coverage and related config_context usage.

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sklearnex/spmd/neighbors/tests/test_neighbors_spmd.py Drops use_raw_input parametrization; keeps array_api_dispatch coverage.
sklearnex/spmd/neighbors/neighbors.py Removes stale comment tied to use_raw_input behavior.
sklearnex/spmd/linear_model/tests/test_logistic_regression_spmd.py Removes use_raw_input test path and related config_context usage.
sklearnex/spmd/linear_model/tests/test_linear_regression_spmd.py Removes use_raw_input test path and related config_context usage.
sklearnex/spmd/linear_model/tests/test_incremental_linear_spmd.py Removes use_raw_input parametrization and context usage.
sklearnex/spmd/ensemble/tests/test_forest_spmd.py Removes use_raw_input parametrization and context usage.
sklearnex/spmd/decomposition/tests/test_pca_spmd.py Removes use_raw_input parametrization and context usage.
sklearnex/spmd/decomposition/tests/test_incremental_pca_spmd.py Removes use_raw_input parametrization and context usage.
sklearnex/spmd/covariance/tests/test_incremental_covariance_spmd.py Removes use_raw_input parametrization and context usage.
sklearnex/spmd/covariance/tests/test_covariance_spmd.py Removes use_raw_input parametrization and context usage.
sklearnex/spmd/cluster/tests/test_kmeans_spmd.py Removes use_raw_input parametrization and context usage.
sklearnex/spmd/cluster/tests/test_dbscan_spmd.py Removes use_raw_input parametrization and context usage.
sklearnex/spmd/basic_statistics/tests/test_incremental_basic_statistics_spmd.py Removes use_raw_input parametrization and context usage.
sklearnex/spmd/basic_statistics/tests/test_basic_statistics_spmd.py Removes use_raw_input parametrization and context usage.
sklearnex/preview/decomposition/incremental_pca.py Removes use_raw_input branching; always validates inputs.
sklearnex/preview/covariance/covariance.py Removes use_raw_input branching; always validates inputs/covariance.
sklearnex/neighbors/knn_unsupervised.py Removes use_raw_input branching; always validates inputs.
sklearnex/neighbors/knn_regression.py Removes use_raw_input branching; always validates inputs in fit/predict/kneighbors.
sklearnex/neighbors/knn_classification.py Removes use_raw_input branching; always validates inputs; forces target validation.
sklearnex/neighbors/common.py Updates docstring to remove use_raw_input reference.
sklearnex/linear_model/logistic_regression.py Removes use_raw_input gating around validation.
sklearnex/linear_model/linear.py Removes use_raw_input gating around validation.
sklearnex/linear_model/incremental_linear.py Removes use_raw_input gating; always validates when check_input is True.
sklearnex/ensemble/_forest.py Removes use_raw_input branching; standardizes validation/class_weight handling.
sklearnex/decomposition/pca.py Removes use_raw_input gating around validation.
sklearnex/covariance/incremental_covariance.py Removes use_raw_input gating around validation.
sklearnex/cluster/k_means.py Removes use_raw_input gating around validation.
sklearnex/cluster/dbscan.py Removes use_raw_input gating; always validates inputs and sample_weight.
sklearnex/basic_statistics/incremental_basic_statistics.py Removes use_raw_input gating; always validates when check_input is True.
sklearnex/basic_statistics/basic_statistics.py Removes use_raw_input gating; always validates inputs/sample_weight.
sklearnex/_device_offload.py Removes use_raw_input dispatch path; adjusts output conversion behavior for USM inputs.
sklearnex/_config.py Removes use_raw_input from public config API and docstrings.
onedal/_device_offload.py Removes use_raw_input queue/override logic and logging hooks.
onedal/_config.py Removes use_raw_input from default onedal config.
Comments suppressed due to low confidence (1)

sklearnex/_device_offload.py:220

  • In wrap_output_data(), the new unconditional conversion path for USM inputs will also run when result is already a SYCL/USM object (including tuple/list of USM arrays, e.g. kneighbors returning (dist, ind)). Because copy_to_dpnp/copy_to_usm converts iterables to a Python list, this can change the public return type from tuple to list and can also force an unnecessary device->host->device copy when outputs are already on the correct device. Consider restoring the prior guard to return result as-is when it (or all elements of a tuple/list) already expose __sycl_usm_array_interface__, and/or preserve the original container type when converting iterables.
            if usm_iface := getattr(data, "__sycl_usm_array_interface__", None):
                queue = usm_iface["syclobj"]
                return copy_to_dpnp(queue, result)

            if get_config().get("transform_output") in ("default", None):
                if hasattr(data, "dtype"):

@ethanglaser ethanglaser merged commit 5af9e80 into uxlfoundation:main Apr 1, 2026
17 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants