Repository navigation
Open
Open
Feature
Copy link
Labels
Array APIHigh PriorityHigh priority issues and pull requestsMeta-issueGeneral issue associated to an identified list of tasksNeeds DecisionRequires decision
Description
Warning
This issue is not yet ready for a PR. If you are interested in contributing to scikit-learn, please have a look at our contributing guidelines, and in particular the sections for new contributors and the "Needs triage" label.
Here is a review of popular/important estimators for which we already have partial array API support or for which underlying code already have significant array API coverage. Before extending support to entirely new estimators, it might be important to put some priority in making those estimators fully compliant to reduce user friction and simplify array API adoption as a result and grab low hanging fruits.
-
Ridge,RidgeClassifier- Missing setting:
solver="cholesky"(autois forced to SVD and warns) - Difficulty: Medium. Gram matrix on device,
xp.linalg.solve. Singular fallback differs per library. - User value: High. SVD on GPU is often significantly slower than NumPy Cholesky on CPU.
- Tracking:
- Missing setting:
-
LogisticRegression,PoissonRegressor- Missing setting:
solver="newton-cholesky" - Difficulty: Medium. Python solver, NumPy Hessian buffers,
scipy.linalg.solve. Shared implementation. The handling of the exceptions potentially raised byscipy.linalg.solvecan probably be factorized with what is proposed in ENH Ridge: supportsolver="cholesky"for array API inputs #35418. - User value: High for logistic (large-sample L2). Medium for Poisson.
- Tracking:
- Meta issue: META: Christian's plan for linear models #33537
- No dedicated PR.
- Missing setting:
-
GammaRegressor/TweedieRegressor- Missing setting: array API not supported yet but shares a lot of common code with
PoissonRegressor - Difficulty: Low once previous items are addressed (incremental change).
- User value: Medium (less commonly used than
LogisticRegressionorRidgebut useful in several industrial settings as demonstrated in our example gallery).
- Missing setting: array API not supported yet but shares a lot of common code with
LogisticRegression- Missing setting:
newton-cd/newton-cd-gram(whatautopicks whenl1_ratio > 0) - Difficulty: High. Inner step is Cython coordinate descent but the
X.T @ h_diag @ Xsandwich product innewton-cd-gramwould likely benefit from a tiled array API implementation even if the rest of the update is written in Cython. For thenewton-cdsolver that relies on a sequence of matvecs involvingX, so I am not so sure if array API support can help in this case. It would require some investigation. - User value: Medium (only if you need L1 or elastic-net). The L2 default already works.
- Tracking: No issue.
- Missing setting:
CalibratedClassifierCV- Missing setting:
method="sigmoid"(the default). - Difficulty: Medium. Platt scaling is a two-scalar L-BFGS fit that still uses NumPy.
- User value: High. The default method fails under array API dispatch.
- Tracking:
- Issue #31869. Temperature is done.
- No PR for sigmoid.
- Note:
method="isotonic"is implemented in Cython and not likely to be efficiently implemented via array API.
- Missing setting:
GaussianMixture- Missing setting:
init_params="kmeans"(the default) and"k-means++" - Difficulty: High. Both call NumPy
KMeans; Lloyd is Cython. - User value: High. The default constructor is rejected. The quality of GMM fit can be degraded when using a random init.
- Tracking:
- No GMM issue for array API support of the init.
- Depends on array API support for
KMeansandkmeans_plusplus: RFC #35238 and draft PR #35382.
- Missing setting:
GaussianMixture- Missing setting: numerical stability for
float32data. - User value: Medium. Some GPU devices only work (or work much faster) with
float32operations so numerical stability is needed to unlock array API value for this estimator. - Tracking:
- Missing setting: numerical stability for
KernelRidge- Missing setting: no array API support yet but the bottleneck (kernel computation and linear algebra operations) already have array API compliant implementations.
- User value: Low to Medium. not so commonly used but I suppose a GPU implementation might be make it more popular given the expected speed-ups.
- Tracking:
- No issue/PR yet.
EmpiricalCovariance- Missing setting: no array API support for this covariance estimator but related classes in the same module already have it.
- User value: Medium. Used by a scientific downstream library that depends on scikit-learn and started to adopt array API support for covariance estimation to benefit from GPU acceleration.
- Tracking:
Metadata
Metadata
Assignees
Labels
Array APIHigh PriorityHigh priority issues and pull requestsMeta-issueGeneral issue associated to an identified list of tasksNeeds DecisionRequires decision
Type
Projects
- StatusShow more project fieldsIn Progress
Activity
ogrisel commentedon Nov 17, 2026
Note that some of the above plan overlaps with:
github-actions commentedon Nov 17, 2026
Thanks for the work you've done so far. The goal of this comment is to set expectations.
Deciding on new features or substantial changes is a lengthy process. It frequently happens that no maintainer is available to take on this task right now.
Please do not create a Pull Request before a decision has been made regarding the proposed work. Making this decision can often take a significant amount of time and effort.
ogrisel commentedon Nov 17, 2026
I labeled this a High Priority because making progress on array API adoption and hardware acceleration is important for several financial supporters of scikit-learn (NVidia, Intel, Probabl and NASA ROSES) and, I hope, also for future scikit-learn users once array API dispatch is enabled by default.
I labeled as "Need decision" because the priority statements and ordering of those items are mostly mine augmented by feedback by participants to the bi-weekly array API meeting.
lcrmorin commentedon Nov 22, 2026
I'd like to contribute.
ogrisel commentedon Nov 23, 2026
Do you mean add array API support to existing solvers as described in the issue? Or prototyping alternative solvers?
If the former, check that nobody has already opened the PR you have in mind. Try to keep the PRs focussed on one particular solver and make sure to update the existing estimator-specific array API compliance tests and add a new
"check_array_api_input"-keyed entry with the new solver to thePER_ESTIMATOR_CHECK_PARAMSdict to get the common test to run that check with that solver.Which particular solver do you have in mind. I think "newton-cholesky" can be targeted next since #35418 was recently merged in
mainand we can reuse some of its handling ofxp.linalg.solveexceptions, unless @lorentzenchr had already planned to work on it (see #33537).I would like to decouple adding the support of array API for existing solvers from adding a new way to fit logreg models. Adding new methods is subject to the inclusion criteria but it could be considered for inclusion if this solves the same objective function much better than existing alternatives in scikit-learn on relevant problems.
Sure, there are dependencies between some of the above items. But better write smaller more focussed PRs to have a better chance of getting them reviewed and merged in a timely manner. I would rather not open a PR for something that depends on the merge of another PR. Rather explain in the description of the first small PR that you have a plan for a possible follow-up once the first is merged.
lcrmorin commentedon Nov 24, 2026
Hi Olivier,
For context, I was benchmarking different stuff, aiming at faster auto / new models. Not to be used here, but it might be worth a mention. I think my newton-cholesky and newton-cd-gram can be reused here.
The newton-cholesky branch reuses Ridge’s Array API solve helper from ENH Ridge: support
solver="cholesky"for array API inputs #35418 and preserves the L-BFGS fallback.The newton-cd-gram branch builds the weighted Gram matrix in tiles on the device and reuses the existing Cython coordinate-descent step on CPU. Currently it relies on the hessian handling of newton-cholesky.
Does this stagging make sense ? would you prefer to have the path better separated ?
Do these make sense ? Isn't there something that can be done for mac users ?
How can we embark these changes in benchmark / CI ?
I'll work on my two PRs to match the testing standard you mentionned. But maybe it is worth having in mind already where the stuff can be reused.
betatim commentedon Nov 24, 2026
The best way to discuss proposed implementation(s) is to open a PR. You can mark it as draft to indicate that it is still work in progress. I'd open one targeted PR and put effort into the description of the change. This helps increase the chances of people taking the time to review it swiftly
lcrmorin commentedon Nov 27, 2026
Ok there was a bit of a semantic issue (the issue still warns about it being not ready for a PR), but I went for it. The topics of discussion are noted in the description.