Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test against PyTorch? CuPy? #82

Open
mdhaber opened this issue Jan 23, 2025 · 1 comment
Open

Test against PyTorch? CuPy? #82

mdhaber opened this issue Jan 23, 2025 · 1 comment

Comments

@mdhaber
Copy link
Owner

mdhaber commented Jan 23, 2025

I thought it would be sufficient to test against strict and numpy, but there may be value in testing against PyTorch and maybe even CuPy. Perhaps the data issue we just fixed is unique, but it's hard to tell without trying. At the very least, it will expose shortcomings in either array_api_compat, array_api_strict, or the Array API Standard documentation). For instance, I immediately ran into data-apis/array-api-compat#226 today, and also found:

# These all work with strict
# import array_api_strict as xp
from array_api_compat import torch as xp
x = xp.asarray(1, dtype=xp.uint32)
-x  # RuntimeError: "neg_cpu" not implemented for 'UInt32'
abs(x)  # RuntimeError: "abs_cpu" not implemented for 'UInt32'
~x  # RuntimeError: "bitwise_not_cpu" not implemented for 'UInt32'

@lucascolley any chance you'd be interested in taking this on? I ask because you've worked on getting SciPy tests running on other arrays.

@lucascolley
Copy link
Collaborator

yeah, we have some infrastructure for doing this in https://github.com/data-apis/array-api-extra/blob/main/tests/conftest.py and https://github.com/data-apis/array-api-extra/blob/main/src/array_api_extra/_lib/_backends.py. I agree that it is useful, and have the same planned for quantity-array.

Pretty busy at the moment so not sure when I'll get round to it, but I could probably have a go at tackling it at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants