Skip to content

RESOLVED: Support Python Array API #54581

@emcastillo

Description

@emcastillo

🚀 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA request for a proper, new feature.module: python array apiIssues related to the Python Array APItriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions