Skip to content

Fix changed return type dtype for array API - #29488

Merged
lesteve merged 3 commits into
scikit-learn:mainfrom
betatim:fix-array-api-dtype
Jul 15, 2024
Merged

lesteve merged 3 commits into
scikit-learn:mainfrom
betatim:fix-array-api-dtype

Conversation

@betatim

@betatim betatim commented Jul 15, 2024

Copy link
Copy Markdown
Member

This (attempts to) fixes the failure in #29373 (comment)

The failing test shows that the returned array has a different dtype from the input.

@github-actions

github-actions Bot commented Jul 15, 2024 •

Copy link
Copy Markdown

✔️ Linting Passed

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

Generated for commit: 569ab2b. Link to the linter CI: here

@OmarManzoor

Copy link
Copy Markdown
Contributor

@betatim I think the CUDA CI is currently failing because the array-api-strict is not updated to the latest version in the CUDA CI. Either we need to update the version or change how we handle maximum as its available in the latest version but not in prior ones.

@OmarManzoor OmarManzoor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks @betatim

@betatim

betatim commented Jul 15, 2024

Copy link
Copy Markdown
Member Author

@betatim I think the CUDA CI is currently failing because the array-api-strict is not updated to the latest version in the CUDA CI. Either we need to update the version or change how we handle maximum as its available in the latest version but not in prior ones.

I thought that updating the lockfile (as I did in this PR) would not fix it, but it seems like it did?

I think supporting more than the latest version of array-api-strict is not wort the effort. The reason for that is that it isn't meant to be used by humans (like Numpy or cupy) but only for testing how compliant your use of the array API is. So I think if there are no errors in the latest version, we are good. What do you think?

The unsovled mystery for me is why the array-api-strict related error went away in this PR? What change did I make that lead to a newer version of it being installed?

@OmarManzoor

OmarManzoor commented Jul 15, 2024 •

Copy link
Copy Markdown
Contributor

I think supporting more than the latest version of array-api-strict is not wort the effort. The reason for that is that it isn't meant to be used by humans (like Numpy or cupy) but only for testing how compliant your use of the array API is. So I think if there are no errors in the latest version, we are good. What do you think?

The unsovled mystery for me is why the array-api-strict related error went away in this PR? What change did I make that lead to a newer version of it being installed?

I agree with you and I think we went with the implementation based on considering the latest version of the api. I think the error is now fixed because the lock file is updated and the supported version in the lock file is now == 2.0.1. Previously array-api-strict was == 1.1.1 in the lock file and that version does not support the maximum function.

@betatim

betatim commented Jul 15, 2024

Copy link
Copy Markdown
Member Author

Ergh. I looked at the lockfile diff twice and couldn't spot array-api-strict. Thanks for finding it for me.

@lesteve should we merge this or #29373 (comment) and then this. Or something else completely?

@lesteve
lesteve merged commit bed36b2 into scikit-learn:main Jul 15, 2024
@lesteve

lesteve commented Jul 15, 2024

Copy link
Copy Markdown
Member

Let's merge this and close #29373.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants