Skip to content

ENH: Create logistic regression oneDAL object on the fly for predictions after fallbacks#3114

Open
david-cortes-intel wants to merge 9 commits into
uxlfoundation:mainfrom
david-cortes-intel:logreg_model_from_coef
Open

ENH: Create logistic regression oneDAL object on the fly for predictions after fallbacks#3114
david-cortes-intel wants to merge 9 commits into
uxlfoundation:mainfrom
david-cortes-intel:logreg_model_from_coef

Conversation

@david-cortes-intel
Copy link
Copy Markdown
Contributor

Description

This PR changes the logic of logistic regression on GPU to use oneDAL for predictions even if the model was fitted through scikit-learn, by creating a oneDAL object on-the-fly from the fitted coefficients.


Checklist:

Completeness and readability

  • I have commented my code, particularly in hard-to-understand areas.
  • 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.

@david-cortes-intel
Copy link
Copy Markdown
Contributor Author

/intelci: run

@david-cortes-intel
Copy link
Copy Markdown
Contributor Author

/azp run Nightly

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 16.00000% with 21 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
onedal/linear_model/logistic_regression.py 12.50% 14 Missing ⚠️
sklearnex/linear_model/logistic_regression.py 22.22% 7 Missing ⚠️
Flag Coverage Δ
github 80.11% <16.00%> (-0.22%) ⬇️

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

Files with missing lines Coverage Δ
sklearnex/linear_model/logistic_regression.py 45.26% <22.22%> (-0.69%) ⬇️
onedal/linear_model/logistic_regression.py 31.94% <12.50%> (-5.56%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Vika-F
Copy link
Copy Markdown
Contributor

Vika-F commented Apr 28, 2026

From the description it is not clear which problem does this PR solve? I.e. what's wrong with the current approach?
Is it also related to 'everything follows X' issue?

@david-cortes-intel
Copy link
Copy Markdown
Contributor Author

From the description it is not clear which problem does this PR solve? I.e. what's wrong with the current approach? Is it also related to 'everything follows X' issue?

Scikit-learn also supports array API, so there can be cases where .fit() falls back to scikit-learn, but then .predict() still meets the conditions to offload to oneDAL, other than there not being a oneDAL object.

Apart from that, this should also make it easier later on to implement move_estimator_to.

@ethanglaser
Copy link
Copy Markdown
Contributor

/intelci: run

@ethanglaser
Copy link
Copy Markdown
Contributor

Looks like there are some GPU test fails to be addressed in private CI

@david-cortes-intel
Copy link
Copy Markdown
Contributor Author

/intelci: run

@david-cortes-intel david-cortes-intel marked this pull request as draft May 5, 2026 06:00
@david-cortes-intel
Copy link
Copy Markdown
Contributor Author

/intelci: run

@ethanglaser
Copy link
Copy Markdown
Contributor

Looks like there is still a private CI test fail (AttributeError: 'numpy.ndarray' object has no attribute 'device') for py3.10 GPU tests - at least the error message there coincides with the changes here

@david-cortes-intel
Copy link
Copy Markdown
Contributor Author

/intelci: run

@david-cortes-intel
Copy link
Copy Markdown
Contributor Author

/intelci: run

@david-cortes-intel
Copy link
Copy Markdown
Contributor Author

/intelci: run

@david-cortes-intel david-cortes-intel marked this pull request as ready for review May 14, 2026 06:44
@david-cortes-intel
Copy link
Copy Markdown
Contributor Author

/intelci: run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

oneAPI sklearn-patch sklearn patching

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants