AVX512 supported on CASCADE

197 views
Skip to first unread message

Jam Chan

unread,
Feb 19, 2020, 10:44:12 PM2/19/20
to OpenBLAS-users
Is there any branch or version OpenBLAS can support AVX512 on CASCADE CPU ?
Look like that now is only avx2 available, if it is possible to compile OpenBlas to AVX 512 on CASCADE CPU ?

shan kang

unread,
Feb 20, 2020, 1:08:40 AM2/20/20
to OpenBLAS-users
Yes. It supports AVX512. You can specify "TARGET=SKYLAKEX" when you compile.

在 2020年2月20日星期四 UTC+8上午11:44:12,Jam Chan写道:

Jam Chan

unread,
Feb 20, 2020, 2:12:56 AM2/20/20
to OpenBLAS-users
I already tried compile OpenBLAS with "TARGET=SKYLAKEX", but the make.log, it looks like compiled with -mavx2, not -march=skylake-avx512

# make TARGET=SKYLAKEX
make[1]: Entering directory `/storage/softwares/hpl/Opensource/OpenBLAS-0.3.8/interface'
cc -O2 -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DNO_AVX512 -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=40 -DMAX_PARALLEL_NUMBER=1 -DVERSION=\"0.3.8\" -mavx2 -DASMNAME=saxpy -DASMFNAME=saxpy_ -DNAME=saxpy_ -DCNAME=saxpy -DCHAR_NAME=\"saxpy_\" -DCHAR_CNAME=\"saxpy\" -DNO_AFFINITY -I.. -I. -UDOUBLE  -UCOMPLEX -c axpy.c -o saxpy.o


在 2020年2月20日星期四 UTC+8下午2:08:40,shan kang写道:

shan kang

unread,
Feb 20, 2020, 3:31:32 AM2/20/20
to OpenBLAS-users
Before building, try to do the following commands.
export CFLAGS="$CFLAGS -march=skylake-avx512"
export FFLAGS="$FFLAGS -march=skylake-avx512"

在 2020年2月20日星期四 UTC+8下午3:12:56,Jam Chan写道:

Jam Chan

unread,
Feb 20, 2020, 4:04:52 AM2/20/20
to OpenBLAS-users
It show following errors:

axpy.c:1:0: error: bad value (skylake-avx512) for -march= switch
 /*********************************************************************/
 ^
dot.c:1:0: error: bad value (skylake-avx512) for -march= switch
 /*********************************************************************/
 ^
scal.c:1:0: error: bad value (skylake-avx512) for -march= switch
 /*********************************************************************/
 ^
make[1]: *** [sswap.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [saxpy.o] Error 1
copy.c:1:0: error: bad value (skylake-avx512) for -march= switch
 /*********************************************************************/
 ^
make[1]: *** [sdot.o] Error 1
make[1]: *** [sscal.o] Error 1
asum.c:1:0: error: bad value (skylake-avx512) for -march= switch
 /*********************************************************************/
 ^
make[1]: *** [scopy.o] Error 1
make[1]: *** [sasum.o] Error 1
sdsdot.c:1:0: error: bad value (skylake-avx512) for -march= switch
 /*********************************************************************/



在 2020年2月20日星期四 UTC+8下午4:31:32,shan kang写道:

shan kang

unread,
Feb 20, 2020, 4:19:51 AM2/20/20
to OpenBLAS-users
I just tried to build 0.3.8 on my Cascade Lake server. It can be built successfully. Here are build commands.
export AR=gcc-ar
export RANLIB=gcc-ranlib
export CFLAGS="$CFLAGS  -fno-semantic-interposition -O3 "
export FFLAGS="$CFLAGS -fno-semantic-interposition -O3 -fno-f2c "
export CXXFLAGS="$CXXFLAGS -fno-semantic-interposition -O3 "

export CFLAGS="$CFLAGS -march=skylake-avx512"
export FFLAGS="$FFLAGS -march=skylake-avx512"
make TARGET=SKYLAKEX F_COMPILER=GFORTRAN  SHARED=1 DYNAMIC_THREADS=1 USE_OPENMP=1 NO_AFFINITY=1  NUM_THREADS=128 -j4
My development OS is Clear Linux 30660, on which the gcc version is "gcc version 9.1.1".


在 2020年2月20日星期四 UTC+8下午5:04:52,Jam Chan写道:

martin-frbg

unread,
Feb 20, 2020, 5:41:09 PM2/20/20
to OpenBLAS-users
Your compiler is too old to support AVX512 instructions - that is why the build system automatically set NO_AVX512 flag and built for Haswell.

Jam Chan

unread,
Feb 20, 2020, 9:31:51 PM2/20/20
to OpenBLAS-users
I also tried GNU 9.1 compiler, but still meeting the same error

在 2020年2月21日星期五 UTC+8上午6:41:09,martin-frbg写道:

Jam Chan

unread,
Feb 20, 2020, 9:34:18 PM2/20/20
to OpenBLAS-users
My OS is CentOS 7.6, compiler is GCC 9.1.0, try to follow your build commands to compile 0.3.8, but still meeting the same errors.

axpy.c:1:0: error: bad value (skylake-avx512) for -march= switch
 /*********************************************************************/
 ^
dot.c:1:0: error: bad value (skylake-avx512) for -march= switch
 /*********************************************************************/
 ^
scal.c:1:0: error: bad value (skylake-avx512) for -march= switch
 /*********************************************************************/

在 2020年2月20日星期四 UTC+8下午5:19:51,shan kang写道:

Jeff Hammond

unread,
May 5, 2020, 11:46:04 AM5/5/20
to OpenBLAS-users
-march=skylake-avx512 was added starting in GCC 6 (https://gcc.gnu.org/gcc-6/changes.html).  You seem to not be using GCC 9 if you see an error with this flag.  In any case, you should post complete details of your error, including the complete path to the compiler you are using and the result of -v.

Jeff
Reply all
Reply to author
Forward
0 new messages