You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Julia OpenBLAS build, we have been working towards enabling BFloat16 support (JuliaPackaging/Yggdrasil#7202). When we are building, we build against multiple gfortran libraries (3, 4, and 5), which means we have to build against older GCC versions - i.e. building for gfortran3 uses GCC 6. Unfortunately, using DYNAMIC_ARCH and BUILD_BFLOAT16=1 together in this case will trigger errors about AVX512 BFloat16 instructions/types being missing, i.e. errors like:
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c: In function ‘sbgemm_kernel_COOPERLAKE’:
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c:102:26: warning: implicit declaration of function ‘_mm512_dpbf16_ps’ [-Wimplicit-function-declaration]
[23:30:59] #define FMA(a, b, r) r = _mm512_dpbf16_ps(r, (__m512bh)a, (__m512bh)b)
[23:30:59] ^
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c:105:2: note: in expansion of macro ‘FMA’
[23:30:59] FMA(A_lo_##A, B_lo, result_00_##A##Bx##By); \
[23:30:59] ^~~
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c:214:47: note: in expansion of macro ‘MATMUL_4X’
[23:30:59] BROADCAST_B_PAIR(0, 0); PREFETCH_B(0, 0); MATMUL_4X(0, 0, 0);
[23:30:59] ^~~~~~~~~
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c:102:47: error: ‘__m512bh’ undeclared (first use in this function)
[23:30:59] #define FMA(a, b, r) r = _mm512_dpbf16_ps(r, (__m512bh)a, (__m512bh)b)
[23:30:59] ^
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c:105:2: note: in expansion of macro ‘FMA’
[23:30:59] FMA(A_lo_##A, B_lo, result_00_##A##Bx##By); \
[23:30:59] ^~~
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c:214:47: note: in expansion of macro ‘MATMUL_4X’
[23:30:59] BROADCAST_B_PAIR(0, 0); PREFETCH_B(0, 0); MATMUL_4X(0, 0, 0);
[23:30:59] ^~~~~~~~~
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c:102:47: note: each undeclared identifier is reported only once for each function it appears in
[23:30:59] #define FMA(a, b, r) r = _mm512_dpbf16_ps(r, (__m512bh)a, (__m512bh)b)
[23:30:59] ^
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c:105:2: note: in expansion of macro ‘FMA’
[23:30:59] FMA(A_lo_##A, B_lo, result_00_##A##Bx##By); \
[23:30:59] ^~~
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c:214:47: note: in expansion of macro ‘MATMUL_4X’
[23:30:59] BROADCAST_B_PAIR(0, 0); PREFETCH_B(0, 0); MATMUL_4X(0, 0, 0);
[23:30:59] ^~~~~~~~~
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c:105:6: error: expected ‘)’ before ‘A_lo_0’
[23:30:59] FMA(A_lo_##A, B_lo, result_00_##A##Bx##By); \
[23:30:59] ^
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c:102:56: note: in definition of macro ‘FMA’
[23:30:59] #define FMA(a, b, r) r = _mm512_dpbf16_ps(r, (__m512bh)a, (__m512bh)b)
[23:30:59] ^
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c:214:47: note: in expansion of macro ‘MATMUL_4X’
[23:30:59] BROADCAST_B_PAIR(0, 0); PREFETCH_B(0, 0); MATMUL_4X(0, 0, 0);
[23:30:59] ^~~~~~~~~
[23:30:59] ../kernel/x86_64/sbgemm_kernel_16x4_cooperlake.c:106:6: error: expected ‘)’ before ‘A_hi_0’
[23:30:59] FMA(A_hi_##A, B_lo, result_01_##A##Bx##By); \
[23:30:59] ^
The GCC flag detection logic is working, because GCC 6 doesn't support -march=cooperlake, so it falls back to -march=skylake-avx512 which is supported. However, the optimized BFloat16 kernels are still being compiled for Cooperlake even though the AVX512bf extension is not available.
Ideally, we would like this to fall back to compiling the generic BFloat16 kernels if the AVX512BF extensions aren't available, because that way the API for the library is constant across all the library versions we build.
The text was updated successfully, but these errors were encountered:
In the Julia OpenBLAS build, we have been working towards enabling BFloat16 support (JuliaPackaging/Yggdrasil#7202). When we are building, we build against multiple gfortran libraries (3, 4, and 5), which means we have to build against older GCC versions - i.e. building for gfortran3 uses GCC 6. Unfortunately, using DYNAMIC_ARCH and
BUILD_BFLOAT16=1
together in this case will trigger errors about AVX512 BFloat16 instructions/types being missing, i.e. errors like:The compile command used for this file was
The GCC flag detection logic is working, because GCC 6 doesn't support
-march=cooperlake
, so it falls back to-march=skylake-avx512
which is supported. However, the optimized BFloat16 kernels are still being compiled for Cooperlake even though the AVX512bf extension is not available.Ideally, we would like this to fall back to compiling the generic BFloat16 kernels if the AVX512BF extensions aren't available, because that way the API for the library is constant across all the library versions we build.
The text was updated successfully, but these errors were encountered: