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

i386 attempts to compile AVX512BF16, but it should be disabled #2214

Closed
jan-wassenberg opened this issue May 30, 2024 · 2 comments
Closed

i386 attempts to compile AVX512BF16, but it should be disabled #2214

jan-wassenberg opened this issue May 30, 2024 · 2 comments

Comments

@jan-wassenberg
Copy link
Member

Debian build log

The compile error is because HWY_AVX3_HAVE_F32_TO_BF16C is set, which is gated by

#if HWY_TARGET <= HWY_AVX3_ZEN4 && !HWY_COMPILER_CLANGCL &&           \
    (HWY_COMPILER_GCC_ACTUAL >= 1000 || HWY_COMPILER_CLANG >= 900) && \
    !defined(HWY_AVX3_DISABLE_AVX512BF16)

HWY_TARGET should not be AVX2 or below because we set

#if HWY_ARCH_X86_32 // i.e. defined(__i386__) || defined(_M_IX86)
#define HWY_BROKEN_32BIT (HWY_AVX2 | (HWY_AVX2 - 1))

Unfortunately godbolt seems to have dropped i386 gcc. Our 32-bit builder works, and indeed sets HWY_BROKEN_TARGETS correctly:

CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 CXX=g++ CC=gcc cmake .. -DHWY_WARNINGS_ARE_ERRORS:BOOL=ON -DHWY_CMAKE_SSE2:BOOL=ON  -DCMAKE_BUILD_TYPE=Release

@malaterre , can you help me understand the difference, or how we are mis-detecting i386?

@malaterre
Copy link
Contributor

@jan-wassenberg
Copy link
Member Author

Ah, got it, thanks :)
If we want to enable AVX2 for GCC13 that's fine, but AVX3 is definitely going to be a problem, as the build failure here shows. We can change your patch to disable HWY_AVX3 | (HWY_AVX3 - 1) i.e. AVX3 and any better.

Then I think this issue is resolved.

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

No branches or pull requests

2 participants