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

2023.12 support #157

Closed asmeurer closed 1 month ago

asmeurer commented 2 months ago

I am implementing 2023.12 support here. Note that some things, like the changes to dlpack, will not be wrapped and will require upstream support.

Rather than focusing on one library at a time, my plan is to implement the most important functions first for each library, and potentially do a release with partial support. Once full support is implemented I will update __array_api_version__. So if anyone has any functions that they'd like for me to prioritize please note them here. I am going to start with the functions used by scipy at https://github.com/scipy/scipy/blob/main/scipy/_lib/_array_api.py.

Here is the checklist of functions from https://github.com/data-apis/array-api-tests/issues/249:

Here is the list of changes https://data-apis.org/array-api/latest/changelog.html#v2023-12

New Functions

API Changes

Other Changes

asmeurer commented 2 months ago

@lucascolley @mdhaber could you expand on what backend is missing minimum:

https://github.com/scipy/scipy/blob/fffcaa8c58b6909d22063c29e4f9593059a40230/scipy/_lib/_array_api.py#L478-L480

As far as I can tell, it's in numpy, torch, cupy, jax, and dask.array, so should already work. Is the issue that it's missing from array-api-strict?

mdhaber commented 2 months ago

Yes, probably implemented it because it was not in array-api-strict. I don't remember whether there were any other incompatibilities.

asmeurer commented 2 months ago

OK. I have 2023 strict support ready to go https://github.com/data-apis/array-api-strict/pull/35 (except for some annoying CI issues). I'll get a release out so you can use it.

mdhaber commented 2 months ago

Thanks!

lucascolley commented 2 months ago

searchsorted has also come up in SciPy, but personally happy to wait until full support.

asmeurer commented 2 months ago

I've just released array-api-strict with 2023.12 support. For now, it must be enabled manually using the new flags features https://data-apis.org/array-api-strict/api.html#module-array_api_strict._flags but once I'm confident there are no issues with it I'll make a release making 2023.12 the default in array-api-strict.

asmeurer commented 1 month ago

Merging what I have so far so I can do a release with partial support. Work on 2023.12 support will continue in another PR.