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

ggml : fix compiling when SSE3 is available but not SSSE3 #1210

Merged
merged 1 commit into from
Aug 27, 2023

Conversation

przemoc
Copy link
Contributor

@przemoc przemoc commented Aug 27, 2023

It got broken in commit 3998465.

@przemoc
Copy link
Contributor Author

przemoc commented Aug 27, 2023

How it fails without this fix:

$ make
I whisper.cpp build info: 
I UNAME_S:  Linux
I UNAME_P:  unknown
I UNAME_M:  x86_64
I CFLAGS:   -I.              -O3 -DNDEBUG -std=c11   -fPIC -pthread -msse3
I CXXFLAGS: -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -pthread
I LDFLAGS:  
I CC:       cc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924
I CXX:      g++ (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924

cc  -I.              -O3 -DNDEBUG -std=c11   -fPIC -pthread -msse3   -c ggml.c -o ggml.o
ggml.c:2204:15: error: unknown type name '__m128'
 2204 | static inline __m128 __sse_f16x4_load(ggml_fp16_t *x) {
      |               ^~~~~~
ggml.c: In function '__sse_f16x4_load':
ggml.c:2212:12: warning: implicit declaration of function '_mm_loadu_ps' [-Wimplicit-function-declaration]
 2212 |     return _mm_loadu_ps(tmp);
      |            ^~~~~~~~~~~~
ggml.c: At top level:
ggml.c:2215:54: error: unknown type name '__m128'; did you mean '__int128'?
 2215 | static inline void __sse_f16x4_store(ggml_fp16_t *x, __m128 y) {
      |                                                      ^~~~~~
      |                                                      __int128
ggml.c: In function 'ggml_vec_dot_f32':
ggml.c:2157:28: error: unknown type name '__m128'; did you mean '__int128'?
 2157 | #define GGML_F32x4         __m128
      |                            ^~~~~~
ggml.c:2189:29: note: in expansion of macro 'GGML_F32x4'
 2189 | #define GGML_F32_VEC        GGML_F32x4
      |                             ^~~~~~~~~~
ggml.c:2283:5: note: in expansion of macro 'GGML_F32_VEC'
 2283 |     GGML_F32_VEC sum[GGML_F32_ARR] = { GGML_F32_VEC_ZERO };
      |     ^~~~~~~~~~~~
ggml.c:2158:28: warning: implicit declaration of function '_mm_setzero_ps' [-Wimplicit-function-declaration]
 2158 | #define GGML_F32x4_ZERO    _mm_setzero_ps()
      |                            ^~~~~~~~~~~~~~
ggml.c:2190:29: note: in expansion of macro 'GGML_F32x4_ZERO'
 2190 | #define GGML_F32_VEC_ZERO   GGML_F32x4_ZERO
      |                             ^~~~~~~~~~~~~~~
ggml.c:2283:40: note: in expansion of macro 'GGML_F32_VEC_ZERO'
 2283 |     GGML_F32_VEC sum[GGML_F32_ARR] = { GGML_F32_VEC_ZERO };
      |                                        ^~~~~~~~~~~~~~~~~
ggml.c:2157:28: error: unknown type name '__m128'; did you mean '__int128'?
 2157 | #define GGML_F32x4         __m128
      |                            ^~~~~~
ggml.c:2189:29: note: in expansion of macro 'GGML_F32x4'
 2189 | #define GGML_F32_VEC        GGML_F32x4
      |                             ^~~~~~~~~~
ggml.c:2285:5: note: in expansion of macro 'GGML_F32_VEC'
 2285 |     GGML_F32_VEC ax[GGML_F32_ARR];
      |     ^~~~~~~~~~~~
ggml.c:2157:28: error: unknown type name '__m128'; did you mean '__int128'?
 2157 | #define GGML_F32x4         __m128
      |                            ^~~~~~
ggml.c:2189:29: note: in expansion of macro 'GGML_F32x4'
 2189 | #define GGML_F32_VEC        GGML_F32x4
      |                             ^~~~~~~~~~
ggml.c:2286:5: note: in expansion of macro 'GGML_F32_VEC'
 2286 |     GGML_F32_VEC ay[GGML_F32_ARR];
      |     ^~~~~~~~~~~~
ggml.c:2166:37: warning: implicit declaration of function '_mm_add_ps' [-Wimplicit-function-declaration]
 2166 |     #define GGML_F32x4_FMA(a, b, c) _mm_add_ps(_mm_mul_ps(b, c), a)
      |                                     ^~~~~~~~~~
ggml.c:2194:29: note: in expansion of macro 'GGML_F32x4_FMA'
 2194 | #define GGML_F32_VEC_FMA    GGML_F32x4_FMA
      |                             ^~~~~~~~~~~~~~
ggml.c:2293:22: note: in expansion of macro 'GGML_F32_VEC_FMA'
 2293 |             sum[j] = GGML_F32_VEC_FMA(sum[j], ax[j], ay[j]);
      |                      ^~~~~~~~~~~~~~~~
ggml.c:2166:48: warning: implicit declaration of function '_mm_mul_ps' [-Wimplicit-function-declaration]
 2166 |     #define GGML_F32x4_FMA(a, b, c) _mm_add_ps(_mm_mul_ps(b, c), a)
      |                                                ^~~~~~~~~~
ggml.c:2194:29: note: in expansion of macro 'GGML_F32x4_FMA'
 2194 | #define GGML_F32_VEC_FMA    GGML_F32x4_FMA
      |                             ^~~~~~~~~~~~~~
ggml.c:2293:22: note: in expansion of macro 'GGML_F32_VEC_FMA'
 2293 |             sum[j] = GGML_F32_VEC_FMA(sum[j], ax[j], ay[j]);
      |                      ^~~~~~~~~~~~~~~~
ggml.c:2184:11: error: unknown type name '__m128'
 2184 |     const __m128 t0 = _mm_hadd_ps(x[0], x[0]);                    \
      |           ^~~~~~
ggml.c:2197:29: note: in expansion of macro 'GGML_F32x4_REDUCE'
 2197 | #define GGML_F32_VEC_REDUCE GGML_F32x4_REDUCE
      |                             ^~~~~~~~~~~~~~~~~
ggml.c:2298:5: note: in expansion of macro 'GGML_F32_VEC_REDUCE'
 2298 |     GGML_F32_VEC_REDUCE(sumf, sum);
      |     ^~~~~~~~~~~~~~~~~~~
ggml.c:2184:23: warning: implicit declaration of function '_mm_hadd_ps' [-Wimplicit-function-declaration]
 2184 |     const __m128 t0 = _mm_hadd_ps(x[0], x[0]);                    \
      |                       ^~~~~~~~~~~
ggml.c:2197:29: note: in expansion of macro 'GGML_F32x4_REDUCE'
 2197 | #define GGML_F32_VEC_REDUCE GGML_F32x4_REDUCE
      |                             ^~~~~~~~~~~~~~~~~
ggml.c:2298:5: note: in expansion of macro 'GGML_F32_VEC_REDUCE'
 2298 |     GGML_F32_VEC_REDUCE(sumf, sum);
      |     ^~~~~~~~~~~~~~~~~~~
ggml.c:2185:11: warning: implicit declaration of function '_mm_cvtss_f32' [-Wimplicit-function-declaration]
 2185 |     res = _mm_cvtss_f32(_mm_hadd_ps(t0, t0));                     \
      |           ^~~~~~~~~~~~~
ggml.c:2197:29: note: in expansion of macro 'GGML_F32x4_REDUCE'
 2197 | #define GGML_F32_VEC_REDUCE GGML_F32x4_REDUCE
      |                             ^~~~~~~~~~~~~~~~~
ggml.c:2298:5: note: in expansion of macro 'GGML_F32_VEC_REDUCE'
 2298 |     GGML_F32_VEC_REDUCE(sumf, sum);
      |     ^~~~~~~~~~~~~~~~~~~
ggml.c: In function 'ggml_vec_dot_f16':
ggml.c:2226:33: error: unknown type name '__m128'; did you mean '__int128'?
 2226 | #define GGML_F32Cx4             __m128
      |                                 ^~~~~~
ggml.c:2236:38: note: in expansion of macro 'GGML_F32Cx4'
 2236 | #define GGML_F16_VEC                 GGML_F32Cx4
      |                                      ^~~~~~~~~~~
ggml.c:2321:5: note: in expansion of macro 'GGML_F16_VEC'
 2321 |     GGML_F16_VEC sum[GGML_F16_ARR] = { GGML_F16_VEC_ZERO };
      |     ^~~~~~~~~~~~
ggml.c:2226:33: error: unknown type name '__m128'; did you mean '__int128'?
 2226 | #define GGML_F32Cx4             __m128
      |                                 ^~~~~~
ggml.c:2236:38: note: in expansion of macro 'GGML_F32Cx4'
 2236 | #define GGML_F16_VEC                 GGML_F32Cx4
      |                                      ^~~~~~~~~~~
ggml.c:2323:5: note: in expansion of macro 'GGML_F16_VEC'
 2323 |     GGML_F16_VEC ax[GGML_F16_ARR];
      |     ^~~~~~~~~~~~
ggml.c:2226:33: error: unknown type name '__m128'; did you mean '__int128'?
 2226 | #define GGML_F32Cx4             __m128
      |                                 ^~~~~~
ggml.c:2236:38: note: in expansion of macro 'GGML_F32Cx4'
 2236 | #define GGML_F16_VEC                 GGML_F32Cx4
      |                                      ^~~~~~~~~~~
ggml.c:2324:5: note: in expansion of macro 'GGML_F16_VEC'
 2324 |     GGML_F16_VEC ay[GGML_F16_ARR];
      |     ^~~~~~~~~~~~
ggml.c:2184:11: error: unknown type name '__m128'
 2184 |     const __m128 t0 = _mm_hadd_ps(x[0], x[0]);                    \
      |           ^~~~~~
ggml.c:2234:33: note: in expansion of macro 'GGML_F32x4_REDUCE'
 2234 | #define GGML_F32Cx4_REDUCE      GGML_F32x4_REDUCE
      |                                 ^~~~~~~~~~~~~~~~~
ggml.c:2244:38: note: in expansion of macro 'GGML_F32Cx4_REDUCE'
 2244 | #define GGML_F16_VEC_REDUCE          GGML_F32Cx4_REDUCE
      |                                      ^~~~~~~~~~~~~~~~~~
ggml.c:2336:5: note: in expansion of macro 'GGML_F16_VEC_REDUCE'
 2336 |     GGML_F16_VEC_REDUCE(sumf, sum);
      |     ^~~~~~~~~~~~~~~~~~~
ggml.c: In function 'ggml_vec_dot_f16_unroll':
ggml.c:2226:33: error: unknown type name '__m128'; did you mean '__int128'?
 2226 | #define GGML_F32Cx4             __m128
      |                                 ^~~~~~
ggml.c:2236:38: note: in expansion of macro 'GGML_F32Cx4'
 2236 | #define GGML_F16_VEC                 GGML_F32Cx4
      |                                      ^~~~~~~~~~~
ggml.c:3359:5: note: in expansion of macro 'GGML_F16_VEC'
 3359 |     GGML_F16_VEC sum[GGML_VEC_DOT_UNROLL][GGML_F16_ARR] = { { GGML_F16_VEC_ZERO } };
      |     ^~~~~~~~~~~~
ggml.c:2226:33: error: unknown type name '__m128'; did you mean '__int128'?
 2226 | #define GGML_F32Cx4             __m128
      |                                 ^~~~~~
ggml.c:2236:38: note: in expansion of macro 'GGML_F32Cx4'
 2236 | #define GGML_F16_VEC                 GGML_F32Cx4
      |                                      ^~~~~~~~~~~
ggml.c:3361:5: note: in expansion of macro 'GGML_F16_VEC'
 3361 |     GGML_F16_VEC ax[GGML_F16_ARR];
      |     ^~~~~~~~~~~~
ggml.c:2226:33: error: unknown type name '__m128'; did you mean '__int128'?
 2226 | #define GGML_F32Cx4             __m128
      |                                 ^~~~~~
ggml.c:2236:38: note: in expansion of macro 'GGML_F32Cx4'
 2236 | #define GGML_F16_VEC                 GGML_F32Cx4
      |                                      ^~~~~~~~~~~
ggml.c:3362:5: note: in expansion of macro 'GGML_F16_VEC'
 3362 |     GGML_F16_VEC ay[GGML_F16_ARR];
      |     ^~~~~~~~~~~~
ggml.c:2184:11: error: unknown type name '__m128'
 2184 |     const __m128 t0 = _mm_hadd_ps(x[0], x[0]);                    \
      |           ^~~~~~
ggml.c:2234:33: note: in expansion of macro 'GGML_F32x4_REDUCE'
 2234 | #define GGML_F32Cx4_REDUCE      GGML_F32x4_REDUCE
      |                                 ^~~~~~~~~~~~~~~~~
ggml.c:2244:38: note: in expansion of macro 'GGML_F32Cx4_REDUCE'
 2244 | #define GGML_F16_VEC_REDUCE          GGML_F32Cx4_REDUCE
      |                                      ^~~~~~~~~~~~~~~~~~
ggml.c:3378:9: note: in expansion of macro 'GGML_F16_VEC_REDUCE'
 3378 |         GGML_F16_VEC_REDUCE(sumf[k], sum[k]);
      |         ^~~~~~~~~~~~~~~~~~~
ggml.c: In function 'ggml_vec_mad_f32':
ggml.c:2157:28: error: unknown type name '__m128'; did you mean '__int128'?
 2157 | #define GGML_F32x4         __m128
      |                            ^~~~~~
ggml.c:2189:29: note: in expansion of macro 'GGML_F32x4'
 2189 | #define GGML_F32_VEC        GGML_F32x4
      |                             ^~~~~~~~~~
ggml.c:3404:5: note: in expansion of macro 'GGML_F32_VEC'
 3404 |     GGML_F32_VEC vx = GGML_F32_VEC_SET1(v);
      |     ^~~~~~~~~~~~
ggml.c:2159:28: warning: implicit declaration of function '_mm_set1_ps' [-Wimplicit-function-declaration]
 2159 | #define GGML_F32x4_SET1(x) _mm_set1_ps(x)
      |                            ^~~~~~~~~~~
ggml.c:2191:29: note: in expansion of macro 'GGML_F32x4_SET1'
 2191 | #define GGML_F32_VEC_SET1   GGML_F32x4_SET1
      |                             ^~~~~~~~~~~~~~~
ggml.c:3404:23: note: in expansion of macro 'GGML_F32_VEC_SET1'
 3404 |     GGML_F32_VEC vx = GGML_F32_VEC_SET1(v);
      |                       ^~~~~~~~~~~~~~~~~
ggml.c:2157:28: error: unknown type name '__m128'; did you mean '__int128'?
 2157 | #define GGML_F32x4         __m128
      |                            ^~~~~~
ggml.c:2189:29: note: in expansion of macro 'GGML_F32x4'
 2189 | #define GGML_F32_VEC        GGML_F32x4
      |                             ^~~~~~~~~~
ggml.c:3406:5: note: in expansion of macro 'GGML_F32_VEC'
 3406 |     GGML_F32_VEC ax[GGML_F32_ARR];
      |     ^~~~~~~~~~~~
ggml.c:2157:28: error: unknown type name '__m128'; did you mean '__int128'?
 2157 | #define GGML_F32x4         __m128
      |                            ^~~~~~
ggml.c:2189:29: note: in expansion of macro 'GGML_F32x4'
 2189 | #define GGML_F32_VEC        GGML_F32x4
      |                             ^~~~~~~~~~
ggml.c:3407:5: note: in expansion of macro 'GGML_F32_VEC'
 3407 |     GGML_F32_VEC ay[GGML_F32_ARR];
      |     ^~~~~~~~~~~~
ggml.c:2161:28: warning: implicit declaration of function '_mm_storeu_ps' [-Wimplicit-function-declaration]
 2161 | #define GGML_F32x4_STORE   _mm_storeu_ps
      |                            ^~~~~~~~~~~~~
ggml.c:2193:29: note: in expansion of macro 'GGML_F32x4_STORE'
 2193 | #define GGML_F32_VEC_STORE  GGML_F32x4_STORE
      |                             ^~~~~~~~~~~~~~~~
ggml.c:3415:13: note: in expansion of macro 'GGML_F32_VEC_STORE'
 3415 |             GGML_F32_VEC_STORE(y + i + j*GGML_F32_EPR, ay[j]);
      |             ^~~~~~~~~~~~~~~~~~
ggml.c: In function 'ggml_vec_scale_f32':
ggml.c:2157:28: error: unknown type name '__m128'; did you mean '__int128'?
 2157 | #define GGML_F32x4         __m128
      |                            ^~~~~~
ggml.c:2189:29: note: in expansion of macro 'GGML_F32x4'
 2189 | #define GGML_F32_VEC        GGML_F32x4
      |                             ^~~~~~~~~~
ggml.c:3436:5: note: in expansion of macro 'GGML_F32_VEC'
 3436 |     GGML_F32_VEC vx = GGML_F32_VEC_SET1(v);
      |     ^~~~~~~~~~~~
ggml.c:2157:28: error: unknown type name '__m128'; did you mean '__int128'?
 2157 | #define GGML_F32x4         __m128
      |                            ^~~~~~
ggml.c:2189:29: note: in expansion of macro 'GGML_F32x4'
 2189 | #define GGML_F32_VEC        GGML_F32x4
      |                             ^~~~~~~~~~
ggml.c:3438:5: note: in expansion of macro 'GGML_F32_VEC'
 3438 |     GGML_F32_VEC ay[GGML_F32_ARR];
      |     ^~~~~~~~~~~~
make: *** [Makefile:230: ggml.o] Error 1

@ggerganov ggerganov merged commit 25466aa into ggerganov:master Aug 27, 2023
35 checks passed
@przemoc przemoc deleted the fix-sse3-no-ssse3-compilation branch August 27, 2023 20:41
jacobwu-b pushed a commit to jacobwu-b/Transcriptify-by-whisper.cpp that referenced this pull request Oct 24, 2023
jacobwu-b pushed a commit to jacobwu-b/Transcriptify-by-whisper.cpp that referenced this pull request Oct 24, 2023
vonstring pushed a commit to vonstring/whisper.cpp that referenced this pull request Nov 7, 2023
landtanin pushed a commit to landtanin/whisper.cpp that referenced this pull request Dec 16, 2023
iThalay pushed a commit to iThalay/whisper.cpp that referenced this pull request Sep 23, 2024
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

Successfully merging this pull request may close these issues.

2 participants