Skip to content

LLM inference in C/C++

C++ ggml

ggml-cpu : keep the FP16->FP32 lookup table on x86 with F16C (#30342) (#30343)

Leebr Data Consulting685f70894b66
diff --git a/ggml/src/ggml-cpu/simd-mappings.h b/ggml/src/ggml-cpu/simd-mappings.h
index fb53ecdf42..ebb54a4ab8 100644
--- a/ggml/src/ggml-cpu/simd-mappings.h
+++ b/ggml/src/ggml-cpu/simd-mappings.h
@@ -144,7 +144,9 @@ extern float ggml_table_f32_ue4m3[1 << 8];
// do not produce codegen as checks below don't test for __F16C__
// but this check does.
#if defined(__F16C__)
-#define GGML_CPU_FP16_TO_FP32(x) GGML_CPU_COMPUTE_FP16_TO_FP32(x)
+// force FP16 -> FP32 conversion to use LUT instead
+// see: https://github.com/ggml-org/llama.cpp/issues/30342
+//#define GGML_CPU_FP16_TO_FP32(x) GGML_CPU_COMPUTE_FP16_TO_FP32(x)
#define GGML_CPU_FP32_TO_FP16(x) GGML_CPU_COMPUTE_FP32_TO_FP16(x)
#endif