8000 array API support for cosine_distances by EmilyXinyi · Pull Request #29265 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

array API support for cosine_distances #29265

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

Merged
merged 23 commits into from
Jul 12, 2024

Conversation

EmilyXinyi
Copy link
Contributor

Reference Issues/PRs

towards #26024

What does this implement/fix? Explain your changes.

array API support for cosine_distances

Any other comments?

.clip is supported in the 2023.12 version but not the one that we are currently using, so I created a function in sklearn.utils._array_api for now
.fill_diagonal is not supported and I don't see it being in the plan of being supported in the array-api repo, so I created an alternative ._fill_diagonal in sklearn.metrics.pairwise
Please let me know if there are any changes I should make, thanks!

Copy link
github-actions bot commented Jun 14, 2024

✔️ Linting Passed

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

Generated for commit: e7d5839. Link to the linter CI: here

Copy link
Member
@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

Here is some feedback. Please also test that this works on cuda devices with PyTorch and CuPy using:

https://gist.github.com/EdAbati/ff3bdc06bafeb92452b3740686cc8d7c

@EmilyXinyi
Copy link
Contributor Author

@ogrisel
Copy link
Member
ogrisel commented Jun 20, 2024

Merging main to hopefully get a green CI on this PR.

Copy link
Member
@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @EmilyXiny!

Copy link
Contributor
@OmarManzoor OmarManzoor left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @EmilyXinyi. A few comments otherwise looks good.

@EmilyXinyi EmilyXinyi force-pushed the array_API_cosine_distance branch from da921c4 to 12d5569 Compare July 8, 2024 12:44
@ogrisel ogrisel added Waiting for Reviewer Waiting for Second Reviewer First reviewer is done, need a second one! labels Jul 11, 2024
@lesteve lesteve added CUDA CI and removed CUDA CI labels Jul 12, 2024
@OmarManzoor OmarManzoor removed Waiting for Second Reviewer First reviewer is done, need a second one! Waiting for Reviewer labels Jul 12, 2024
@OmarManzoor OmarManzoor enabled auto-merge (squash) July 12, 2024 12:53
Copy link
Contributor
@OmarManzoor OmarManzoor left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @EmilyXinyi

@OmarManzoor OmarManzoor merged commit 1813b4a into scikit-learn:main Jul 12, 2024
28 checks passed
@EmilyXinyi EmilyXinyi deleted the array_API_cosine_distance branch August 12, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants
0