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

Add `sparse` compatibility layer. #134

Closed hameerabbasi closed 3 months ago

hameerabbasi commented 4 months ago

This PR adds a compatibility layer for sparse.

hameerabbasi commented 3 months ago

Given that JAX also doesn't have CI and we already have CI for the Array API in sparse, I feel this is complete.

asmeurer commented 3 months ago

Can you update the docs. If you search for the places where JAX is mentioned you can also mention sparse there in the same way.

asmeurer commented 3 months ago

Also sparse can be added to the same the places where jax is tested in the tests.

hameerabbasi commented 3 months ago

Can you update the docs. If you search for the places where JAX is mentioned you can also mention sparse there in the same way.

Done in https://github.com/data-apis/array-api-compat/pull/134/commits/d3c6636bdcf878b98711373c9fab99b74b924f6d

Also sparse can be added to the same the places where jax is tested in the tests.

Done in https://github.com/data-apis/array-api-compat/pull/134/commits/855756d17727bb2998c846a7c9a230131a525e46

hameerabbasi commented 3 months ago

CI seems to fail with:

E           ImportError: Numba needs NumPy 1.22 or greater. Got NumPy 1.21.

I don't see how we can get around this; Numba is one of the requirements of sparse. We also dropped 3.9 before adding Array API support.

Edit: Only testing sparse for Py310+. See https://github.com/data-apis/array-api-compat/pull/134/commits/9c408674eb9cefc387d3fab96fa6cfdeedf79767.

hameerabbasi commented 3 months ago

The PyTorch failures seem to be unrelated to this PR, from a quick glance.

asmeurer commented 3 months ago

This page should be updated too https://github.com/data-apis/array-api-compat/blob/main/docs/supported-array-libraries.md

hameerabbasi commented 3 months ago

This page should be updated too https://github.com/data-apis/array-api-compat/blob/main/docs/supported-array-libraries.md

Done in https://github.com/data-apis/array-api-compat/pull/134/commits/b77472d1c9ec9c32b6932c7f2153da2f096071e0.

asmeurer commented 3 months ago

OK, this looks good. Let me know if you need this released soon. Otherwise, it might take a bit because I need to figure out what is going on with the PyTorch failures.