Skip to content

BUG: Fix compilation of halffloat with gcc 13.1#23711

Merged
seberg merged 1 commit into
numpy:mainfrom
seiko2plus:issue_23689
May 4, 2023
Merged

BUG: Fix compilation of halffloat with gcc 13.1#23711
seberg merged 1 commit into
numpy:mainfrom
seiko2plus:issue_23689

Conversation

@seiko2plus

Copy link
Copy Markdown
Member

closes #23689

@seiko2plus seiko2plus marked this pull request as ready for review May 4, 2023 09:34
@seiko2plus seiko2plus added 00 - Bug 36 - Build Build related PR C++ Related to introduction and use of C++ in the NumPy code base labels May 4, 2023
@seberg seberg changed the title Bug: Fix compilation of halffloat with gcc 13.1 BUG: Fix compilation of halffloat with gcc 13.1 May 4, 2023
@seberg

seberg commented May 4, 2023

Copy link
Copy Markdown
Member

Just to confirm, this is simply that our CI didn't have hardware that would run into it?

@seiko2plus

Copy link
Copy Markdown
Member Author

Just to confirm, this is simply that our CI didn't have hardware that would run into it?

No, it just matter of GCC compiler.

#if defined(NPY_HAVE_AVX512FP16)
__m128d md = _mm_load_sd(&f);
bits_ = static_cast<uint16_t>(_mm_cvtsi128_si32(_mm_castph_si128(_mm_cvtpd_ph(mf))));
bits_ = static_cast<uint16_t>(_mm_cvtsi128_si32(_mm_castph_si128(_mm_cvtpd_ph(md))));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nvm. I guess this is a fix unrelated to the issue...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually its related to this issue but appears after #23435

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NPY_HAVE_AVX512FP16/NPY_HAVE_AVX512_SPR seems to only supported by gcc-13

@seiko2plus seiko2plus May 4, 2023

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK, why CI intel_spr_sde_test didn't trigger this bug

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the missing SPR test issue bit us.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NPY_HAVE_AVX512_SPR is enabled with gcc >= 12.x. My nightly job picked up this failure with gcc-12 as well. See https://github.com/intel/x86-simd-sort/actions/runs/4879269275/jobs/8705679224.

The intel_spr_sde_test is disabled currently because of an SDE bug. I think what we could do is enable this CI just to build with gcc-12 without running the tests in the SDE.

@seberg seberg merged commit a16c0bd into numpy:main May 4, 2023
@charris

charris commented May 4, 2023

Copy link
Copy Markdown
Member

This fixes the build for me. Thanks Sayed.

@charris

charris commented May 4, 2023

Copy link
Copy Markdown
Member

Hmm, I suspect this has broken the clang wheel builds for Mac on Intel.

INFO: clang++: build/src.macosx-10.9-x86_64-3.9/numpy/core/src/npysort/simd_qsort_16bit.dispatch.avx512_spr.cpp
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: note: diagnostic msg:

See https://github.com/numpy/numpy/actions/runs/4885881750/jobs/8720521372.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

00 - Bug 36 - Build Build related PR C++ Related to introduction and use of C++ in the NumPy code base

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NumPy main fails to compile with gcc 13.1 on fedora 37

4 participants