Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault with ifort #14

Open
ivan-pi opened this issue Mar 7, 2023 · 0 comments
Open

Segfault with ifort #14

ivan-pi opened this issue Mar 7, 2023 · 0 comments

Comments

@ivan-pi
Copy link
Collaborator

ivan-pi commented Mar 7, 2023

With the ifort compiler I get a crash after a while.

Build information
$ FC=ifort cmake .. -DFASTGPT_BLAS=Fortran -DCMAKE_BUILD_TYPE=Debug
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The Fortran compiler identification is Intel 20.2.5.20211109
-- Check for working Fortran compiler: /opt/intel/oneapi/compiler/2022.0.2/linux/bin/intel64/ifort
-- Check for working Fortran compiler: /opt/intel/oneapi/compiler/2022.0.2/linux/bin/intel64/ifort  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /opt/intel/oneapi/compiler/2022.0.2/linux/bin/intel64/ifort supports Fortran 90
-- Checking whether /opt/intel/oneapi/compiler/2022.0.2/linux/bin/intel64/ifort supports Fortran 90 -- yes


Configuration results
---------------------
Fortran compiler: /opt/intel/oneapi/compiler/2022.0.2/linux/bin/intel64/ifort
Build type: Debug
Fortran compiler flags: -warn all -check all,noarg_temp_created -traceback -O1 -g
Installation prefix: /usr/local
FASTGPT_BLAS: Fortran
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ivan/lrz/fastGPT/build

Output:

(fastgpt) ivan@maxwell:~/lrz/fastGPT$ gprofng collect app ./build/gpt2 
Creating experiment directory test.10.er (Process ID: 260289) ...
Loading the model...
    done.
Model parameters:
n_vocab = 50257
n_ctx   =  1024
n_embd  =   768
n_layer =    12
n_head  =    12
 
Input parameters:
n_seq                =   6
n_tokens_to_generate =  20
 
Input tokens:
   464   995   286  9439 14448   284
Decoded input as text:
The world of tomorrow belongs to
Running model...
           1         262
           2         661
           3         286
           4        9439
           5          13
           6         198
           7         198
           8         464
           9         995
          10         286
          11        9439
          12       14448
          13         284
          14         262
          15         661
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source             
gpt2               000000000042F1FA  Unknown               Unknown  Unknown
libpthread-2.31.s  00007F2B36905420  Unknown               Unknown  Unknown
gpt2               00000000004268D3  linalg_mp_matmul_          18  linalg_f.f90
gpt2               000000000041EB03  gpt2_mod_mp_gpt2_         165  gpt2.f90
gpt2               00000000004208D6  gpt2_mod_mp_gener         194  gpt2.f90
gpt2               000000000040A56F  MAIN__                     85  main.f90
gpt2               0000000000403862  Unknown               Unknown  Unknown
libc-2.31.so       00007F2B3671D083  __libc_start_main     Unknown  Unknown
gpt2               000000000040376E  Unknown               Unknown  Unknown

I'm guessing this is related to the stack vs heap array issue with the Intel compiler and matmul (https://fortran-lang.discourse.group/t/testing-the-performance-of-matmul-under-default-compiler-settings/4096/27).

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

No branches or pull requests

1 participant