Skip to content

Conversation

martin-frbg
Copy link
Collaborator

supersedes #2771 , fixes #2767

@martin-frbg martin-frbg added this to the 0.3.11 milestone Oct 12, 2020
@martin-frbg martin-frbg merged commit 0892943 into OpenMathLib:develop Oct 12, 2020
@RajalakshmiSR
Copy link

RajalakshmiSR commented Oct 13, 2020

@martin-frbg
make BUILD_BFLOAT16 fails on POWER9.
I have attached changes from my sandbox (common.h , interface/Makefile, test/Makefile) for reference. I could still not get sbgemm.o (from gemm.c)compiled from interface/Makefile.
In particular, the following 2 corresponding sbgemm lines are missing compared to BUILD_HALF (interface/Makefile)

cc -c -g -DMAX_STACK_ALLOC=2048 -fopenmp -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DSMP_SERVER -DUSE_OPENMP -DNO_WARMUP -DMAX_CPU_NUMBER=160 -DMAX_PARALLEL_NUMBER=1 -DBUILD_HALF -DBUILD_SINGLE -DBUILD_DOUBLE -DBUILD_COMPLEX -DBUILD_COMPLEX16 -DVERSION="0.3.10.dev" -Ofast -mvsx -fno-fast-math -mcpu=power9 -mtune=power9 -DUSE_OPENMP -fopenmp -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME=shgemm -DASMFNAME=shgemm_ -DNAME=shgemm_ -DCNAME=shgemm -DCHAR_NAME="shgemm_" -DCHAR_CNAME="shgemm" -DNO_AFFINITY -I.. -I. -DHALF -UDOUBLE -UCOMPLEX gemm.c -o shgemm.o
cc -DCBLAS -c -g -DMAX_STACK_ALLOC=2048 -fopenmp -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DSMP_SERVER -DUSE_OPENMP -DNO_WARMUP -DMAX_CPU_NUMBER=160 -DMAX_PARALLEL_NUMBER=1 -DBUILD_HALF -DBUILD_SINGLE -DBUILD_DOUBLE -DBUILD_COMPLEX -DBUILD_COMPLEX16 -DVERSION="0.3.10.dev" -Ofast -mvsx -fno-fast-math -mcpu=power9 -mtune=power9 -DUSE_OPENMP -fopenmp -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME=cblas_shgemm -DASMFNAME=cblas_shgemm_ -DNAME=cblas_shgemm_ -DCNAME=cblas_shgemm -DCHAR_NAME="cblas_shgemm_" -DCHAR_CNAME="cblas_shgemm" -DNO_AFFINITY -I.. -I. -DHALF -UDOUBLE -UCOMPLEX gemm.c -o cblas_shgemm.o

I will debug further tomorrow.


`diff --git a/common.h b/common.h
index 89eeb197..a3ef99b5 100644
--- a/common.h
+++ b/common.h
@@ -257,7 +257,7 @@ typedef long BLASLONG;
typedef unsigned long BLASULONG;
#endif

-#ifndef BFLOAT16
+#ifndef bfloat16
#include <stdint.h>
typedef uint16_t bfloat16;
#define BFLOAT16CONVERSION 1
diff --git a/interface/Makefile b/interface/Makefile
index a35d5327..38728561 100644
--- a/interface/Makefile
+++ b/interface/Makefile
@@ -283,8 +283,8 @@ CSBLAS3OBJS =
cblas_sgeadd.$(SUFFIX)

ifeq ($(BUILD_BFLOAT16),1)
-CBHBLAS1OBJS = cblas_sbdot.$(SUFFIX)
-CBHBLAS3OBJS = cblas_sbgemm.$(SUFFIX)
+CSBBLAS1OBJS = cblas_sbdot.$(SUFFIX)
+CSBBLAS3OBJS = cblas_sbgemm.$(SUFFIX)
CBHEXTOBJS = cblas_sbstobf16.$(SUFFIX) cblas_sbdtobf16.$(SUFFIX) cblas_sbf16tos.$(SUFFIX) cblas_dbf16tod.$(SUFFIX)
endif

@@ -535,19 +535,19 @@ endif
clean ::
@rm -f functable.h

-level1 : $(BEXTOBJS) $(SHBLAS1OBJS) $(SBLAS1OBJS) $(DBLAS1OBJS) $(QBLAS1OBJS) $(CBLAS1OBJS) $(ZBLAS1OBJS) $(XBLAS1OBJS)
+level1 : $(BEXTOBJS) $(SBBLAS1OBJS) $(SBLAS1OBJS) $(DBLAS1OBJS) $(QBLAS1OBJS) $(CBLAS1OBJS) $(ZBLAS1OBJS) $(XBLAS1OBJS)
$(AR) $(ARFLAGS) -ru $(TOPDIR)/$(LIBNAME) $^

level2 : $(SBLAS2OBJS) $(DBLAS2OBJS) $(QBLAS2OBJS) $(CBLAS2OBJS) $(ZBLAS2OBJS) $(XBLAS2OBJS)
$(AR) $(ARFLAGS) -ru $(TOPDIR)/$(LIBNAME) $^

-level3 : $(SHBLAS3OBJS) $(SBLAS3OBJS) $(DBLAS3OBJS) $(QBLAS3OBJS) $(CBLAS3OBJS) $(ZBLAS3OBJS) $(XBLAS3OBJS)
+level3 : $(SBBLAS3OBJS) $(SBLAS3OBJS) $(DBLAS3OBJS) $(QBLAS3OBJS) $(CBLAS3OBJS) $(ZBLAS3OBJS) $(XBLAS3OBJS)
$(AR) $(ARFLAGS) -ru $(TOPDIR)/$(LIBNAME) $^

aux : $(CBAUXOBJS)
$(AR) $(ARFLAGS) -ru $(TOPDIR)/$(LIBNAME) $^

-$(CSHBLASOBJS) $(CSHBLASOBJS_P) $(CSBLASOBJS) $(CSBLASOBJS_P) $(CDBLASOBJS) $(CDBLASOBJS_P) $(CQBLASOBJS) $(CQBLASOBJS_P)
+$(CSBBLASOBJS) $(CSBBLASOBJS_P) $(CSBLASOBJS) $(CSBLASOBJS_P) $(CDBLASOBJS) $(CDBLASOBJS_P) $(CQBLASOBJS) $(CQBLASOBJS_P)
$(CCBLASOBJS) $(CCBLASOBJS_P) $(CZBLASOBJS) $(CZBLASOBJS_P) $(CXBLASOBJS) $(CXBLASOBJS_P) $(CBAUXOBJS_P) : override CFLAGS += -DCBLAS

srot.$(SUFFIX) srot.$(PSUFFIX) : rot.c
diff --git a/test/Makefile b/test/Makefile
index 06fb7fe8..21234338 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -214,11 +214,9 @@ endif

-#ifeq ($(BUILD_BFLOAT16),1)
-#level3 : test_sbgemm sblat3 dblat3 cblat3 zblat3
-#else
-#level3 : sblat3 dblat3 cblat3 zblat3
-#endif
+ifeq ($(BUILD_BFLOAT16),1)
+level3 : test_sbgemm
+endif

ifndef CROSS
rm -f ?BLAT3.SUMM

@martin-frbg
Copy link
Collaborator Author

Sorry, think the main cause of this breakage is similar oversight in Makefile.tail. I'm creating a PR to fix this and add a P9/BFLOAT16 build to Travis. (Also need to kill that ridiculous "build matrix" in test/Makefile)

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

Successfully merging this pull request may close these issues.

BFloat16 data type naming

2 participants