elli-nipa / runtime /llama.cpp.patch
ActionPower
Initial release
6485c4c
Raw History Blame Contribute Delete
2.31 kB
diff --git a/src/models/qwen3.cpp b/src/models/qwen3.cpp
index d271b555e..024b043a6 100644
--- a/src/models/qwen3.cpp
+++ b/src/models/qwen3.cpp
@@ -173,12 +173,17 @@ llama_model_qwen3::graph::graph(const llama_model & model, const llm_graph_param
LLM_NORM_RMS, il);
cb(cur, "ffn_norm", il);
- if (model.layers[il].ffn_gate_norm_in) {
+ if (model.layers[il].ffn_gate_norm_in ||
+ model.layers[il].ffn_up_norm_in ||
+ model.layers[il].ffn_down_norm_in) {
// BitNet per-projection norms for MLP
- ggml_tensor * gate_inp = build_norm(cur,
- model.layers[il].ffn_gate_norm_in, NULL,
- LLM_NORM_RMS, il);
- cb(gate_inp, "ffn_gate_norm_in", il);
+ ggml_tensor * gate_inp = cur;
+ if (model.layers[il].ffn_gate_norm_in) {
+ gate_inp = build_norm(cur,
+ model.layers[il].ffn_gate_norm_in, NULL,
+ LLM_NORM_RMS, il);
+ cb(gate_inp, "ffn_gate_norm_in", il);
+ }
ggml_tensor * up_inp = cur;
if (model.layers[il].ffn_up_norm_in) {
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 780df3266..55cbc2b54 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -21,10 +21,10 @@ else()
add_subdirectory(completion)
add_subdirectory(perplexity)
add_subdirectory(quantize)
+ add_subdirectory(server)
+ add_subdirectory(cli)
if (LLAMA_BUILD_SERVER)
add_subdirectory(ui)
- add_subdirectory(cli)
- add_subdirectory(server)
endif()
add_subdirectory(tokenize)
add_subdirectory(parser)
diff --git a/tools/server/CMakeLists.txt b/tools/server/CMakeLists.txt
index b5c40884f..fb1f7220b 100644
--- a/tools/server/CMakeLists.txt
+++ b/tools/server/CMakeLists.txt
@@ -33,6 +33,7 @@ target_link_libraries(${TARGET} PUBLIC llama-common mtmd ${CMAKE_THREAD_LIBS_INI
# llama-server-impl: server logic, reusable by app
+if (LLAMA_BUILD_SERVER)
set(TARGET llama-server-impl)
add_library(${TARGET}
@@ -61,3 +62,4 @@ install(TARGETS ${TARGET} RUNTIME)
target_link_libraries(${TARGET} PRIVATE llama-server-impl)
target_compile_features(${TARGET} PRIVATE cxx_std_17)
+endif()