-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
MNT: Update windows-2019 to windows-2022[wheel build] #28955
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
Conversation
close/reopen |
Put a triage label on this, as the deadline is coming up and there are problems. |
@h-vetinari Ping, because ISTR that you were involved last time we updated the windows version. |
The failures seem to mostly come from |
|
Thanks for the ping. The only place where this really becomes relevant is for linking to Given that VS2019 is EOL for over a year, and that VS2022 is an ABI-compatible update, this should not be an undue burden. The timing matches well, I've just picked up the proposal to move to VS2022 in conda-forge again. |
Isn't this snippet meant to make a Lines 569 to 577 in 3c995e7
|
Maybe related to #29039 which updates OpenBLAS |
Not AFAIU. That's about reusing/sharing the objects in the static library between MSVC and mingw, and the comment from the upstream devs at the time was
The virality of the msvc toolset concerns being able to link to something built with VS2022 (which - at least on paper - then also requires VS2022) |
Rather than latest, it would be better to explicitly use vs2022. |
@seiko2plus The |
Agreed, which means we need to update to the 2022 image in SciPy first before merging this. We should probably do that asap and then merge this and backport it to the 2.3.x branch. before releasing 2.3.0. Otherwise it'll become a potentially risky change in 2.3.1 or 2.3.2. |
8aa40c7
to
75079b9
Compare
75079b9
to
755cc38
Compare
Look like i need to skip spacing test for window |
087ca33
to
f33423f
Compare
Windows Server 2019: Uses older MSVC that generates FMA contractions by default This change significantly affects floating-point precision, especially for transcendental functions So we need to add the /fp:contract flag to MSVC builds. |
Note that meson shows FMA3 enabled, but evidently a flag is required for msvc in vs2022. I'm not clear on whether meson should handle that or not. Unfortunately, the |
.github/workflows/windows.yml
Outdated
@@ -119,7 +119,7 @@ jobs: | |||
|
|||
- name: Build and install | |||
run: | | |||
python -m pip install . -v -Ccompile-args="-j2" -Csetup-args="-Dallow-noblas=true" | |||
python -m pip install . -v -Ccompile-args="-j2" -Csetup-args="-Dallow-noblas=true" -Csetup-args="-Dc_args=/fp:contract" -Csetup-args="-Dcpp_args=/fp:contract" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would read better with a line continuation \
to break the line. Probably for the previous use as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be part of the meson flags when building SIMD code. I suggest moving it here:
numpy/meson_cpu/x86/meson.build
Line 214 in b353a18
FMA3.update(args: {'val': '/arch:AVX2', 'match': clear_arch}) |
.github/workflows/wheels.yml
Outdated
# Add compiler flags for 32-bit builds | ||
if ("${{ matrix.buildplat[1] }}" -eq "win32") { | ||
echo 'CIBW_CONFIG_SETTINGS=setup-args=-Dc_args="/fp:contract" setup-args=-Dcpp_args="/fp:contract"' >> $env:GITHUB_ENV | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extra flags should not be required after updating meson_cpu
.
You need to do the update this way:
|
isn't it overriding the args for FMA3 ?Correct me if i am wrong |
654c62e
to
4a09c91
Compare
Please have a review to this patch. |
meson_cpu/x86/meson.build
Outdated
|
||
# Add floating-point contract flag for 32-bit builds | ||
# Fixes transcendental function accuracy on Windows Server 2022 | ||
if cpu_family == 'x86' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is already under meson_cpu/x86/meson.build
, you don't need the if condition here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need the flag for 64-bit as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need the flag for 64-bit as well?
It doesn't seem required by us, but we probably do want it.
#29116 is working now. There is a bogus circleci failure that can be ignored. I'm curious if @r-devulap suggestion of putting the args in a list works. |
The PyPy failure can be ignored. |
3a5335f
to
4490065
Compare
@rgommers @charris @r-devulap |
meson_cpu/x86/meson.build
Outdated
|
||
# Add floating-point contract flag for 32-bit builds | ||
# Fixes transcendental function accuracy on Windows Server 2022 | ||
add_project_arguments('/fp:contract', language: ['c', 'cpp']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should depend on the existence of FMA. Note that add_project_arguments
is not used elsewhere in cpu specific contexts.
8f2916c
to
16a8390
Compare
meson_cpu/x86/meson.build
Outdated
@@ -211,7 +211,8 @@ if compiler_id == 'msvc' | |||
fet.update(args: '') | |||
endif | |||
endforeach | |||
FMA3.update(args: {'val': '/arch:AVX2', 'match': clear_arch}) | |||
# Add floating-point contract flag to fixes transcendental function accuracy on Windows Server 2022 | |||
FMA3.update(args: [{'val': '/arch:AVX2', 'match': clear_arch},{'val': '/fp:contract', 'match': clear_arch}]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets stick to the same way @charris fixed it in #29116:
FMA3.update(args: [{'val': '/arch:AVX2', 'match': clear_arch},{'val': '/fp:contract', 'match': clear_arch}]) | |
FMA3.update(args: {'val': '/arch:AVX2', 'match': clear_arch}) | |
FMA3.update(args: {'val': '/fp:contract'}) |
Tried it locally and confirmed that it picks up the flag correctly:
"command": "\"cl\" \"-Inumpy\\_core\\libloops_trigonometric.dispatch.h_AVX2.a.p\" \"-Inumpy\\_core\" \"-I..\\numpy\\_core\" \"-Inumpy\\_core\\include\" \"-I..\\numpy\\_core\\include\" \"-I..\\numpy\\_core\\src\\common\" \"-I..\\numpy\\_core\\src\\multiarray\" \"-I..\\numpy\\_core\\src\\npymath\" \"-I..\\numpy\\_core\\src\\umath\" \"-I..\\numpy\\_core\\src\\highway\" \"-IC:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\\Include\" \"-IC:\\Users\\RDEVULAP\\source\\repos\\numpy\\build\\meson_cpu\" \"/MD\" \"/nologo\" \"/showIncludes\" \"/utf-8\" \"/Zc:__cplusplus\" \"/W2\" \"/EHsc\" \"/std:c++17\" \"/permissive-\" \"/O2\" \"/Zi\" \"-DMS_WIN64=\" \"-DNPY_INTERNAL_BUILD\" \"-DHAVE_NPY_CONFIG_H\" \"-D_FILE_OFFSET_BITS=64\" \"-D_LARGEFILE_SOURCE=1\" \"-D_LARGEFILE64_SOURCE=1\" \"/O2\" \"-DNPY_HAVE_SSE2\" \"-DNPY_HAVE_SSE\" \"-DNPY_HAVE_SSE3\" \"-DNPY_HAVE_SSSE3\" \"-DNPY_HAVE_SSE41\" \"-DNPY_HAVE_POPCNT\" \"-DNPY_HAVE_SSE42\" \"-DNPY_HAVE_AVX\" \"-DNPY_HAVE_F16C\" \"-DNPY_HAVE_FMA3\" \"-DNPY_HAVE_AVX2\" \"/fp:contract\" \"/arch:AVX2\" \"-DNPY_MTARGETS_CURRENT=AVX2\" \"/Fdnumpy\\_core\\libloops_trigonometric.dispatch.h_AVX2.a.p\\src_umath_loops_trigonometric.dispatch.cpp.pdb\" /Fonumpy/_core/libloops_trigonometric.dispatch.h_AVX2.a.p/src_umath_loops_trigonometric.dispatch.cpp.obj \"/c\" ../numpy/_core/src/umath/loops_trigonometric.dispatch.cpp",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @r-devulap for confirmation .
Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
16a8390
to
2306bce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks @abhishek-iitmadras . |
As per info in : actions/runner-images#12045
We need to change window runner.