You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when an operation is attempted on GPU and the operation is not supported by oneDAL, sklearnex will fall back straight away to sklearn on CPU, even if the operation might be supported by oneDAL on CPU.
This PR modifies the logic such that it will first check if the operation on CPU would be supported by oneDAL and fall back to it instead of to sklearn.
Along the way, it updates the docs about array API to reflect the current situation in unambiguous terms, and removes lots of outdated things in that page that no longer apply.
A few notes:
I'm not sure if oneDAL-CPU should have higher or lower priority than sklearn-arrayAPI. Currently, this will pass non-USM array-API inputs to sklearn without attempting a fallback to oneDAL-CPU, which I think is the most reasonable route.
I am not entirely sure that the mechanism here won't break any kind of contrived setup that's currently working. Please give it a thorough review.
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.
david-cortes-intel
changed the title
ENH: Try fallback to sklearnex-CPU from GPU calls before fallback to sklearn-CPU
ENH: Try fallback to sklearnex-CPU from GPU calls before fallback to sklearn-CPU + document array API behavior
Aug 29, 2025
❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
david-cortes-intel
changed the title
ENH: Try fallback to sklearnex-CPU from GPU calls before fallback to sklearn-CPU + document array API behavior
[WIP, do NOT merge yet] ENH: Try fallback to sklearnex-CPU from GPU calls before fallback to sklearn-CPU + document array API behavior
Sep 1, 2025
@david-cortes-intel Thanks for the work! If you wouldn't mind, could you split the docs changes off into a separate PR to simplify review/ focus theme/ speed integration? I know its still in draft, but just looking at the timeline for next week.
@david-cortes-intel Thanks for the work! If you wouldn't mind, could you split the docs changes off into a separate PR to simplify review/ focus theme/ speed integration? I know its still in draft, but just looking at the timeline for next week.
Sure, but this is not an urgent thing and not a high priority for the next release. It'd make more sense to first address the issue that we have with allow_fallback_to_host sometimes not working, otherwise the docs would have to describe a situation that's not very logical.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently, when an operation is attempted on GPU and the operation is not supported by oneDAL, sklearnex will fall back straight away to sklearn on CPU, even if the operation might be supported by oneDAL on CPU.
This PR modifies the logic such that it will first check if the operation on CPU would be supported by oneDAL and fall back to it instead of to sklearn.
Along the way, it updates the docs about array API to reflect the current situation in unambiguous terms, and removes lots of outdated things in that page that no longer apply.
A few notes:
Checklist:
Completeness and readability
Testing