Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
llama.cpp: version update (#18577)
Daniel Hiltgen13e024713219
diff --git a/LLAMA_CPP_VERSION b/LLAMA_CPP_VERSIONindex 843393877..fd9ce0a77 100644--- a/LLAMA_CPP_VERSION+++ b/LLAMA_CPP_VERSION@@ -1 +1 @@-b10969+b11081diff --git a/llama/compat/README.md b/llama/compat/README.mdindex caf3fbcfd..52a9bb905 100644--- a/llama/compat/README.md+++ b/llama/compat/README.md@@ -25,17 +25,10 @@ intentionally skipped so a developer can iterate on a local llama.cpp tree.small tensor repacking primitives.- `001-llama-cpp-hooks.patch` - small additive call-site edits in llama.cpp files.It currently touches `src/llama-model-loader.cpp` and `tools/mtmd/clip.cpp`.-- `002-llama-cpp-ui-empty-assets.patch` - lets the llama.cpp UI embed helper- generate an empty asset table when no UI assets are present.- `compat.cmake` - CMake glue that invokes the shared`cmake/apply-git-patches.cmake` idempotent applier (used by`llama/server/CMakeLists.txt`) for every `*.patch` under- this directory by numeric filename order — the hooks patch plus each- `models/` architecture patch.-- `models/` - the sibling **new-architecture** layer: implementations of- architectures llama.cpp doesn't support yet, each added via a small- registration patch. (Those files *add* archs; the files above *translate*- existing GGUFs onto archs llama.cpp already has.)+ this directory by numeric filename order.The compatibility source files stay in this directory and are linked into thefetched llama.cpp targets. The patch file only adds call sites.diff --git a/llama/compat/models/003-llama-cpp-laguna-metal.patch b/llama/compat/models/003-llama-cpp-laguna-metal.patchdeleted file mode 100644index 689adb93d..000000000--- a/llama/compat/models/003-llama-cpp-laguna-metal.patch+++ /dev/null@@ -1,42 +0,0 @@-diff --git a/src/models/laguna.cpp b/src/models/laguna.cpp-index 1d705440e..7e708b144 100644---- a/src/models/laguna.cpp-+++ b/src/models/laguna.cpp-@@ -275,16 +275,35 @@ llama_model_laguna::graph::graph(const llama_model & model, const llm_graph_para- if ((uint32_t)il >= hparams.n_layer_dense_lead) {- // MoE: sigmoid routing + score-correction bias + sum-norm +- // routed_scaling_factor (all handled by build_moe_ffn).-+ ggml_tensor * up_scale = nullptr;-+ float expert_weights_scale = hparams.expert_weights_scale;-+-+#if defined(GGML_USE_METAL)-+ const ggml_type down_type = model.layers[il].ffn_down_exps->type;-+ if (n_tokens >= 32 && (ggml_is_quantized(down_type) || down_type == GGML_TYPE_F16)) {-+ // At 32 prompt tokens, Metal switches MUL_MAT_ID from its-+ // range-safe matrix-vector kernel to FP16 matrix tiles.-+ // Laguna's routed SwiGLU activations can overflow those tiles.-+ // Generation uses one token and does not need this workaround.-+ constexpr float down_input_scale = 1.0f / 256.0f;-+ up_scale = ggml_fill(ctx0,-+ model.layers[il].ffn_exp_probs_b, down_input_scale);-+ expert_weights_scale /= down_input_scale;-+ }-+#endif-+- ggml_tensor * moe_out = build_moe_ffn(cur,- model.layers[il].ffn_gate_inp,- model.layers[il].ffn_up_exps,- model.layers[il].ffn_gate_exps,- model.layers[il].ffn_down_exps,- model.layers[il].ffn_exp_probs_b,- n_expert, n_expert_used,- LLM_FFN_SILU,- hparams.expert_weights_norm,-- hparams.expert_weights_scale,-+ expert_weights_scale,- (llama_expert_gating_func_type) hparams.expert_gating_func,-- il);-+ il,-+ nullptr, nullptr,-+ up_scale);- cb(moe_out, "ffn_moe_out", il);diff --git a/llm/status.go b/llm/status.goindex 8f5951ddf..d14f93919 100644--- a/llm/status.go+++ b/llm/status.go@@ -93,6 +93,10 @@ var outOfMemorySubstrings = []string{"insufficient memory","vk_error_out_of_device_memory","erroroutofmemory",+ // graph buffer reservation failures are memory exhaustion (llama.cpp+ // ggml_backend_sched_alloc_splits and the llama_context probe checks);+ // older llama.cpp surfaced these as "failed to allocate graph"+ "failed to reserve graph",}var recoverableOutOfMemorySubstrings = []string{diff --git a/llm/status_test.go b/llm/status_test.goindex cf69f11f9..9d04ab8a4 100644--- a/llm/status_test.go+++ b/llm/status_test.go@@ -36,6 +36,11 @@ func TestStatusWriterCapturesErrorLine(t *testing.T) {"\tgolang.org/x/[email protected]/errgroup/errgroup.go:93 +0x50\n",want: "panic: mlx: Failed to compile kernel: nvrtc: error: invalid value for --gpu-architecture (-arch)",},+ {+ name: "graph reserve failure",+ log: "ggml_backend_sched_alloc_splits: failed to reserve graph buffers\n",+ want: "ggml_backend_sched_alloc_splits: failed to reserve graph buffers",+ },}for _, tt := range tests {@@ -75,6 +80,9 @@ func TestIsOutOfMemoryMessage(t *testing.T) {{"cudaMalloc failed: out of memory", true},{"error: Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory)", true},{"failed to allocate context", true},+ {"ggml_backend_sched_alloc_splits: failed to reserve graph buffers", true},+ {"failed to reserve graph for quantization check", true},+ {"failed to reserve table", false},{"model loaded successfully", false},}