Skip to content

Compiler Failure on POWER8 with /kernel/power/i{c,d,s,z}a{min,max}.c #2254

Closed

Description

@grisuthedragon

I updated my installations on my POWER8 machine and since version 0.3.6 up to the current development branch, the build process fails with:

$ make  MAKE_NB_JOBS=1
...
cc -c -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -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 -DVERSION=\"0.3.8.dev\" -DASMNAME=isamax_k -DASMFNAME=isamax_k_ -DNAME=isamax_k_ -DCNAME=isamax_k -DCHAR_NAME=\"isamax_k_\" -DCHAR_CNAME=\"isamax_k\" -DNO_AFFINITY -I.. -UDOUBLE  -UCOMPLEX -UCOMPLEX -UDOUBLE -DUSE_ABS  -UUSE_MIN ../kernel/power/isamax.c -o isamax_k.o
../kernel/power/isamax.c: In function ‘siamax_kernel_64’:
../kernel/power/isamax.c:288:1: internal compiler error: in build_int_cst_wide, at tree.c:1210
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccriHyPV.out file, please attach this to your bugreport.
make[1]: *** [isamax_k.o] Error 1
make[1]: Leaving directory `/root/OpenBLAS/kernel'
make: *** [libs] Error 1

OS Details:
CentOS 7.6 ppc64el, gcc 4.8.5, gfortran 4.8.5, IBM POWER8 LC822

Activity

  1. changed the title [-]Compiler Failure on POWER8 with /kernel/power/ica{min,max}.c[/-] [+]Compiler Failure on POWER8 with /kernel/power/i{c,d,s,z}a{min,max}.c[/+] on Sep 12, 2019
  2. martin-frbg commented on Sep 12, 2019

    @martin-frbg
    Collaborator

    Interesting - this file is indeed new in 0.3.6, but (from debugging #2233) the ICE in question appears to be fixed in more recent compilers. (Unfortunately the source line 288 from the error message tells us nothing as it is simply the closing brace on the last line of the file).

  3. grisuthedragon commented on Sep 12, 2019

    @grisuthedragon
    ContributorAuthor

    If I find some time I will take a closer look inside the routines and why they are crashing.

  4. martin-frbg commented on Sep 12, 2019

    @martin-frbg
    Collaborator

    I see now that this has already been reported (against gcc 7.1.0) by susilehtlola as https://bugzilla.redhat.com/show_bug.cgi?id=1740539
    (From the tests for #2233, the code compiles with gcc 5.4 and again from 7.3 onwards (7.3.0/8.2.1/9.1), so it could be that something was fixed, broken, and fixed again)

  5. martin-frbg commented on Sep 12, 2019

    @martin-frbg
    Collaborator

    Reproduced in the unicamp.br minicloud. Preprocessed source of isamax.c is here:
    isamax_preprocessed.txt if somebody wants to add it to the redhat bugzilla entry (@susilehtola)
    Also the problem goes away at -O0 (instead of our default -Ofast) so can be worked around with
    a #pragma GCC optimize "O0" in the affected files.

  6. martin-frbg commented on Sep 12, 2019

    @martin-frbg
    Collaborator

    Also of note is that in my tests (gcc-4.8.5 20150623 Red Hat 4.8.5-36 on CentOS 7) it is only the
    single precision versions (isamin/isamax.c and icamin/icamax.c) that cause an ICE.

  7. susilehtola commented on Sep 12, 2019

    @susilehtola
    Contributor

    @martin-frbg thanks, uploaded. However, in my experience there's very little movement on RHEL bugzilla tickets.

    If someone has a RHEL subscription, they should make an issue about the bug with Red Hat; things get moving when a paying customer complains.

  8. grisuthedragon commented on Sep 13, 2019

    @grisuthedragon
    ContributorAuthor

    I did some experiments with isamax.c and found the around line 111 the snippets:

    temp0 += temp1;                                                                                                                                                                                                    
    temp0 += temp1; //temp0+32
    

    and around line 170

        quadruple_indices = vec_sel( quadruple_indices,ind2,r3);
        quadruple_values= vec_sel(quadruple_values,vv0,r3);      
        
        temp0+=temp1;
        temp0+=temp1; //temp0+32
    

    seem to disturb the compiler.

    Update: narrow the range a bit.

  9. quickwritereader commented on Sep 13, 2019

    @quickwritereader
    Contributor

    Could you comment/remove some lines to find which parts cause this error?

  10. grisuthedragon commented on Sep 13, 2019

    @grisuthedragon
    ContributorAuthor

    @quickwritereader That was exactly what I did. Commenting out the above mentioned lines, the code compiles.

  11. quickwritereader commented on Sep 13, 2019

    @quickwritereader
    Contributor

    addition? could you remove that c++ style comment or replace it with c style /* */

  12. grisuthedragon commented on Sep 13, 2019

    @grisuthedragon
    ContributorAuthor

    The c++ style comment is already in OpenBLAS and not from me. I tried to change "+=" to "temp0 = temp+temp1" because I had this problem in ancient times with gcc and the vetorization of a piece of code but that did not change anything.

  13. quickwritereader commented on Sep 13, 2019

    @quickwritereader
    Contributor

    Maybe to rename/refactor temp0 to other names. feel free to change refactor. comment blocks to c style.
    temp0 = vec_add( temp1 , vec_add(temp0,temp1));

  14. grisuthedragon commented on Sep 13, 2019

    @grisuthedragon
    ContributorAuthor

    Renaming and replacing the addition does not help.

  15. quickwritereader commented on Sep 13, 2019

    @quickwritereader
    Contributor

    from what versions of gcc it disappears?
    remove all register hints too.
    Also rewrite + operations with this style result=vec_add(operand1,operand2)

  16. 106 remaining items

  17. sh1ng commented on Feb 12, 2020

    @sh1ng

    ppc64le
    cpu : POWER8E (raw), altivec supported

  18. edelsohn commented on Feb 12, 2020

    @edelsohn

    Use IBM AT12.0 or AT13.0 or RH Developer Toolset or something newer than GCC 4.8.5 RH.

  19. martin-frbg commented on Feb 12, 2020

    @martin-frbg
    Collaborator

    It should not even try to compile isamax.c in 0.3.8 - are you building with cmake by any chance ? (The simple KERNEL file parser in utils.cmake simply skips over conditional expressions.) Unfortunately I have lost OpenPower cloud access again so will need to reapply.

  20. edelsohn commented on Feb 12, 2020

    @edelsohn

    @martin-frbg When you have the account, please contact me so that we can set it not to expire.

  21. sh1ng commented on Feb 12, 2020

    @sh1ng

    @martin-frbg no I'm using vanilla make. Will try with cmake

  22. sh1ng commented on Feb 12, 2020

    @sh1ng

    @edelsohn I'm aware of the options, but prefer to use default gcc

  23. edelsohn commented on Feb 12, 2020

    @edelsohn

    If you want to create complications for yourself, that's your choice.

  24. martin-frbg commented on Feb 12, 2020

    @martin-frbg
    Collaborator

    @sh1ng cmake definitely won't be better, it would only have explained why my dirty trick with the conditionals in KERNEL.POWER8 does not work. Unfortunately too many related problems came up during the lifetime of this issue, ppc64be, power9, the relevance of lapack-test deviations... in particular I seem to have bungled my original gcc48 workaround with a later hack for ppc64be.

  25. RajalakshmiSR commented on Feb 12, 2020

    @RajalakshmiSR

    I verified that 0.3.8 builds fine on POWER8BE/ POWER8LE and POWER9 using AT12.

    @martin-frbg I think the check for not big endian in KERNEL.POWER8 needs a correction
    -ifneq ($(BYTE_ORDER),$(ORDER_BIG_ENDIAN))
    +ifneq ($(BYTE_ORDER),"ORDER_BIG_ENDIAN")

  26. martin-frbg commented on Feb 12, 2020

    @martin-frbg
    Collaborator

    @RajalakshmiSR thanks - silly me. And I guess i should combine that fix with a "GCC<9" version check .

  27. amelvill-umich commented on May 20, 2020

    @amelvill-umich

    Can still reproduce with gcc 8.2.0, OpenBlas v0.3.8 RHEL 7.5, ppc64le.

    For what it's worth, I can compile this without any problems on AMD64 GCC 9.3.0, Ubuntu 20.20

    ../kernel/power/isamax.c: In function ‘siamax_kernel_64’:
    ../kernel/power/isamin.c:288:1: internal compiler error: in build_int_cst_wide, at tree.c:1210
     }
     ^
    ../kernel/power/isamax.c:288:1: internal compiler error: in build_int_cst_wide, at tree.c:1210
     }
     ^
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <http://bugzilla.redhat.com/bugzilla> for instructions.
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <http://bugzilla.redhat.com/bugzilla> for instructions.
    cc -c -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -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 -DVERSION=\"0.3.8\" -DASMNAME=cgemv_o -DASMFNAME=cgemv_o_ -DNAME=cgemv_o_ -DCNAME=cgemv_o -DCHAR_NAME=\"cgemv_o_\" -DCHAR_CNAME=\"cgemv_o\" -DNO_AFFINITY -I.. -UDOUBLE  -DCOMPLEX -UDOUBLE -DCOMPLEX -UTRANS -UCONJ -DXCONJ ../kernel/power/cgemv_n.c -o cgemv_o.o
    cc -c -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -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 -DVERSION=\"0.3.8\" -DASMNAME=cgemv_u -DASMFNAME=cgemv_u_ -DNAME=cgemv_u_ -DCNAME=cgemv_u -DCHAR_NAME=\"cgemv_u_\" -DCHAR_CNAME=\"cgemv_u\" -DNO_AFFINITY -I.. -UDOUBLE  -DCOMPLEX -UDOUBLE -DCOMPLEX -DTRANS -UCONJ -DXCONJ ../kernel/power/cgemv_t.c -o cgemv_u.o
    cc -c -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -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 -DVERSION=\"0.3.8\" -DASMNAME=cgemv_s -DASMFNAME=cgemv_s_ -DNAME=cgemv_s_ -DCNAME=cgemv_s -DCHAR_NAME=\"cgemv_s_\" -DCHAR_CNAME=\"cgemv_s\" -DNO_AFFINITY -I.. -UDOUBLE  -DCOMPLEX -UDOUBLE -DCOMPLEX -UTRANS -DCONJ -DXCONJ ../kernel/power/cgemv_n.c -o cgemv_s.o
    cc -c -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -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 -DVERSION=\"0.3.8\" -DASMNAME=cgemv_d -DASMFNAME=cgemv_d_ -DNAME=cgemv_d_ -DCNAME=cgemv_d -DCHAR_NAME=\"cgemv_d_\" -DCHAR_CNAME=\"cgemv_d\" -DNO_AFFINITY -I.. -UDOUBLE  -DCOMPLEX -UDOUBLE -DCOMPLEX -DTRANS -DCONJ -DXCONJ ../kernel/power/cgemv_t.c -o cgemv_d.o
    cc -c -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -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 -DVERSION=\"0.3.8\" -DASMNAME=csymv_U -DASMFNAME=csymv_U_ -DNAME=csymv_U_ -DCNAME=csymv_U -DCHAR_NAME=\"csymv_U_\" -DCHAR_CNAME=\"csymv_U\" -DNO_AFFINITY -I.. -UDOUBLE  -DCOMPLEX -DCOMPLEX -UDOUBLE -ULOWER ../kernel/power/../generic/zsymv_k.c -o csymv_U.o
    cc -c -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -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 -DVERSION=\"0.3.8\" -DASMNAME=csymv_L -DASMFNAME=csymv_L_ -DNAME=csymv_L_ -DCNAME=csymv_L -DCHAR_NAME=\"csymv_L_\" -DCHAR_CNAME=\"csymv_L\" -DNO_AFFINITY -I.. -UDOUBLE  -DCOMPLEX -DCOMPLEX -UDOUBLE -DLOWER ../kernel/power/../generic/zsymv_k.c -o csymv_L.o
    cc -c -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -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 -DVERSION=\"0.3.8\" -DASMNAME=chemv_U -DASMFNAME=chemv_U_ -DNAME=chemv_U_ -DCNAME=chemv_U -DCHAR_NAME=\"chemv_U_\" -DCHAR_CNAME=\"chemv_U\" -DNO_AFFINITY -I.. -UDOUBLE  -DCOMPLEX -DCOMPLEX -UDOUBLE -ULOWER -DHEMV ../kernel/power/../generic/zhemv_k.c -o chemv_U.o
    cc -c -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -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 -DVERSION=\"0.3.8\" -DASMNAME=chemv_L -DASMFNAME=chemv_L_ -DNAME=chemv_L_ -DCNAME=chemv_L -DCHAR_NAME=\"chemv_L_\" -DCHAR_CNAME=\"chemv_L\" -DNO_AFFINITY -I.. -UDOUBLE  -DCOMPLEX -DCOMPLEX -UDOUBLE -DLOWER -DHEMV ../kernel/power/../generic/zhemv_k.c -o chemv_L.o
    cc -c -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -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 -DVERSION=\"0.3.8\" -DASMNAME=chemv_V -DASMFNAME=chemv_V_ -DNAME=chemv_V_ -DCNAME=chemv_V -DCHAR_NAME=\"chemv_V_\" -DCHAR_CNAME=\"chemv_V\" -DNO_AFFINITY -I.. -UDOUBLE  -DCOMPLEX -DCOMPLEX -UDOUBLE -ULOWER -DHEMV -DHEMVREV ../kernel/power/../generic/zhemv_k.c -o chemv_V.o
    ../kernel/power/icamax.c: In function ‘ciamax_kernel_32’:
    ../kernel/power/icamax.c:326:1: internal compiler error: in build_int_cst_wide, at tree.c:1210
     }
    

    With 0.3.9 it gives me... a segfault?

    gfortran -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -Wall -frecursive -fno-optimize-sibling-calls -m64 -fopenmp  -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp -fno-optimize-sibling-calls  -o zblat3 zblat3.o ../libopenblas_power8p-r0.3.9.a -lm -lpthread -lgfortran -lm -lpthread -lgfortran -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5 -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../..  -lc
    OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./sblat1
    
    Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
    
    Backtrace for this error:
    #0  0x3FFFA2167193
    #1  0x3FFFA2167D13
    #2  0x3FFFA23C0477
    #3  0x3FFFA2309C2C
    #4  0x3FFFA23261B7
    #5  0x100036DF in MAIN__ at sblat1.f:?
    make[1]: *** [level1] Segmentation fault
    
    

    I notice it seems to be still trying to link against the GCC 4.8.5 libraries, so there might be something I still have to look at on my end.

  28. martin-frbg commented on May 20, 2020

    @martin-frbg
    Collaborator

    The fix from #2411 mentioned above went into what became 0.3.9, not 0.3.8
    The 0.3.9 release definitely builds and passes tests with both gcc 9.3.1 and gcc 8.3.1 (fedora 30 & 28). A mixup between compiler versions (mismatched gcc and gfortran, or picking up an older runtime) is likely to cause a crash

  29. quickwritereader commented on May 20, 2020

    @quickwritereader
    Contributor

    @martin-frbg did really good job fixing those issues with generating assemblies.
    In my forked project, I have updated sources for icamax icamin C source files. But never Pull requested them as better and tested fixes were already supplied.
    People having these types of issues could also check it.

  30. martin-frbg commented on May 21, 2020

    @martin-frbg
    Collaborator

    (Re)checked 0.3.9 on Centos7 with a gcc8.2.1 from developer toolset (yum install devtoolset-8-gcc-8.2.1 devtoolset-8-gcc-gfortran-8.2.1) now as well, no crash, no test failures, nothing suspicious in lapack-test.

  31. amelvill-umich commented on May 21, 2020

    @amelvill-umich

    It appears there was something wrong with the cluster's configuration, it seems to be working now. Sorry for the mixup!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions