Description
The Python Array API standard was introduced in 2021. It provides a common interface for array libraries. Currently, pyribs is exclusively dependent on NumPy. However, I believe we could support using a wide variety of libraries like PyTorch, CuPy, JAX, etc. by switching to the Array API, particularly by using the array-api-compat package https://github.com/data-apis/array-api-compat
This seems to be becoming quite popular, with adoption from libraries like scipy (scipy/scipy#18867) and Gymnasium (Farama-Foundation/Gymnasium#1388) (albeit still experimental or at least work-in-progress).
As a starting point, I think it would be great to integrate this and get pyribs working with NumPy and PyTorch on a single component, e.g., a GridArchive. PyTorch seems like a good choice since we use it in many tutorials.
TODO
Description
The Python Array API standard was introduced in 2021. It provides a common interface for array libraries. Currently, pyribs is exclusively dependent on NumPy. However, I believe we could support using a wide variety of libraries like PyTorch, CuPy, JAX, etc. by switching to the Array API, particularly by using the
array-api-compatpackage https://github.com/data-apis/array-api-compatThis seems to be becoming quite popular, with adoption from libraries like scipy (scipy/scipy#18867) and Gymnasium (Farama-Foundation/Gymnasium#1388) (albeit still experimental or at least work-in-progress).
As a starting point, I think it would be great to integrate this and get pyribs working with NumPy and PyTorch on a single component, e.g., a GridArchive. PyTorch seems like a good choice since we use it in many tutorials.
TODO
xpobject is a module that cannot be pickled: Allow pickling classes that have the_xparray module attribute #644