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

PyTorch test failures #138

Closed asmeurer closed 3 months ago

asmeurer commented 3 months ago

A bunch of array-api-tests are failing with the latest version of PyTorch with RuntimeError: Promotion for uint16, uint32, uint64 types is not supported, attempted to promote Int and UInt16.

It seems PyTorch added support for uint16, but the support is limited:

>>> torch.equal(torch.tensor(0, dtype=torch.int32), torch.tensor(0, dtype=torch.uint16))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Promotion for uint16, uint32, uint64 types is not supported, attempted to promote Int and UInt16

See https://pytorch.org/docs/stable/tensors.html#id12

It would be useful if we could skip this dtype entirely in the test suite somehow. Otherwise we will basically need to xfail every two-argument function test.

asmeurer commented 3 months ago

These have been fixed in #140