Skip to content

Issue with Power8/32bit tests #2694

Closed
Closed

Description

@trex58

Hi,

Following issue 2693 [https://github.com//pull/2693] by @EGuesnet, once fixed by our patch , we have found another issue when tests are run during build phase, still with Power8/32bit, thus using the Power8 assembler code.

+ make BINARY=32 TARGET=POWER8
...
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./sblat3 < ./sblat3.dat
******* FATAL ERROR - PARAMETER NUMBER 2 WAS CHANGED INCORRECTLY *******
******* FATAL ERROR - PARAMETER NUMBER 3 WAS CHANGED INCORRECTLY *******
******* FATAL ERROR - PARAMETER NUMBER 4 WAS CHANGED INCORRECTLY *******
******* FATAL ERROR - PARAMETER NUMBER 5 WAS CHANGED INCORRECTLY *******
******* FATAL ERROR - PARAMETER NUMBER 6 WAS CHANGED INCORRECTLY *******
******* FATAL ERROR - PARAMETER NUMBER 9 WAS CHANGED INCORRECTLY *******
******* STRMM FAILED ON CALL NUMBER:
506: STRMM ('L','U','N','U', 1, 1, 1.0, A, 2, B, 2) .

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

C and fortran codes were built with the following options:

gcc -maix32 -D_LARGE_FILES -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math \
-fopenmp -DMAX_STACK_ALLOC=2048 -Wall -DF_INTERFACE_GFORT -fPIC -DNO_AVX512 -DSMP_SERVER -DNO_WARMUP \
-DMAX_CPU_NUMBER=2 -DMAX_PARALLEL_NUMBER=1 -DVERSION="0.3.10" -Wa,-a32 -UASMNAME -UASMFNAME -UNAME \
-UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME="_" \
-DCHAR_CNAME="" -DNO_AFFINITY -I. -DHAVE_LAPACK_CONFIG_H -I../include -c -o lapacke_ztr_nancheck.o \
lapacke_ztr_nancheck.c

gfortran -maix32 -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp \
-Wall -frecursive -fno-optimize-sibling-calls -fopenmp  -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power \
-DUSE_OPENMP -fno-fast-math -fopenmp -fno-optimize-sibling-calls -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib \
-Wl,-bmaxdata:0x80000000 -o zblat3 zblat3.o ../libopenblas_power8p-r0.3.10.a -lm -lpthread -lgfortran -lm -lpthread \
-lgfortran -L/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8 -L/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/../../.. \
-L/opt/freeware/lib  -lc  /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/libgcc.a /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/libgcc_eh.a \
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/libgcc.a /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/libgcc_eh.a

gdb and dbx say nothing very useful.
Since it is written in assembler, that may be very difficult to debug, and our 2 assembler experts are out and will be back next week only.

For now, we have no idea about the root cause. We need help, probably from the Power assembler expert who wrote this code.

Activity

  1. martin-frbg commented on Jun 30, 2020

    @martin-frbg
    Collaborator

    Unfortunately wernsaar has not been active here (nor responding to messages) since early 2017, and I learned just about the bare minimum ppc assembly needed to fix the obvious omissions in his code as they were pointed out. Perhaps @kavanabhat can help ? (@quickwritereader would be our semi-"resident" expert for ppc but I believe is not that familiar with AIX or coding for big-endian in general. Actually endianness could be the problem here - but perhaps gdb can be coaxed into reporting the actual assembly instruction on which it crashes )

  2. brada4 commented on Jun 30, 2020

    @brada4
    Contributor

    what do you see in gdb or dbx repeating the failing test command?
    also worth using assembly-free GENERIC target, because POWER8 assembly was unlikely on PPC604e or whatever was the latest 32bit PPC running AIX

  3. trex58 commented on Jul 1, 2020

    @trex58
    Author

    Since we worked to work-around this for being able to generate RPM files, I had to rebuild it all without the work-around, and then original above issue has disappeared and has been replaced, still in the same test, by:

    OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./sblat3 < ./sblat3.dat
    At line 573 of file sblat3.f (unit = 6, file = 'SBLAT3.SUMM')
    Fortran runtime error: Missing initial left parenthesis in format
    
    
    Error termination. Backtrace:
    make[1]: *** [Makefile:74: level3] Error 2
    

    32bit/power8/test/sblat3.f :

      +567                             CALL SGEMM( TRANSA, TRANSB, M, N, K, ALPHA,
      +568       $                                 AA, LDA, BB, LDB, BETA, CC, LDC )
      +569  *
      +570  *                          Check if error-exit was taken incorrectly.
      +571  *
      +572                             IF( .NOT.OK )THEN
      +573                                WRITE( NOUT, FMT = 9994 )
      +574                                FATAL = .TRUE.
      +575                                GO TO 120
      +576                             END IF
    

    32bit/power8/test/SBLAT3.SUMM :

     TESTS OF THE REAL             LEVEL 3 BLAS
    
     THE FOLLOWING PARAMETER VALUES WILL BE USED:
       FOR N                   0     1     2     3     7    31
       FOR ALPHA             0.0   1.0   0.7
       FOR BETA              0.0   1.0   1.3
    
     ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00
    
     RELATIVE MACHINE PRECISION IS TAKEN TO BE  1.2E-07
    
     SGEMM  PASSED THE TESTS OF ERROR-EXITS
    

    32bit/power8/test/sblat3.dat:

    'SBLAT3.SUMM'     NAME OF SUMMARY OUTPUT FILE
    6                 UNIT NUMBER OF SUMMARY FILE
    'SBLAT3.SNAP'     NAME OF SNAPSHOT OUTPUT FILE
    -1                UNIT NUMBER OF SNAPSHOT FILE (NOT USED IF .LT. 0)
    F        LOGICAL FLAG, T TO REWIND SNAPSHOT FILE AFTER EACH RECORD.
    F        LOGICAL FLAG, T TO STOP ON FAILURES.
    T        LOGICAL FLAG, T TO TEST ERROR EXITS.
    16.0     THRESHOLD VALUE OF TEST RATIO
    6                 NUMBER OF VALUES OF N
    0 1 2 3 7 31 63   VALUES OF N
    3                 NUMBER OF VALUES OF ALPHA
    0.0 1.0 0.7       VALUES OF ALPHA
    3                 NUMBER OF VALUES OF BETA
    0.0 1.0 1.3       VALUES OF BETA
    SGEMM  T PUT F FOR NO TEST. SAME COLUMNS.
    SSYMM  T PUT F FOR NO TEST. SAME COLUMNS.
    STRMM  T PUT F FOR NO TEST. SAME COLUMNS.
    STRSM  T PUT F FOR NO TEST. SAME COLUMNS.
    SSYRK  T PUT F FOR NO TEST. SAME COLUMNS.
    SSYR2K T PUT F FOR NO TEST. SAME COLUMNS.
    

    So, that looks random. Damned!

    Nuts !!! The last time I wrote Fortran code, it was maybe in 1983, or sure in 1981 (6 months). Fortran 77... ;-) I need a refresh.

  4. trex58 commented on Jul 1, 2020

    @trex58
    Author

    ... Actually endianness could be the problem here -

    Hummm. Since that works fine for Power8/64bit, I'm not sure it is Endianess.

    but perhaps gdb can be coaxed into reporting the actual assembly instruction on which it crashes )

    I do not remember exactly the output of gdb and dbx. Probably nothing for gdb, and 3 lines for dbx with a fortran routine at the top.

  5. trex58 commented on Jul 1, 2020

    @trex58
    Author

    also worth using assembly-free GENERIC target, because POWER8 assembly was unlikely on PPC604e or whatever was the latest 32bit PPC running AIX

    Hummm So, maybe this 32bit assembler code had never been tested.
    We are using "using assembly-free GENERIC target" as a work-around. Not very fast, but that works fine in 32bit too.

    We need openblas in 32bit because we have numpy in 64bit and 32 because we have Boost.Python and Boost in both 64bit and 32bit because AIX manages both 64 & 32bit.
    Anyway, we have a work-around.

    I'll experiment reproducing the build & test and see if it is stable or not.

  6. martin-frbg commented on Jul 1, 2020

    @martin-frbg
    Collaborator

    I see nothing wrong with the format line labeled 9994, probably something is scribbling over parts of the stack

  7. trex58 commented on Jul 1, 2020

    @trex58
    Author

    I see nothing wrong with the format line labeled 9994, probably something is scribbling over parts of the stack

    Thanks for providing your expertise.
    Hummmm I gonna relaunch the test, and then rebuild, and see if I get a third result (random...) or if it stabilizes.
    Random issues are always a pain...

  8. trex58 commented on Jul 1, 2020

    @trex58
    Author

    The problem may be not stable, since it now shows the first issue, but with no core:

    cd OpenBLAS-0.3.10/32bit/power8/test
    OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./sblat3 < ./sblat3.dat
    
     ******* FATAL ERROR - PARAMETER NUMBER  2 WAS CHANGED INCORRECTLY *******
     ******* FATAL ERROR - PARAMETER NUMBER  3 WAS CHANGED INCORRECTLY *******
     ******* FATAL ERROR - PARAMETER NUMBER  4 WAS CHANGED INCORRECTLY *******
     ******* FATAL ERROR - PARAMETER NUMBER  5 WAS CHANGED INCORRECTLY *******
     ******* FATAL ERROR - PARAMETER NUMBER  6 WAS CHANGED INCORRECTLY *******
     ******* FATAL ERROR - PARAMETER NUMBER  9 WAS CHANGED INCORRECTLY *******
     ******* STRMM  FAILED ON CALL NUMBER:
        506: STRMM ('L','U','N','U',  1,  1, 1.0, A,  2, B,  2)        .
    

    SBLAT3.SUMM:

     TESTS OF THE REAL             LEVEL 3 BLAS
    
     THE FOLLOWING PARAMETER VALUES WILL BE USED:
       FOR N                   0     1     2     3     7    31
       FOR ALPHA             0.0   1.0   0.7
       FOR BETA              0.0   1.0   1.3
    
     ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00
    
     RELATIVE MACHINE PRECISION IS TAKEN TO BE  1.2E-07
    
     SGEMM  PASSED THE TESTS OF ERROR-EXITS
    
     ******* FATAL ERROR - COMPUTED RESULT IS LESS THAN HALF ACCURATE *******
               EXPECTED RESULT   COMPUTED RESULT
           1      0.156895          0.198940
     ******* SGEMM  FAILED ON CALL NUMBER:
       3568: SGEMM ('N','N',  1,  1,  2, 1.0, A,  2, B,  3, 0.0, C,  2).
    
     SSYMM  PASSED THE TESTS OF ERROR-EXITS
    
     ******* FATAL ERROR - COMPUTED RESULT IS LESS THAN HALF ACCURATE *******
               EXPECTED RESULT   COMPUTED RESULT
           1       0.00000         -0.662874E-02
          THESE ARE THE RESULTS FOR COLUMN   2
     ******* SSYMM  FAILED ON CALL NUMBER:
        310: SSYMM ('R','U',  1,  2, 1.0, A,  3, B,  2, 0.0, C,  2)    .
    
     STRMM  PASSED THE TESTS OF ERROR-EXITS
    
    
     STRSM  PASSED THE TESTS OF ERROR-EXITS
    
     ******* FATAL ERROR - COMPUTED RESULT IS LESS THAN HALF ACCURATE *******
               EXPECTED RESULT   COMPUTED RESULT
           1     -0.102897           0.00000
          THESE ARE THE RESULTS FOR COLUMN   2
     ******* STRSM  FAILED ON CALL NUMBER:
        686: STRSM ('R','U','N','U',  1,  3, 1.0, A,  4, B,  2)        .
    
     SSYRK  PASSED THE TESTS OF ERROR-EXITS
    
     ******* FATAL ERROR - COMPUTED RESULT IS LESS THAN HALF ACCURATE *******
               EXPECTED RESULT   COMPUTED RESULT
           1      0.727544E-03      0.397006E-02
     ******* SSYRK  FAILED ON CALL NUMBER:
        436: SSYRK ('U','N',  1,  2, 1.0, A,  2, 0.0, C,  2)           .
    
     SSYR2K PASSED THE TESTS OF ERROR-EXITS
    
     ******* FATAL ERROR - COMPUTED RESULT IS LESS THAN HALF ACCURATE *******
               EXPECTED RESULT   COMPUTED RESULT
           1     -0.202936         -0.225193
     ******* SSYR2K FAILED ON CALL NUMBER:
        436: SSYR2K('U','N',  1,  2, 1.0, A,  2, B,  2, 0.0, C,  2)    .
    
     END OF TESTS
    
  9. martin-frbg commented on Jul 1, 2020

    @martin-frbg
    Collaborator

    gdb keeps acting up for me, single-stepping through sblat3 is extremely slow with lots of "internal error ... in read in psymtab but not in symtab" warnings. valgrind does not appear to be installed on the (gcc compile farm) machine

  10. trex58 commented on Jul 7, 2020

    @trex58
    Author

    When rebuilding all (libopenblas_power5p-r0.3.10.a) after complete clean, by scripts, with -O0 -g, or -O1 -g, or -O2 -g, there is no more bug.
    Before, it was built with -Ofast and sometimes with -O2 .
    Rebuilding all with -Ofast -g, or with -Ofast, still with scripts, does not produce the issue!

    cd test
    OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./sblat3 < ./sblat3.dat

    SBLAT3.SUMM when it's OK:

     TESTS OF THE REAL             LEVEL 3 BLAS
    
     THE FOLLOWING PARAMETER VALUES WILL BE USED:
       FOR N                   0     1     2     3     7    31
       FOR ALPHA             0.0   1.0   0.7
       FOR BETA              0.0   1.0   1.3
    
     ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00
    
     RELATIVE MACHINE PRECISION IS TAKEN TO BE  1.2E-07
    
     SGEMM  PASSED THE TESTS OF ERROR-EXITS
    
     SGEMM  PASSED THE COMPUTATIONAL TESTS ( 17496 CALLS)
    
     SSYMM  PASSED THE TESTS OF ERROR-EXITS
    
     SSYMM  PASSED THE COMPUTATIONAL TESTS (  1296 CALLS)
    
     STRMM  PASSED THE TESTS OF ERROR-EXITS
    
     STRMM  PASSED THE COMPUTATIONAL TESTS (  2592 CALLS)
    
     STRSM  PASSED THE TESTS OF ERROR-EXITS
    
     STRSM  PASSED THE COMPUTATIONAL TESTS (  2592 CALLS)
    
     SSYRK  PASSED THE TESTS OF ERROR-EXITS
    
     SSYRK  PASSED THE COMPUTATIONAL TESTS (  1944 CALLS)
    
     SSYR2K PASSED THE TESTS OF ERROR-EXITS
    
     SSYR2K PASSED THE COMPUTATIONAL TESTS (  1944 CALLS)
    
     END OF TESTS
    

    Rebuilding all from scratch from running rpmbuild on the .spec file does recreate the issue:

     OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./sblat3 < ./sblat3.dat
     
     Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
     
     Backtrace for this error:
     gmake[1]: *** [Makefile:74: level3] Segmentation fault (core dumped)
    
     
     # pwd
     /opt/freeware/src/packages/BUILD/OpenBLAS-0.3.10/32bit/power8
     # file test/core
     test/core: AIX core file 32-bit, sblat3
    
     # gdb test/sblat3 test/core
     ...
     Reading symbols from test/sblat3...done.
     "/opt/freeware/src/packages/BUILD/OpenBLAS-0.3.10/32bit/power8/test/core" is not a core dump: File format not recognized
     (gdb) where
     No stack.
    
     # dbx test/sblat3 test/core
     
     Segmentation fault in pthread_kill at 0xd05883ec
     0xd05883ec (pthread_kill+0xac) 80410014            lwz   r2,0x14(r1)
     (dbx) where
     pthread_kill(??, ??) at 0xd05883ec
     _p_raise(??) at 0xd05877c8
     raise.raise(??) at 0xd0123604
     _gfortrani_backtrace_handler(??), line 137 in "compile_options.c"
     schk1(??, ??, ??, ??, ??, ??, ??, ??) at 0x10006408
     MAIN__() at 0x1000d09c
     sblat3.main(??, ??) at 0x10000410
    
     SBLAT3.SUMM : empty !
     
            0 Jul  7 10:16 SBLAT3.SUMM
    

    Relaunching the test by hand leads to a different error message, with no core, as described at beginning of this issue:

     OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./sblat3 < ./sblat3.dat
     ******* FATAL ERROR - PARAMETER NUMBER  2 WAS CHANGED INCORRECTLY *******
     ******* FATAL ERROR - PARAMETER NUMBER  3 WAS CHANGED INCORRECTLY *******
     ******* FATAL ERROR - PARAMETER NUMBER  4 WAS CHANGED INCORRECTLY *******
     ******* FATAL ERROR - PARAMETER NUMBER  5 WAS CHANGED INCORRECTLY *******
     ******* FATAL ERROR - PARAMETER NUMBER  6 WAS CHANGED INCORRECTLY *******
     ******* FATAL ERROR - PARAMETER NUMBER  9 WAS CHANGED INCORRECTLY *******
     ******* STRMM  FAILED ON CALL NUMBER:
        506: STRMM ('L','U','N','U',  1,  1, 1.0, A,  2, B,  2)        .
    

    and now the SBLAT3.SUMM file is no more empty and contains what has already been described above:

    # ll SBLAT3.SUMM
    -rw-r--r-- 1 root system 2069 Jul  7 10:35 SBLAT3.SUMM
    

    ????

  11. martin-frbg commented on Jul 7, 2020

    @martin-frbg
    Collaborator

    First rebuild was probably without setting TARGET, leading to an all-C power5 build (as I have not completed and merged my PR yet), spec file probably specifies TARGET=POWER8 ? (Had no luck with gdb so far - building with -fsanitize=address -fsanitize=undefined (on 64bit) turns up several complaints about misaligned arguments in loads and stores of vector floats though none of them in level3 BLAS)

  12. trex58 commented on Jul 7, 2020

    @trex58
    Author

    First rebuild was probably without setting TARGET...

    Yes. I forgot this. Now using BINARY and TARGET. Not perfectly awaken this morning...

    Now using:

    # cat MAKE
    export OBJECT_MODE=32
    export CC="gcc -maix32"
    export CXX="g++ -maix32"
    export FC="gfortran -maix32"
    export LDFLAGS="-Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000"
    #gmake clean
    gmake --trace VERBOSE=1 -j16 $1 BINARY=32 TARGET=POWER8
    cd test
    OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./sblat3 < ./sblat3.dat
    

    gdb is still KO.

    # dbx sblat3 core
    ...
    (dbx) where
    pthread_kill(??, ??) at 0xd05883ec
    _p_raise(??) at 0xd05877c8
    raise.raise(??) at 0xd0123604
    _gfortrani_backtrace_handler(??), line 137 in "compile_options.c"
    _gfortrani_library_start(??), line 37 in "lock.c"
    _gfortran_st_write(??), line 4227 in "transfer.c"
    schk3(??, ??, ??, ??, ??, ??, ??, ??) at 0x10006d5c
    MAIN__() at 0x10010584
    sblat3.main(??, ??) at 0x10000410
    

    Which is not exactly what I got from the total rebuild from .spec file:

    (dbx) where
    pthread_kill(??, ??) at 0xd05883ec
    _p_raise(??) at 0xd05877c8
    raise.raise(??) at 0xd0123604
    _gfortrani_backtrace_handler(??), line 137 in "compile_options.c"
    schk1(??, ??, ??, ??, ??, ??, ??, ??) at 0x10006408
    MAIN__() at 0x1000d09c
    sblat3.main(??, ??) at 0x10000410
    
  13. trex58 commented on Jul 7, 2020

    @trex58
    Author

    By the way, the number of cores to be used on AIX is not computed by OpenBlas, thus leading to NUM_CORES=2 .
    The attached patch does make use of the real number of cores of the AIX VM. Thus speeding a lot the build.

    openblas-0.3.10-AIX-NUM_CORES.patch.txt

  14. martin-frbg commented on Jul 7, 2020

    @martin-frbg
    Collaborator

    Need to add DEBUG=1 (or -g in your CC) to get (any chance of) detailed information from inside sblat3. (Did not help when I tried though, and setting a breakpoint at MAIN__ and single-stepping from there proved to be extremely time-consuming (to the point where my ssh to the other side of the world would die before I got to anything useful)

  15. martin-frbg commented on Jul 7, 2020

    @martin-frbg
    Collaborator

    Is there an advantage to using SC_NPROCESSORS_ONLN rather than _CONF ? (Which is what is used on Linux - changed that some years ago to improve ARM support where additional processors may wake up on demand)

  16. trex58 commented on Jul 7, 2020

    @trex58
    Author

    Is there an advantage to using SC_NPROCESSORS_ONLN rather than _CONF ?

    The man of sysconf on both AIX and Fedora say:
    AIX : _SC_NPROCESSORS_ONLN Number of processors online.
    Fedora: - _SC_NPROCESSORS_ONLN The number of processors currently online (available).

    I guess that _SC_NPROCESSORS_CONF is what was set at start of the VM and that the number of processors may have been dynamically changed. Thus _SC_NPROCESSORS_ONLN should show what is available at the time of the call, I think.

  17. martin-frbg commented on Jul 7, 2020

    @martin-frbg
    Collaborator

    Just asking as we used to see the opposite effect (on armv8 however), where ONLN would show less than actually available (the others taking a nap unless some other compute-intensive task had just finished). But no problem with adding a separate code path for AIX instead of adding it to the if Linux or Sun block already there.

  18. trex58 commented on Jul 8, 2020

    @trex58
    Author

    Just asking as we used to see the opposite effect (on armv8 however)...

    On AIX, the number of CPUs available for a VM is far more complicated than on Linux. The number of CPUs for a VM can be set fixed all along the life of the VM (capped). Or it can be uncapped, with a minimum N1 and a maximum N2: thus, if the total M processors of the machine (CEC) are not used by the other (AIX or Linux) VMs, if the workload is very high on the VM, some m processors from (M-N2) can be dynamically added to N. And I'm not sure I'm describing this fully correctly.

  19. martin-frbg commented on Jul 8, 2020

    @martin-frbg
    Collaborator

    returning tp the original topic, what is a bit suspicious to me is that the Power8 GEMM kernels have a surprisingly tiny STACKSIZE defined in 32-bit mode (400 bytes compared to 34k), exploring that now

  20. trex58 commented on Jul 8, 2020

    @trex58
    Author

    About this issue, after testing with the appropriate options, it looks like there are issues with GCC and gdb, in 32bit only and Power8.

    • gdb is unable to show how the code of sblat3.f is executed after about one hundred of lines. It looks like running crazy in its own code, looping for ever.
    • GCC probably generates something wrong, and in addition the Fortran signal handler seems to do wrong things.

    We have to clarify this.

  21. trex58 commented on Jul 8, 2020

    @trex58
    Author

    returning tp the original topic, what is a bit suspicious to me is that the Power8 GEMM kernels have a surprisingly tiny STACKSIZE defined in 32-bit mode (400 bytes compared to 34k), exploring that now

    What is "Power8 GEMM kernel" ?

    Looking at my environment, we are using:

    export OBJECT_MODE=32
    export CC="gcc -maix32"
    export CXX="g++ -maix32"
    export FC="gfortran -maix32"
    export LDFLAGS="-Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000"
    

    Moreover, by default on AIX, there are limitations to several sizes, including the "stack size". By means of: ulimit ...
    Extending "max memory size", "stack size", and 'data seg size" did not fixed the issue.
    Nothing better with: export AIXTHREAD_STK=400000 too .

    ulimit -m unlimited
    ulimit -d unlimited
    ulimit -s unlimited
    
  22. martin-frbg commented on Jul 8, 2020

    @martin-frbg
    Collaborator

    What is "Power8 GEMM kernel" ?

    From kernel/power/KERNEL.POWER8 : SGEMMKERNEL= sgemm_kernel_16x8_power8.S which has

    ifdef __64BIT__
    #define STACKSIZE 32752
    ...
    else
    #define STACKSIZE 440
    

    (but blindly increasing the STACKSIZE value does not have the desired effect )

  23. martin-frbg commented on Jul 14, 2020

    @martin-frbg
    Collaborator

    The problem appears to affect the GEMM/TRMM kernels as well as DTRSM. So far #2682 only automates the choice of POWER6 kernels when TARGET=POWER8 was specified for a 32 bit build (but this does not work for autodetection, kind of a chicken-and-egg problem there). A somewhat more flexible workaround would leave the build system unchanged but add a big messy ifdef big-endian and 32bit in KERNEL.POWER8 to replace the affected kernels with their POWER6 equivalents (with a corresponding 32bit-section using POWER6 GEMM_UNROLL values in param.h). Still no clue on the actual overflow or other coding issue behind all this though - can you estimate how prevalent 32bit POWER8 is (i.e. how important getting full performance on that platform would be) ?

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