-
-
Notifications
You must be signed in to change notification settings - Fork 25.5k
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
Drop support for the redundant and deprecated cupy.array_api
in favor of array_api_compat
.
#29639
Conversation
v1.6.rst already mentions |
Actually, Here is the error reported by our CUDA CI on CuPy inputs: AttributeError: module 'cupy.array_api' has no attribute 'clip'. Did you mean: 'flip'? EDIT: this is unexpected because the changelog of array-api-compat 1.8 explicitly mentions the EDIT 2: I also tried the following snippet after install import array_api_compat.cupy as xp
data = xp.linspace(0, 1, num=5)
xp.clip(data, 0.1, 0.9) Google Colab is running with CuPy 12.2.0 installed by default at the time of writing. EDIT 3: I understand what's going on: the We could either add a clip method to our internal Or alternatively we could decide to no longer run the tests for |
Since |
Since we have the confirmation from upstream that the experimental This removes quite a bit of complexity / technical debt and should also speed up our test suite by not testing for cupy twice. I will push an update to the changelog in a forthcoming commit. |
cupy.array_api
in favor of array_api_compat
.
# TODO: add cupy and cupy.array_api to the list of libraries once the | ||
# the following upstream issue has been fixed: | ||
# TODO: add cupy to the list of libraries once the the following upstream issue | ||
# has been fixed: | ||
# https://github.com/cupy/cupy/issues/8180 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewers: cupy/cupy#8180 was fixed and will be included in the next release (v14) but we still have to wait for the time being.
I believe this is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. I'm happy that we can finally remove _ArrayAPIWrapper
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you @ogrisel
…or of `array_api_compat`. (scikit-learn#29639)
While reviewing #29615 I realized that we don't necessarily need to maintain our own
sklearn.utils._array_api._clip
fallback since we can instead rely onarray-api-compat
in recent versions.It's still a bit verbose to use to correctly handle non-cpu devices with PyTorch but I think this should be fixed upstream:
EDIT: the scope of this PR has widened as explained in #29639 (comment).