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

Enabled free-threading multithread tests and added more skips #203

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vfdev-5
Copy link
Contributor

@vfdev-5 vfdev-5 commented Sep 17, 2024

Description:

When running stress tests as following:

while python -m pytest -n 50  -vvv; do :; done

We get more numpy errors:

FAILED ml_dtypes/tests/intn_test.py::ArrayTest::testCasts0_multi_threaded - TypeError: Cannot cast array data from dtype('float16') to dtype(int2) according to the rule 'unsafe'

FAILED ml_dtypes/tests/intn_test.py::ArrayTest::testCasts48_multi_threaded - TypeError: Cannot cast array data from dtype('complex64') to dtype(uint2) according to the rule 'unsafe'

FAILED ml_dtypes/tests/intn_test.py::ArrayTest::testCasts44_multi_threaded - TypeError: Cannot cast array data from dtype(uint2) to dtype('int8') according to the rule 'unsafe'

FAILED ml_dtypes/tests/intn_test.py::ArrayTest::testCasts69_multi_threaded - TypeError: Cannot cast array data from dtype('complex128') to dtype(uint4) according to the rule 'unsafe'


E       Traceback (most recent call last):
E         File "/usr/local/lib/python3.13t/dist-packages/numpy/_core/numeric.py", line 2476, in isclose
E           dt = multiarray.result_type(y, 1.)
E       RuntimeError: A cast was already added for <class 'numpy.dtypes.Float16DType'> -> <class 'numpy.dtype[float8_e5m2]'>. (method: legacy_cast)
E       
E       For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning

/usr/local/lib/python3.13t/dist-packages/pluggy/_callers.py:50: PluggyTeardownRaisedWarning
========================================================================================================= short test summary info =========================================================================================================
FAILED ml_dtypes/tests/finfo_test.py::FinfoTest::testFInfo_float8_e5m2_multi_threaded - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.


>         self.assertEqual(
              (float_type, d) in allowed_casts, np.can_cast(float_type, d)
          )
E         AssertionError: True != False

ml_dtypes/tests/custom_float_test.py:781: AssertionError
========================================================================================================= short test summary info =========================================================================================================
FAILED ml_dtypes/tests/custom_float_test.py::CustomFloatNumPyTest::testCanCast_float8_e8m0fnu_multi_threaded - AssertionError: True != False
FAILED ml_dtypes/tests/custom_float_test.py::CustomFloatNumPyTest::testCanCast_float8_e4m3fnuz_multi_threaded - AssertionError: True != False

Numpy code:

@jakevdp
Copy link
Collaborator

jakevdp commented Sep 17, 2024

Did you add all the skips from #188? If so, I think you should revert them: some of those were due to finfo being incompatible with multithreading, which is a real error rather than a testing issue (that's why I ended up abandoning #188 and temporarily disabling the multithread build instead).

@hawkinsp
Copy link
Collaborator

I don't follow

If so, I think you should revert them: some of those were due to finfo being incompatible with multithreading, which is a real error rather than a testing issue

The finfo problems are now fixed (at head numpy, anyway), right?

@jakevdp
Copy link
Collaborator

jakevdp commented Sep 17, 2024

The finfo problems are now fixed (at head numpy, anyway), right?

Yes - that's my point: some of the skips there were added due to finfo tests failing. We shouldn't copy all the skips from that PR to this PR, because some of them are no longer necessary.

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.

3 participants