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

Windows with AVX512F is failing a typing test #18496

Closed
mattip opened this issue Feb 26, 2021 · 3 comments · Fixed by #18497
Closed

Windows with AVX512F is failing a typing test #18496

mattip opened this issue Feb 26, 2021 · 3 comments · Fixed by #18497
Labels
05 - Testing 36 - Build Build related PR 41 - Static typing component: SIMD Issues in SIMD (fast instruction sets) code or machinery

Comments

@mattip
Copy link
Member

mattip commented Feb 26, 2021

From the numpy-wheels repo, see this comment. The windows runs have been failing since Feb 14. The failing test is in static typing:

with pytest.raises(np.ComplexWarning):
>       np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=float, casting="unsafe", out=OUT_c)
E       Failed: DID NOT RAISE <class 'numpy.ComplexWarning'>

and occurs with an Azure machine that reports

NumPy CPU features: SSE SSE2 SSE3 SSSE3* SSE41* POPCNT* SSE42* AVX* F16C* \
    FMA3* AVX2* AVX512F* AVX512CD* AVX512_SKX* AVX512_CLX? AVX512_CNL?

where the machines in the regular CI report

NumPy CPU features: SSE SSE2 SSE3 SSSE3* SSE41* POPCNT* SSE42* AVX* F16C* \
    FMA3* AVX2* AVX512F? AVX512CD? AVX512_SKX? AVX512_CLX? AVX512_CNL?

Note the AVX512F, AVX512CD, AVX512_SKX difference.

@seiko2plus, @BvB93 ideas? Is there a way to reproduce this with concrete types?

I am not sure what the difference is between the CI configuration and why they are getting different machines. A successful run log is here, a failure is here

@mattip mattip added 05 - Testing 36 - Build Build related PR component: SIMD Issues in SIMD (fast instruction sets) code or machinery 41 - Static typing labels Feb 26, 2021
@BvB93
Copy link
Member

BvB93 commented Feb 26, 2021

The test in question seems to fail at runtime (see the simplified version below).

It could be modified such that it no longer uses the complex out array (which is not strictly necessary here),
but it does nevertheless raise the question why no ComplexWarning is issued in the numpy-wheels tests.

import numpy as np
import pytest

AR_LIKE_U = ["1", "2", "3"]
OUT_c = np.empty(3, dtype=np.complex128)

with pytest.raises(np.ComplexWarning):
    np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=float, casting="unsafe", out=OUT_c)

@charris
Copy link
Member

charris commented Feb 26, 2021

Probably want to keep the issue open even if the typing test is fixed.

@seberg
Copy link
Member

seberg commented Feb 26, 2021

So one potential issue is that the test would make more sense to me if it used pytest.warns. pytest.warns should set up the warning fitlers to "always" to ensure the warning cannot be set to ignore (similar to warnings.catch_warnings). But pytest.raises likely will not bother with "fixing" the warning filters.
The problem is that if this warning – for whatever weird reason – was ignored elsewhere and the warning-filters were not "reset" properly (which probably should not happen, but it might be that e.g. pytest relies on the fact that the warnings are "reset" whenever a warning test is entered), then it will remain "ignored" on the raises context.

Basically, to use pytest.raises correctly, you probably have to first make sure that this warning is turned into an error. That said, there may well be more weirdness going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
05 - Testing 36 - Build Build related PR 41 - Static typing component: SIMD Issues in SIMD (fast instruction sets) code or machinery
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants