Skip to content

oneAPI, intel icx/icpx: Fix compile warnings "explicit comparison with infinity in fast floating point mode" #4816

Closed
@stolsvik

Description

@stolsvik

Feature Description

Would be nice to not have lots of compile warnings.

These are present for multiple files, most notably in ggml.c:

[  1%] Building C object CMakeFiles/ggml.dir/ggml.c.o
/home/endre/LLAMA-file/llama.cpp.git/ggml.c:11177:23: warning: explicit comparison with infinity in fast floating point mode [-Wtautological-constant-compare]
 11177 |             if (wp[i] == -INFINITY) {
       |                 ~~~~~ ^  ~~~~~~~~~
/home/endre/LLAMA-file/llama.cpp.git/ggml.c:12849:42: warning: explicit comparison with infinity in fast floating point mode [-Wtautological-constant-compare]
 12849 |                         } else if (SS[j] == -INFINITY) {
       |                                    ~~~~~ ^  ~~~~~~~~~
/home/endre/LLAMA-file/llama.cpp.git/ggml.c:13054:35: warning: explicit comparison with infinity in fast floating point mode [-Wtautological-constant-compare]
 13054 |                         if (SS[j] == -INFINITY) {
       |                             ~~~~~ ^  ~~~~~~~~~
/home/endre/LLAMA-file/llama.cpp.git/ggml.c:13502:50: warning: explicit comparison with infinity in fast floating point mode [-Wtautological-constant-compare]
 13502 |                                 } else if (SR[j] == -INFINITY) {
       |                                            ~~~~~ ^  ~~~~~~~~~
/home/endre/LLAMA-file/llama.cpp.git/ggml.c:14251:27: warning: explicit comparison with infinity in fast floating point mode [-Wtautological-constant-compare]
 14251 |                 if (s0[i] == -INFINITY) {
       |                     ~~~~~ ^  ~~~~~~~~~
/home/endre/LLAMA-file/llama.cpp.git/ggml.c:14365:27: warning: explicit comparison with infinity in fast floating point mode [-Wtautological-constant-compare]
 14365 |                 if (s0[i] == -INFINITY) {
       |                     ~~~~~ ^  ~~~~~~~~~
6 warnings generated.

Motivation

It is a bit demotivating to see quite a bit of compile warnings when compiling a program.

Evidently these didn't matter, yi-34b-chat.Q6_K.gguf runs just fine. However, on my Xeon 6150, there was exactly 0 speedup by using oneAPI, so I am not sure it actually runs the code that possibly could be hit by these warnings?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions