Skip to content

ENH Array API support for euclidean_distances and rbf_kernel - #29433

Merged
ogrisel merged 30 commits into
scikit-learn:mainfrom
OmarManzoor:array_api_euclidean_distances_rbf_kernel
Jul 11, 2024
Merged

ogrisel merged 30 commits into
scikit-learn:mainfrom
OmarManzoor:array_api_euclidean_distances_rbf_kernel

Conversation

@OmarManzoor

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Towards #26024

What does this implement/fix? Explain your changes.

  • Adds array api support for euclidean_distances and rbf_kernel

Any other comments?

@github-actions

github-actions Bot commented Jul 8, 2024 •

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 526d932. Link to the linter CI: here

@OmarManzoor

OmarManzoor commented Jul 9, 2024 •

Copy link
Copy Markdown
Contributor Author

@ogrisel Don't we have the latest version of array api strict on all CI pipelines? This seems to be failing for some pipelines probably because of the older version of array-api-strict, while it works fine on my local system with the latest version of array-api-strict. Should we fix this just for supporting an old version?

Comment thread sklearn/metrics/pairwise.py Resolved
@ogrisel

ogrisel commented Jul 9, 2024

Copy link
Copy Markdown
Member

@OmarManzoor let me update this PR with main after the merge of #29388.

Further CI fixes will follow-up once #29436 is reviewed and merged.

@OmarManzoor

OmarManzoor commented Jul 9, 2024 •

Copy link
Copy Markdown
Contributor Author

@ogrisel These CI errors seem a bit weird. One is related to the docstring of get_namespace_and_device. The other error is related to a casting issue which does not occur on my local system. Edit: I see that the second error is in a docstring. I am checking it.

Comment thread sklearn/metrics/pairwise.py Resolved
Comment thread sklearn/metrics/pairwise.py Resolved
Comment thread sklearn/utils/_array_api.py Resolved
Comment thread sklearn/utils/extmath.py Resolved
@ogrisel

ogrisel commented Jul 9, 2024 •

Copy link
Copy Markdown
Member

I thought I fixed that docstring failure somewhere else already.

EDIT: here it is:

https://github.com/scikit-learn/scikit-learn/pull/29318/files#diff-6264adab84df6fafdb2d950141783b52b718da1e1be773daae7b5921b2556f94R572

@OmarManzoor feel free to steal this from the Ridge PR since I won't have time to finalize it this week.

@ogrisel

ogrisel commented Jul 9, 2024

Copy link
Copy Markdown
Member

Please feel free to merge main into this branch to benefit from the fixes in #29436.

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I labeled "CUDA CI" to trigger a CI run with a CUDA GPU.

If everything is green, LGTM.

Comment thread sklearn/metrics/pairwise.py Resolved
Comment thread doc/modules/array_api.rst Resolved
Comment thread doc/modules/array_api.rst Resolved
Comment thread sklearn/utils/_array_api.py Resolved
Comment thread sklearn/utils/tests/test_array_api.py Resolved
@ogrisel ogrisel added CUDA CI and removed CUDA CI labels Jul 10, 2024
@ogrisel

ogrisel commented Jul 10, 2024

Copy link
Copy Markdown
Member

I tried to relabel this PR to trigger the CUDA CI out of curiosity but it's still waiting on workers for some unknown reason:

@adrinjalali adrinjalali left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Otherwise LGTM. Thanks @ogrisel for the ping.

Comment thread sklearn/metrics/pairwise.py Resolved
Comment thread sklearn/metrics/pairwise.py Resolved

@adrinjalali adrinjalali left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. I'll let @ogrisel have another look and merge.

@OmarManzoor

Copy link
Copy Markdown
Contributor Author

@ogrisel Can this be merged?

Comment thread sklearn/utils/_array_api.py Resolved
@ogrisel
ogrisel enabled auto-merge (squash) July 11, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants