Skip to content

WIP: Use vs2022 in NumPy 2.3.x [wheel build] #29103

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

Closed
wants to merge 2 commits into from

Conversation

charris
Copy link
Member

@charris charris commented May 31, 2025

No description provided.

@charris
Copy link
Member Author

charris commented May 31, 2025

All the windows 32 bit wheel builds are failing in the computation of sin/cos, I suspect an SIMD problem. The windows no BLAS build fails the same way, makes me wonder if it also 32 bits.

Note that I disabled the spacing warnings test for all floats, which is why the 64 bit windows builds are passing.

@rdevulap Thoughts?

@charris
Copy link
Member Author

charris commented May 31, 2025

It might also be the case that all 'no BLAS' builds fail, both on 32 and 64 bit windows. Which seems strange, there seems no good reason that using BLAS should make a difference in the computation of sin/cos. Maybe something in the meson build?

@rgommers Thoughts on this?

@charris
Copy link
Member Author

charris commented May 31, 2025

Also, ping @stefanv for the meson build.

@rgommers
Copy link
Member

Cross-linking gh-28955 since that PR contains these same changes and also showed SIMD issues.

@rgommers
Copy link
Member

rgommers commented May 31, 2025

It doesn't look like it has anything to do with BLAS yes/no. All 32-bit builds are failing on:

  FAILED _core/tests/test_umath.py::TestAVXFloat32Transcendental::test_sincos_float32 - AssertionError: Arrays are not almost equal up to 2 ULP (max difference is 1.80991e+09 ULP)
  FAILED _core/tests/test_umath_accuracy.py::TestAccuracy::test_validate_fp16_transcendentals[cos] - AssertionError: Arrays are not almost equal up to 1 ULP (max difference is 2302 ULP)
  FAILED _core/tests/test_umath_accuracy.py::TestAccuracy::test_validate_fp16_transcendentals[sin] - AssertionError: Arrays are not almost equal up to 1 ULP (max difference is 1491 ULP)

That 32-bit builds don't use a scipy-openblas32 wheel isn't really relevant to these failures. Seems to me like a change in compiler version is likely causing these issues.

@rgommers
Copy link
Member

Ah, you meant the MSVC, x86 Python , no BLAS job - yes, it says x86 not x64 or x86-64 so that's a 32-bit job.

@charris
Copy link
Member Author

charris commented Jun 1, 2025

I suspect the primary failure is in test_umath.TestAVXFloat32Transcendental:test_sincos_float32.

@mattip
Copy link
Member

mattip commented Jun 1, 2025

Do we need to update the blocklist?

@charris
Copy link
Member Author

charris commented Jun 1, 2025

Do we need to update the blocklist

The errors are huge, much worse than the MS library is likely to return. I think the problem is with our SIMD implementation/dispatch. The fact that it is x86 specific is odd, I didn't think AVX was available on that platform. Disabling something on the 32 bit platform might work. I don't even know what the test is using for the computation. Meson enables the same SIMD support on both platforms.

On vs2022:

Enabled : SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL

On vs2019:

Enabled : SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL

Possibly a compiler bug

@abhishek-iitmadras
Copy link
Contributor

Do we need to update the blocklist

The errors are huge, much worse than the MS library is likely to return. I think the problem is with our SIMD implementation/dispatch. The fact that it is 32 specific is odd. Disabling something on 32 bits might work. I don't even know what the test is using for the computation. Meson enables the same SIMD support on both platforms.

On vs2022:

Enabled : SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL

On vs2019:

Enabled : SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL

Possibly a compiler bug

Maybe we need to disptach baseline SSE runtime on 32 bit and avoid SIMD path on those.

@charris
Copy link
Member Author

charris commented Jun 1, 2025

I note that meson enables a lot of SIMD that aren't likely available to 32 bit code, AVX in particular. Perhaps we are using some macro that has changed in vs2022.

@abhishek-iitmadras
Copy link
Contributor

abhishek-iitmadras commented Jun 1, 2025

Issue is solved now on my PR for MSVC no BLAS

@r-devulap
Copy link
Member

@charris were these tests passing when it was run on windows-2019 and failing only on windows-2022?

The ULP errors are extremely large AssertionError: Arrays are not almost equal up to 2 ULP (max difference is 1.80991e+09 ULP). I have seen this happen when FMA isn't used. That means we are using SIMD paths with Highway but not generating an FMA instruction. Still figuring out why.

@r-devulap
Copy link
Member

Looks like @abhishek-iitmadras already pointed to the problem: #28955 (comment) :)

@charris charris closed this Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants