Skip to content

Commit 4aad979

Browse files
localai-botmudler
andauthored
chore: ⬆️ Update ggml-org/llama.cpp to 35c9b1f39ebe5a7bb83986d64415a079218be78d (#9998)
* ⬆️ Update ggml-org/llama.cpp Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(llama-cpp): track upstream rename checkpoint_every_nt -> checkpoint_min_step Upstream llama.cpp renamed common_params::checkpoint_every_nt to checkpoint_min_step and changed its default from 8192 to 256. The semantics also shifted: it used to enforce a fixed checkpoint cadence during prefill, now it sets a minimum spacing between context checkpoints. Track the new field name in grpc-server.cpp and accept the old option names as backward- compatible aliases for users with existing configs. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: claude-code:claude-opus-4-7 --------- Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: mudler <2420543+mudler@users.noreply.github.com> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
1 parent e4c70fc commit 4aad979

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

backend/cpp/llama-cpp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
LLAMA_VERSION?=549b9d84330c327e6791fa812a7d60c0cf63572e
2+
LLAMA_VERSION?=35c9b1f39ebe5a7bb83986d64415a079218be78d
33
LLAMA_REPO?=https://github.com/ggerganov/llama.cpp
44

55
CMAKE_ARGS?=

backend/cpp/llama-cpp/grpc-server.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -570,9 +570,11 @@ static void params_parse(server_context& /*ctx_server*/, const backend::ModelOpt
570570
// kv_unified=false or cache_ram_mib=0, so flipping kv_unified above is
571571
// what actually unlocks it.
572572
params.cache_idle_slots = true;
573-
// checkpoint_every_nt: create a context checkpoint every N tokens during
574-
// prefill (-1 disables). Match upstream's default (8192).
575-
params.checkpoint_every_nt = 8192;
573+
// checkpoint_min_step: minimum spacing between context checkpoints in
574+
// tokens (0 disables the minimum). Match upstream's default (256). This
575+
// field was renamed from `checkpoint_every_nt` in llama.cpp; the semantics
576+
// also shifted from a fixed cadence to a minimum spacing.
577+
params.checkpoint_min_step = 256;
576578

577579
// decode options. Options are in form optname:optvale, or if booleans only optname.
578580
for (int i = 0; i < request->options_size(); i++) {
@@ -746,14 +748,18 @@ static void params_parse(server_context& /*ctx_server*/, const backend::ModelOpt
746748
params.cache_idle_slots = false;
747749
}
748750

749-
// --- prefill checkpoint cadence (upstream -cpent / --checkpoint-every-n-tokens) ---
750-
// -1 disables checkpointing during prefill.
751-
} else if (!strcmp(optname, "checkpoint_every_nt") || !strcmp(optname, "checkpoint_every_n_tokens")) {
751+
// --- minimum context-checkpoint spacing (upstream -cms / --checkpoint-min-step) ---
752+
// 0 disables the minimum-spacing gate. Old option names (`checkpoint_every_nt`,
753+
// `checkpoint_every_n_tokens`) are kept as aliases for backward compatibility
754+
// with existing user configs: upstream renamed the field and shifted its
755+
// semantics from a fixed cadence to a minimum spacing.
756+
} else if (!strcmp(optname, "checkpoint_min_step") || !strcmp(optname, "checkpoint_min_spacing") ||
757+
!strcmp(optname, "checkpoint_every_nt") || !strcmp(optname, "checkpoint_every_n_tokens")) {
752758
if (optval != NULL) {
753759
try {
754-
params.checkpoint_every_nt = std::stoi(optval_str);
760+
params.checkpoint_min_step = std::stoi(optval_str);
755761
} catch (const std::exception& e) {
756-
// If conversion fails, keep default value (8192)
762+
// If conversion fails, keep default value (256)
757763
}
758764
}
759765

docs/content/features/text-generation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ The `llama.cpp` backend supports additional configuration options that can be sp
515515
| `kv_unified` or `unified_kv` | boolean | Use a single unified KV buffer shared across all sequences. Default: `true` (LocalAI override; upstream defaults to `false` but auto-enables it when slot count is auto). **Required for `cache_idle_slots` to work**: without it the server force-disables idle-slot saving at init, and the prompt cache is never written across requests. | `kv_unified:false` |
516516
| `cache_idle_slots` or `idle_slots_cache` | boolean | On a new task, save the previous slot's KV state into the prompt cache (and clear the slot) so a later request with the same prefix can warm-load it. Default: `true`. Auto-disabled by the server if `kv_unified=false` or `cache_ram=0`. | `cache_idle_slots:false` |
517517
| `n_ctx_checkpoints` or `ctx_checkpoints` | integer | Maximum number of context checkpoints per slot (used for partial-prefix recovery, e.g. SWA). Default: `32`. | `ctx_checkpoints:16` |
518-
| `checkpoint_every_nt` or `checkpoint_every_n_tokens` | integer | Create a context checkpoint every N tokens during prefill. `-1` disables checkpointing. Default: `8192`. | `checkpoint_every_nt:4096` |
518+
| `checkpoint_min_step` or `checkpoint_min_spacing` (aliases: `checkpoint_every_nt`, `checkpoint_every_n_tokens`) | integer | Minimum spacing in tokens between context checkpoints. `0` disables the minimum-spacing gate. Default: `256`. (Renamed upstream from `checkpoint_every_nt`; semantics shifted from a fixed cadence to a minimum spacing.) | `checkpoint_min_step:1024` |
519519
| `split_mode` or `sm` | string | How to split the model across multiple GPUs: `none` (single GPU only), `layer` (default — split layers and KV across GPUs), `row` (split rows across GPUs), `tensor` (experimental tensor parallelism — requires `flash_attention: true`, no KV-cache quantization, manually set `context_size`, and a llama.cpp build that includes [#19378](https://github.com/ggml-org/llama.cpp/pull/19378)). | `split_mode:tensor` |
520520

521521
**Example configuration with options:**

0 commit comments

Comments
 (0)