Common APIs across array libraries (1 year later) · Issue #187 · data-apis/array-api (original) (raw)

Overview

Similar to gh-6, this issue looks to identify commonalities across array libraries, but only addresses those APIs which are not already included in the array API specification.

Since gh-6 and its analysis,

  1. Every array library added more APIs.
  2. Continued convergence toward NumPy APIs (CuPy, PyTorch, TensorFlow.experimental, MXNet).
  3. Greater agreement among accelerator libraries (e.g., CuPy, MXNet, Torch, TF) wrt special functions not available in NumPy, but available in SciPy.

Method

Similar to gh-6, the list was compiled by doing the following:

  1. Generating a list of APIs based on publicly documented array APIs (e.g., by scraping website documentation).
  2. Computing the intersection across the individual datasets.

The following libraries were analyzed:

APIs

The following APIs were found to be common across the above libraries, but not already included in the array API specification:

cbrt
clip
copysign
count_nonzero

deg2rad
diff

erf (scipy)
erfc (scipy)
erfinv (scipy)
erfcinv (scipy)
exp2

gamma (scipy)
gammaln (scipy)

histogram
hypot

i0 (bessel)

logsumexp (accelerators)

nextafter

pad

rad2deg
reciprocal
repeat
rot90
rsqrt (accelerators)
rcbrt (accelerators)

sigmoid (accelerators)

take
tile
top_k (accelerators+dask)

xlogy (scipy)

We can split the APIs into the following categories...

Array Manipulation

Special Functions

cbrt
clip
copysign
deg2rad
erf
erfc
erfcinv
erfinv
exp2
gamma
gammaln
hypot
i0
nextafter
rad2deg
reciprocal
rsqrt
rcbrt
sigmoid
xlogy

Reductions

count_nonzero
histogram
logsumexp
top_k

Indexing

Other

Next Steps