-
Notifications
You must be signed in to change notification settings - Fork 27.7k
RESOLVED: Support Python Array API #54581
Copy link
Copy link
Closed
Labels
featureA request for a proper, new feature.A request for a proper, new feature.module: python array apiIssues related to the Python Array APIIssues related to the Python Array APItriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Metadata
Metadata
Assignees
Labels
featureA request for a proper, new feature.A request for a proper, new feature.module: python array apiIssues related to the Python Array APIIssues related to the Python Array APItriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
🚀 Feature
Hi, we would like to discuss the PyTorch adoption of the recently proposed array-api: https://data-apis.org/array-api/latest/.
We are aware of the proposal in #54138 to adopt
__array_interface__in the PyTorch tensor but its main purpose seems to be eliminating the current PyTorch and numpy dependency.Motivation
The array API is similar to the
__array_interface__but extended beyond the realms of NumPy and providing support for accelerators. So it will ease the portability and reduce the burden of having to manage different interfaces such as DLPack or array interface depending on the device the array resides in.We are wondering if support for this API would be welcomed in PyTorch and we would like to actively develop it since we are also planning to implement this in CuPy and both projects could benefit from this.
Discussion points
One of the most important points to discuss is how would be adding support for this. Adding a submodule to ensure compatibility? in the same way that tensorflow added numpy compatibility
tensorflow.experimental.numpy.Or do we directly replace the current functions to be compatible with this API, but we break backward compatibility.
cc @mruberry @rgommers @heitorschueroff @albanD @kmaehashi @leofang @ezyang @apaszke