data-apis / array-api-compat

Compatibility layer for common array libraries to support the Array API
https://data-apis.org/array-api-compat/
MIT License
69 stars 22 forks source link

maximum does not seem to work with `cupy.array_api` #160

Closed OmarManzoor closed 1 month ago

OmarManzoor commented 1 month ago

It seems that the function maximum is currently not available for cupy.array_api. It is present in the array api specification maximum and works for the other apis. Could this be made compatible for cupy.array_api as well?

lucascolley commented 1 month ago

Hey @OmarManzoor , this is a duplicate of gh-127. maximum was added to the standard in the 2023.12 version, and work on that is still in progress.

OmarManzoor commented 1 month ago

@lucascolley Thanks for the feedback!

asmeurer commented 1 month ago

What version of CuPy are you using? cupy has the maximum function https://docs.cupy.dev/en/latest/reference/generated/cupy.maximum.html. array_api_compat.cupy is just an extension of what is already in cupy, so if something is already in cupy there is nothing to do here.

Note that there is a difference between array_api_compat (this repo) and cupy.array_api. cupy.array_api is the cupy version of numpy.array_api, which has been removed from numpy in NumPy 2.0 and renamed to array-api-strict. cupy.array_api should not be used, unless you specifically need to test array API strictness with device support (see also https://github.com/data-apis/array-api-strict/issues/5).

asmeurer commented 1 month ago

This may also be useful to understand the difference https://data-apis.org/array-api-compat/#difference-between-array-api-compat-and-array-api-strict

OmarManzoor commented 1 month ago

Thank you for the clarifications.