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

Build error with GCC12: /usr/lib/gcc/aarch64-linux-gnu/12/include/arm_neon.h:29182:1: error: inlining failed in call to ‘always_inline’ ‘vfmaq_f16’: target specific option mismatch #185

Open
denverdino opened this issue Nov 28, 2023 · 0 comments

Comments

@denverdino
Copy link

When I build Docker image with Apple M1 Silicon. The base image includes with GCC 12.

And I got some build error as following.

In file included from /ctransformers/models/ggml/ggml.c:274:
/usr/lib/gcc/aarch64-linux-gnu/12/include/arm_neon.h: In function ‘ggml_vec_dot_f16’:
/usr/lib/gcc/aarch64-linux-gnu/12/include/arm_neon.h:29182:1: error: inlining failed in call to ‘always_inline’ ‘vfmaq_f16’: target specific option mismatch
29182 | vfmaq_f16 (float16x8_t __a, float16x8_t __b, float16x8_t __c)
      | ^~~~~~~~~
/ctransformers/models/ggml/ggml.c:1884:37: note: called from here
 1884 |     #define GGML_F16x8_FMA(a, b, c) vfmaq_f16(a, b, c)
      |                                     ^~~~~~~~~~~~~~~~~~
/ctransformers/models/ggml/ggml.c:1911:41: note: in expansion of macro ‘GGML_F16x8_FMA’
 1911 |     #define GGML_F16_VEC_FMA            GGML_F16x8_FMA
      |                                         ^~~~~~~~~~~~~~
/ctransformers/models/ggml/ggml.c:2408:22: note: in expansion of macro ‘GGML_F16_VEC_FMA’
 2408 |             sum[j] = GGML_F16_VEC_FMA(sum[j], ax[j], ay[j]);
      |                      ^~~~~~~~~~~~~~~~
/usr/lib/gcc/aarch64-linux-gnu/12/include/arm_neon.h:29182:1: error: inlining failed in call to ‘always_inline’ ‘vfmaq_f16’: target specific option mismatch
29182 | vfmaq_f16 (float16x8_t __a, float16x8_t __b, float16x8_t __c)
      | ^~~~~~~~~
/ctransformers/models/ggml/ggml.c:1884:37: note: called from here
 1884 |     #define GGML_F16x8_FMA(a, b, c) vfmaq_f16(a, b, c)
      |                                     ^~~~~~~~~~~~~~~~~~
/ctransformers/models/ggml/ggml.c:1911:41: note: in expansion of macro ‘GGML_F16x8_FMA’
 1911 |     #define GGML_F16_VEC_FMA            GGML_F16x8_FMA
      |                                         ^~~~~~~~~~~~~~
/ctransformers/models/ggml/ggml.c:2408:22: note: in expansion of macro ‘GGML_F16_VEC_FMA’
 2408 |             sum[j] = GGML_F16_VEC_FMA(sum[j], ax[j], ay[j]);
      |                      ^~~~~~~~~~~~~~~~
/usr/lib/gcc/aarch64-linux-gnu/12/include/arm_neon.h:28760:1: error: inlining failed in call to ‘always_inline’ ‘vaddq_f16’: target specific option mismatch
28760 | vaddq_f16 (float16x8_t __a, float16x8_t __b)
      | ^~~~~~~~~
/ctransformers/models/ggml/ggml.c:1891:20: note: called from here
 1891 |             x[i] = vaddq_f16(x[i], x[offset+i]);                  \
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/ctransformers/models/ggml/ggml.c:1914:41: note: in expansion of macro ‘GGML_F16x8_REDUCE’
 1914 |     #define GGML_F16_VEC_REDUCE         GGML_F16x8_REDUCE
      |                                         ^~~~~~~~~~~~~~~~~
/ctransformers/models/ggml/ggml.c:2413:5: note: in expansion of macro ‘GGML_F16_VEC_REDUCE’
 2413 |     GGML_F16_VEC_REDUCE(sumf, sum);
      |     ^~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/aarch64-linux-gnu/12/include/arm_neon.h:28760:1: error: inlining failed in call to ‘always_inline’ ‘vaddq_f16’: target specific option mismatch
28760 | vaddq_f16 (float16x8_t __a, float16x8_t __b)
      | ^~~~~~~~~
/ctransformers/models/ggml/ggml.c:1895:20: note: called from here
 1895 |             x[i] = vaddq_f16(x[i], x[offset+i]);                  \
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/ctransformers/models/ggml/ggml.c:1914:41: note: in expansion of macro ‘GGML_F16x8_REDUCE’
 1914 |     #define GGML_F16_VEC_REDUCE         GGML_F16x8_REDUCE
      |                                         ^~~~~~~~~~~~~~~~~
/ctransformers/models/ggml/ggml.c:2413:5: note: in expansion of macro ‘GGML_F16_VEC_REDUCE’
 2413 |     GGML_F16_VEC_REDUCE(sumf, sum);
      |     ^~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/aarch64-linux-gnu/12/include/arm_neon.h:28760:1: error: inlining failed in call to ‘always_inline’ ‘vaddq_f16’: target specific option mismatch
28760 | vaddq_f16 (float16x8_t __a, float16x8_t __b)
      | ^~~~~~~~~
/ctransformers/models/ggml/ggml.c:1899:20: note: called from here
 1899 |             x[i] = vaddq_f16(x[i], x[offset+i]);                  \
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/ctransformers/models/ggml/ggml.c:1914:41: note: in expansion of macro ‘GGML_F16x8_REDUCE’
 1914 |     #define GGML_F16_VEC_REDUCE         GGML_F16x8_REDUCE
      |                                         ^~~~~~~~~~~~~~~~~
/ctransformers/models/ggml/ggml.c:2413:5: note: in expansion of macro ‘GGML_F16_VEC_REDUCE’
 2413 |     GGML_F16_VEC_REDUCE(sumf, sum);
      |     ^~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/ctransformers.dir/build.make:90: CMakeFiles/ctransformers.dir/models/ggml/ggml.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/ctransformers.dir/all] Error 2

It is similar to serge-chat/serge#64

And after I roll back the GCC to GCC11, it works

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