Skip to content

Support for sklearn 1.6 conformance testing #2465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

ethanglaser
Copy link
Contributor

@ethanglaser ethanglaser commented May 5, 2025

Description

  • scikit-learn-intelex PR to support internal conformance checks on sklearn 1.6 for CPU and 1.4 for GPU
  • deselected tests updates to handle xfail/xpass discrepancies and a handful of outlying tests - all were investigated and large-scale failures have been fixed
  • updates to daal4py logistic_path logic to align with scikit-learn
  • updates to ridge to align coefficient and intercept shapes with scikit-learn logic

PR should start as a draft, then move to ready for review state after CI is passed and all applicable checkboxes are closed.
This approach ensures that reviewers don't spend extra time asking for regular requirements.

You can remove a checkbox as not applicable only if it doesn't relate to this PR in any way.
For example, PR with docs update doesn't require checkboxes for performance while PR with any change in actual code should have checkboxes and justify how this code change is expected to affect performance (or justification should be self-evident).

Checklist to comply with before moving PR from draft:

PR completeness and readability

  • I have reviewed my changes thoroughly before submitting this pull request.
  • 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 update 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 added a respective label(s) to PR if I have a permission for that.
  • 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.

@icfaust icfaust changed the title Dev/eglaser sklearn16 deselections Dev/eglaser sklearn1.6 deselections May 6, 2025
Copy link

codecov bot commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Flag Coverage Δ
azure 79.83% <85.71%> (+0.07%) ⬆️
github 73.56% <42.85%> (+0.02%) ⬆️

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

Files with missing lines Coverage Δ
onedal/linear_model/linear_model.py 83.58% <ø> (-0.36%) ⬇️
sklearnex/linear_model/ridge.py 82.46% <100.00%> (+4.23%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ethanglaser ethanglaser marked this pull request as ready for review May 9, 2025 23:51
@ethanglaser
Copy link
Contributor Author

ethanglaser commented May 9, 2025

@ethanglaser ethanglaser added testing Tests for sklearnex/daal4py/onedal4py & patching sklearn dependencies Pull requests that update a dependency file labels May 9, 2025
@ethanglaser ethanglaser requested review from ahuber21 and homksei May 9, 2025 23:53
Copy link
Contributor

@yuejiaointel yuejiaointel left a comment

Choose a reason for hiding this comment

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

Any impact of these extra checks on throughput or memory?

@ethanglaser ethanglaser changed the title Dev/eglaser sklearn1.6 deselections Support for sklearn 1.6 conformance testing May 14, 2025
@ethanglaser
Copy link
Contributor Author

Any impact of these extra checks on throughput or memory?

Generally just additions of sklearn version checks so should have negligible impact.

Also for reference, there are roughly 3000 new tests running in 1.6.1 compared to 1.5.2, can yield 10-20% increase in runtimes for these steps (which amounts to a minute or two of runtime).

Copy link
Contributor

@icfaust icfaust left a comment

Choose a reason for hiding this comment

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

Relatively straightforward, just some small questions/changes. I think we can get this easily ready for merge for when private CI is available again. The only actual change is to duplicate the Ridge changes to LinearRegression and the incrementals.

@@ -325,6 +325,15 @@ def _onedal_fit(self, X, y, sample_weight, queue=None):
self._onedal_estimator.fit(X, y, queue=queue)
self._save_attributes()

if sklearn_check_version("1.6"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you do this for Linear Regression and the related incremental algos so that they all behave the same/ reduce maintenance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure its relevant for the others, it originates from scikit-learn/scikit-learn#19746 which specifically addresses Ridge

Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/linear_model/tests/test_common.py#L197 Is the answer hidden within the linked PR. Place notes into LinearRegression and IncrementalLinearRegression about this deviation, and add this change in return values to IncrementalRidge.

@icfaust
Copy link
Contributor

icfaust commented Jun 12, 2025

@ethanglaser ping me directly once changes are made, so we can run private CI and merge this quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file testing Tests for sklearnex/daal4py/onedal4py & patching sklearn
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants