Compile bug: Vulkan backend fails to build since #27512 (`signbit`/`isnan`/`isinf` undeclared in `ggml_fp32_to_f8_e4m3`), GCC 16.2 and clang 22 with libstdc++ 16
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 85/100
Direzione di ricerca
L'errore è in ggml-impl.h nella funzione ggml_fp32_to_f8_e4m3 alle righe 593, 596 e 603, dove signbit, isnan e isinf necessitano della qualificazione std::. Riproduci con cmake -B build -DGGML_VULKAN=ON && cmake --build build -j; completato quando le tre unità di traduzione Vulkan compilano senza gli errori di identificatore non dichiarato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Git commit
master at 5047748f (ggml version: 0.28.0, llama.cpp version: 0.8.0-dev), built from source.
Operating systems
Linux
GGML backends
Vulkan
Problem description & steps to reproduce
Since #27512 the Vulkan backend no longer compiles. Three translation units fail, ggml-vulkan.cpp, ggml-vulkan-buffers.cpp and ggml-vulkan-debug.cpp, each with:
ggml-impl.h:593:26: error: 'signbit' was not declared in this scope; did you mean 'std::signbit'?
ggml-impl.h:596:9: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
ggml-impl.h:603:9: error: 'isinf' was not declared in this scope; did you mean 'std::isinf'?
Reproduced with GCC 16.2.0 and with clang 22.0.0 (ROCm 7.2.4, C and C++ compilers both clang). Both use libstdc++ 16 (.../c++/16/cmath appears in the notes). I did not test other standard library versions or libc++.
Steps: cmake -B build -DGGML_VULKAN=ON && cmake --build build -j
First Bad Commit
68d20b88, "Quant: OCP FP8 E4M3 support (#27512)", 2026-10-29.
Bisected by building both sides with identical configuration (GCC 16.2.0, Vulkan and HIP enabled):
- 68d20b88~1 (
ggml commit: 0893ec98): builds successfully to 100%. - 68d20b88: fails in the three Vulkan files above.
git log -L on ggml_fp32_to_f8_e4m3 shows the function, with its unqualified signbit/isnan/isinf calls, was introduced by this commit. The clang 22 failure was observed on master, not bisected.
Compile command
cmake -B build -DGGML_VULKAN=ON && cmake --build build -j
- The clang run used `-DCMAKE_C_COMPILER=$(hipconfig -l)/clang -DCMAKE_CXX_COMPILER=$(hipconfig -l)/clang++`
Relevant log output
#### GCC
[ 54%] Building CXX object ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/unary.comp.cpp.o
[ 54%] Building CXX object ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/tri.comp.cpp.o
[ 54%] Building CXX object ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/upscale.comp.cpp.o
[ 55%] Building CXX object ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/wkv6.comp.cpp.o
[ 55%] Building CXX object ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/wkv7.comp.cpp.o
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-types.h:93,
from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-push-constants.h:2,
from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-common.h:2,
from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-buffers.cpp:1:
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h: In function ‘uint8_t ggml_fp32_to_f8_e4m3(float)’:
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:593:26: error: ‘signbit’ was not declared in this scope; did you mean ‘std::signbit’?
593 | const uint8_t sign = signbit(x) ? 0x80 : 0;
| ^~~~~~~
| std::signbit
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-types.h:51:
/usr/include/c++/16/cmath:1248:5: note: ‘std::signbit’ declared here
1248 | signbit(_Tp __x)
| ^~~~~~~
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:596:9: error: ‘isnan’ was not declared in this scope; did you mean ‘std::isnan’?
596 | if (isnan(x)) {
| ^~~~~
| std::isnan
/usr/include/c++/16/cmath:1203:5: note: ‘std::isnan’ declared here
1203 | isnan(_Tp)
| ^~~~~
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:603:9: error: ‘isinf’ was not declared in this scope; did you mean ‘std::isinf’?
603 | if (isinf(x) || x >= 448.0f) {
| ^~~~~
| std::isinf
/usr/include/c++/16/cmath:1176:5: note: ‘std::isinf’ declared here
1176 | isinf(_Tp)
| ^~~~~
gmake[2]: *** [ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/build.make:1027: ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/ggml-vulkan-buffers.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-types.h:93,
from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-push-constants.h:2,
from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-common.h:2,
from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-debug.cpp:1:
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h: In function ‘uint8_t ggml_fp32_to_f8_e4m3(float)’:
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:593:26: error: ‘signbit’ was not declared in this scope; did you mean ‘std::signbit’?
593 | const uint8_t sign = signbit(x) ? 0x80 : 0;
| ^~~~~~~
| std::signbit
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-types.h:51:
/usr/include/c++/16/cmath:1248:5: note: ‘std::signbit’ declared here
1248 | signbit(_Tp __x)
| ^~~~~~~
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:596:9: error: ‘isnan’ was not declared in this scope; did you mean ‘std::isnan’?
596 | if (isnan(x)) {
| ^~~~~
| std::isnan
/usr/include/c++/16/cmath:1203:5: note: ‘std::isnan’ declared here
1203 | isnan(_Tp)
| ^~~~~
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:603:9: error: ‘isinf’ was not declared in this scope; did you mean ‘std::isinf’?
603 | if (isinf(x) || x >= 448.0f) {
| ^~~~~
| std::isinf
/usr/include/c++/16/cmath:1176:5: note: ‘std::isinf’ declared here
1176 | isinf(_Tp)
| ^~~~~
gmake[2]: *** [ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/build.make:1041: ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/ggml-vulkan-debug.cpp.o] Error 1
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-types.h:93,
from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-push-constants.h:2,
from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-common.h:2,
from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:1:
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h: In function ‘uint8_t ggml_fp32_to_f8_e4m3(float)’:
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:593:26: error: ‘signbit’ was not declared in this scope; did you mean ‘std::signbit’?
593 | const uint8_t sign = signbit(x) ? 0x80 : 0;
| ^~~~~~~
| std::signbit
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-types.h:51:
/usr/include/c++/16/cmath:1248:5: note: ‘std::signbit’ declared here
1248 | signbit(_Tp __x)
| ^~~~~~~
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:596:9: error: ‘isnan’ was not declared in this scope; did you mean ‘std::isnan’?
596 | if (isnan(x)) {
| ^~~~~
| std::isnan
/usr/include/c++/16/cmath:1203:5: note: ‘std::isnan’ declared here
1203 | isnan(_Tp)
| ^~~~~
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:603:9: error: ‘isinf’ was not declared in this scope; did you mean ‘std::isinf’?
603 | if (isinf(x) || x >= 448.0f) {
| ^~~~~
| std::isinf
/usr/include/c++/16/cmath:1176:5: note: ‘std::isinf’ declared here
1176 | isinf(_Tp)
| ^~~~~
gmake[2]: *** [ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/build.make:1013: ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/ggml-vulkan.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2663: ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
#### Clang
[ 48%] Building CXX object ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/wkv7.comp.cpp.o
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-buffers.cpp:1:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-common.h:2:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-push-constants.h:2:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-types.h:93:
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:593:26: error: use of undeclared identifier 'signbit'; did you mean 'std::signbit'?
593 | const uint8_t sign = signbit(x) ? 0x80 : 0;
| ^~~~~~~
| std::signbit
/usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/cmath:1232:3: note: 'std::signbit' declared here
1232 | signbit(float __x)
| ^
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-buffers.cpp:1:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-common.h:2:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-push-constants.h:2:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-types.h:93:
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:596:9: error: use of undeclared identifier 'isnan'
596 | if (isnan(x)) {
| ^~~~~
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:603:9: error: use of undeclared identifier 'isinf'
603 | if (isinf(x) || x >= 448.0f) {
| ^~~~~
3 errors generated.
gmake[2]: *** [ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/build.make:1027: ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/ggml-vulkan-buffers.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-debug.cpp:1:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-common.h:2:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-push-constants.h:2:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-types.h:93:
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:593:26: error: use of undeclared identifier 'signbit'; did you mean 'std::signbit'?
593 | const uint8_t sign = signbit(x) ? 0x80 : 0;
| ^~~~~~~
| std::signbit
/usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/cmath:1232:3: note: 'std::signbit' declared here
1232 | signbit(float __x)
| ^
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-debug.cpp:1:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-common.h:2:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-push-constants.h:2:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-types.h:93:
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:596:9: error: use of undeclared identifier 'isnan'
596 | if (isnan(x)) {
| ^~~~~
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:603:9: error: use of undeclared identifier 'isinf'
603 | if (isinf(x) || x >= 448.0f) {
| ^~~~~
3 errors generated.
gmake[2]: *** [ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/build.make:1041: ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/ggml-vulkan-debug.cpp.o] Error 1
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:1:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-common.h:2:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-push-constants.h:2:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-types.h:93:
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:593:26: error: use of undeclared identifier 'signbit'; did you mean 'std::signbit'?
593 | const uint8_t sign = signbit(x) ? 0x80 : 0;
| ^~~~~~~
| std::signbit
/usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/cmath:1232:3: note: 'std::signbit' declared here
1232 | signbit(float __x)
| ^
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp:1:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-common.h:2:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-push-constants.h:2:
In file included from /home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan-types.h:93:
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:596:9: error: use of undeclared identifier 'isnan'
596 | if (isnan(x)) {
| ^~~~~
/home/user/notebooks/llama.cpp/ggml/src/ggml-vulkan/../ggml-impl.h:603:9: error: use of undeclared identifier 'isinf'
603 | if (isinf(x) || x >= 448.0f) {
| ^~~~~
3 errors generated.
gmake[2]: *** [ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/build.make:1013: ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/ggml-vulkan.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2607: ggml/src/ggml-vulkan/CMakeFiles/ggml-vulkan.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
- Lingua principale
- C++
- Stelle
- 133k
- Fork
- 24.9k
- Merge medio
- 2g 1h
- PR unite (30g)
- 475
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ggml-org/llama.cpp
-
Feature Request: Use Huawei Ascend in the NPU support sectionForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaenhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
bug-unconfirmed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
gptneox: FFN uses tanh GELU (LLM_FFN_GELU) but GPT-NeoX/Pythia are trained with exact erf GELUAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
ggml-org/llama.cpp#31456 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Misc. bug: Sub-heading levels are incorrect for the CUDA, MUSA, and SYCL sections in the Docker documentationForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug-unconfirmed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
ggml-org/llama.cpp#31404 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Compile bug: Errors on glibc < 2.34Forse già presa @o7si l’ha presa 2 giorni fa. Apertabug-unconfirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ggml-org/llama.cpp
Issue simili
-
v3: Lua m.setvar() returns -1 on errors, so the script gets stack garbageForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta3.x bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
owasp-modsecurity/ModSecurity#3731 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Sendspin/sendspin-cpp-cli#111 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
scp-fs2open/fs2open.github.com#7984 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 4 giorni
-
core docs p3
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
RunanywhereAI/runanywhere-sdks#1199 ·
I maintainer di solito rispondono entro 1 giorno