Skip to content

Compile bug: Unable to compile on s390x (Regression Identified) #12846

@taronaeo

Description

@taronaeo

Git commit

$ git rev-parse HEAD
381603a

Operating systems

Linux

GGML backends

CPU, BLAS

Problem description & steps to reproduce

Regression identified: 995083e

After changes implemented commit 995083e, s390x fails to compile even though the code is the same.

Steps to reproduce:

  1. Pull latest llama.cpp
  2. Compile using cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_BLAS=ON -DBLAS_ROOT=/opt/openblas-libs -DGGML_BLAS_VENDOR=OpenBLAS -DLLAMA_CURL=OFF -DGGML_CCACHE=OFF
  3. Build using cmake --build build/ --config Release -j $(nproc)
  4. Notice the error
In file included from /opt/llama-testbed/ggml/src/ggml-cpu/vec.h:6,
                 from /opt/llama-testbed/ggml/src/ggml-cpu/vec.cpp:1:
/opt/llama-testbed/ggml/src/ggml-cpu/simd-mappings.h: In function ‘__vector(4) float __lzs_f16cx4_load(const ggml_fp16_t*)’:
/opt/llama-testbed/ggml/src/ggml-cpu/simd-mappings.h:854:18: error: invalid parameter combination for intrinsic ‘__builtin_s390_vec_xl’
  854 |     return vec_xl(0, tmp);
      |                  ^
In file included from /opt/llama-testbed/ggml/src/ggml-cpu/vec.h:6,
                 from /opt/llama-testbed/ggml/src/ggml-cpu/ops.cpp:7:
/opt/llama-testbed/ggml/src/ggml-cpu/simd-mappings.h: In function ‘__vector(4) float __lzs_f16cx4_load(const ggml_fp16_t*)’:
/opt/llama-testbed/ggml/src/ggml-cpu/simd-mappings.h:854:18: error: invalid parameter combination for intrinsic ‘__builtin_s390_vec_xl’
  854 |     return vec_xl(0, tmp);
      |                  ^
gmake[2]: *** [ggml/src/CMakeFiles/ggml-cpu.dir/build.make:216: ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/vec.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
/opt/llama-testbed/ggml/src/ggml-cpu/simd-mappings.h:860: confused by earlier errors, bailing out
gmake[2]: *** [ggml/src/CMakeFiles/ggml-cpu.dir/build.make:230: ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ops.cpp.o] Error 1
[ 13%] Linking CXX shared library ../../../bin/libggml-blas.so
[ 13%] Built target ggml-blas
gmake[1]: *** [CMakeFiles/Makefile2:1764: ggml/src/CMakeFiles/ggml-cpu.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

First Bad Commit

$ git bisect good
995083e4ed24933e6a289472f9de0f0b53ca5eca is the first bad commit
commit 995083e4ed24933e6a289472f9de0f0b53ca5eca
Author: cmdr2 <[email protected]>
Date:   Wed Apr 2 17:46:16 2025 +0530

    cpu: move all the operators into a separate c++ file (except mul_mat) (ggml/1167)

    * cpu: refactor SIMD mappings and vectorized op functions into separate files

    * Fix warning for ggml_float to float

    * Fix warnings

    * cpu: move all the operations (except mul_mat) to a separate c++ file

    * fix whitespace

    * Update ggml/src/ggml-cpu/vec.h

    Co-authored-by: Diego Devesa <[email protected]>

    * Fix PR comments - use GGML_UNUSED, use cassert in ops.cpp

    * Reverse the order of import for ops.h and vec.h, to match what was present in ggml-cpu.c previously

    ---------

    Co-authored-by: Diego Devesa <[email protected]>

    ggml/src/ggml-cpu/CMakeLists.txt  |     5 +
    ggml/src/ggml-cpu/ggml-cpu.c      | 12382 +++++++---------------------------------------------------------------------------------
    ggml/src/ggml-cpu/ops.cpp         |  8719 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ggml/src/ggml-cpu/ops.h           |   128 +
    ggml/src/ggml-cpu/simd-mappings.h |   884 +++++++
    ggml/src/ggml-cpu/vec.cpp         |   258 ++
    ggml/src/ggml-cpu/vec.h           |   802 ++++++
    7 files changed, 11677 insertions(+), 11501 deletions(-)
    create mode 100644 ggml/src/ggml-cpu/ops.cpp
    create mode 100644 ggml/src/ggml-cpu/ops.h
    create mode 100644 ggml/src/ggml-cpu/simd-mappings.h
    create mode 100644 ggml/src/ggml-cpu/vec.cpp
    create mode 100644 ggml/src/ggml-cpu/vec.h

Compile command

cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_BLAS=ON -DBLAS_ROOT=/opt/openblas-libs -DGGML_BLAS_VENDOR=OpenBLAS -DLLAMA_CURL=OFF -DGGML_CCACHE=OFF

Relevant log output

In file included from /opt/llama-testbed/ggml/src/ggml-cpu/vec.h:6,
                 from /opt/llama-testbed/ggml/src/ggml-cpu/vec.cpp:1:
/opt/llama-testbed/ggml/src/ggml-cpu/simd-mappings.h: In function ‘__vector(4) float __lzs_f16cx4_load(const ggml_fp16_t*)’:
/opt/llama-testbed/ggml/src/ggml-cpu/simd-mappings.h:854:18: error: invalid parameter combination for intrinsic ‘__builtin_s390_vec_xl’
  854 |     return vec_xl(0, tmp);
      |                  ^
In file included from /opt/llama-testbed/ggml/src/ggml-cpu/vec.h:6,
                 from /opt/llama-testbed/ggml/src/ggml-cpu/ops.cpp:7:
/opt/llama-testbed/ggml/src/ggml-cpu/simd-mappings.h: In function ‘__vector(4) float __lzs_f16cx4_load(const ggml_fp16_t*)’:
/opt/llama-testbed/ggml/src/ggml-cpu/simd-mappings.h:854:18: error: invalid parameter combination for intrinsic ‘__builtin_s390_vec_xl’
  854 |     return vec_xl(0, tmp);
      |                  ^
gmake[2]: *** [ggml/src/CMakeFiles/ggml-cpu.dir/build.make:216: ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/vec.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
/opt/llama-testbed/ggml/src/ggml-cpu/simd-mappings.h:860: confused by earlier errors, bailing out
gmake[2]: *** [ggml/src/CMakeFiles/ggml-cpu.dir/build.make:230: ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ops.cpp.o] Error 1
[ 13%] Linking CXX shared library ../../../bin/libggml-blas.so
[ 13%] Built target ggml-blas
gmake[1]: *** [CMakeFiles/Makefile2:1764: ggml/src/CMakeFiles/ggml-cpu.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions