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

Tighten tests on iinfo/finfo #358

Merged
merged 3 commits into from
Apr 8, 2025
Merged

Conversation

crusaderky
Copy link
Contributor

@crusaderky crusaderky commented Apr 2, 2025

  • test iinfo/finfo vs array input
  • test output object

NOTE

This makes array-api-compat explode. Needs prerequisite PR data-apis/array-api-compat#294
CI will fail here until the next array-api-strict release, when it will pick up data-apis/array-api-strict#135

array_api_strict git tip
================================================================
(all green)

array_api_strict 2.3.1 (CI below)
================================================================
- array inputs fail (https://github.com/data-apis/array-api-strict/pull/143)
- dtype is a numpy dtype (https://github.com/data-apis/array-api-strict/pull/135)

array_api_compat.numpy (array-api-compat git tip, numpy 2.2)
================================================================
FAILED array_api_tests/test_data_type_functions.py::test_finfo[float32-dtype] - AssertionError: type(out.eps)=<class 'numpy.float32'>, but should be float [finfo(float32)]
FAILED array_api_tests/test_data_type_functions.py::test_finfo[complex64-dtype] - AssertionError: type(out.eps)=<class 'numpy.float32'>, but should be float [finfo(complex64)]
FAILED array_api_tests/test_data_type_functions.py::test_finfo[*-array] - ValueError: data type <class 'numpy.object_'> not inexact
FAILED array_api_tests/test_data_type_functions.py::test_iinfo[*-array] - ValueError: Invalid integer data type 'O'.

array_api_compat.dask.array (array-api-compat git tip)
================================================================
FAILED array_api_tests/test_data_type_functions.py::test_finfo[float32-*] - AssertionError: type(out.eps)=<class 'numpy.float32'>, but should be float [finfo(float32)]
FAILED array_api_tests/test_data_type_functions.py::test_finfo[complex64-*] - AssertionError: type(out.eps)=<class 'numpy.float32'>, but should be float [finfo(complex64)]

array_api_compat.cupy (array-api-compat git tip)
================================================================
FAILED array_api_tests/test_data_type_functions.py::test_finfo[float32-*] - AssertionError: type(out.eps)=<class 'numpy.float32'>, but should be float [finfo(float32)]
FAILED array_api_tests/test_data_type_functions.py::test_finfo[complex64-*] - AssertionError: type(out.eps)=<class 'numpy.float32'>, but should be float [finfo(complex64)]

array_api_compat.torch (array-api-compat git tip)
================================================================
FAILED array_api_tests/test_data_type_functions.py::test_finfo[dtype0-dtype] - AssertionError: assert 'float32' == torch.float32
FAILED array_api_tests/test_data_type_functions.py::test_finfo[dtype1-dtype] - AssertionError: assert 'float64' == torch.float64
FAILED array_api_tests/test_data_type_functions.py::test_finfo[dtype2-dtype] - AssertionError: assert 'float32' == torch.float32
FAILED array_api_tests/test_data_type_functions.py::test_finfo[dtype3-dtype] - AssertionError: assert 'float64' == torch.float64
FAILED array_api_tests/test_data_type_functions.py::test_iinfo[dtype0-dtype] - AssertionError: assert 'int8' == torch.int8
FAILED array_api_tests/test_data_type_functions.py::test_iinfo[dtype1-dtype] - AssertionError: assert 'int16' == torch.int16
FAILED array_api_tests/test_data_type_functions.py::test_iinfo[dtype2-dtype] - AssertionError: assert 'int32' == torch.int32
FAILED array_api_tests/test_data_type_functions.py::test_iinfo[dtype3-dtype] - AssertionError: assert 'int64' == torch.int64
FAILED array_api_tests/test_data_type_functions.py::test_iinfo[dtype4-dtype] - AssertionError: assert 'uint8' == torch.uint8
FAILED array_api_tests/test_data_type_functions.py::test_iinfo[dtype5-dtype] - AssertionError: assert 'uint16' == torch.uint16
FAILED array_api_tests/test_data_type_functions.py::test_iinfo[dtype6-dtype] - AssertionError: assert 'uint32' == torch.uint32
FAILED array_api_tests/test_data_type_functions.py::test_iinfo[dtype7-dtype] - AssertionError: assert 'uint64' == torch.uint64
FAILED array_api_tests/test_data_type_functions.py::test_iinfo[*-array] - TypeError: iinfo(): argument 'type' (position 1) must be torch.dtype, not Tensor

@crusaderky crusaderky marked this pull request as ready for review April 2, 2025 16:08
@crusaderky crusaderky changed the title DNM Tighten tests on iinfo/finfo Tighten tests on iinfo/finfo Apr 2, 2025
@crusaderky
Copy link
Contributor Author

crusaderky commented Apr 7, 2025

Suggested merge order:

  1. merge array-api-compat PR
  2. wait for next array-api-strict release
  3. merge array-api-tests PR

@ev-br
Copy link
Member

ev-br commented Apr 8, 2025

Not sure we want an out-of-band array-api-strict release just for this. How about adding the failing tests to the skip list for the time being.

@crusaderky
Copy link
Contributor Author

Done. pre-commit error is unrelated.

@ev-br ev-br merged commit b1cec12 into data-apis:master Apr 8, 2025
2 of 3 checks passed
@ev-br
Copy link
Member

ev-br commented Apr 8, 2025

Thanks Guido, merged now.

I'll take a look at the lintrunner error. These things are meant to be helpful, no?

@crusaderky crusaderky deleted the finfo_iinfo branch April 8, 2025 17:37
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

Successfully merging this pull request may close these issues.

2 participants