Skip to content

Commit 53bdb18

Browse files
localai-botmudler
andauthored
chore: ⬆️ Update ggml-org/llama.cpp to 7f3f843c31cd32dc4adc10b393342dfee071c332 (#9809)
* ⬆️ Update ggml-org/llama.cpp Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(llama-cpp): adapt to upstream COMMON_SPECULATIVE_TYPE_DRAFT rename ggml-org/llama.cpp#22964 ("spec: update CLI arguments for better consistency") renamed the speculative type enum values: COMMON_SPECULATIVE_TYPE_DRAFT -> COMMON_SPECULATIVE_TYPE_DRAFT_SIMPLE COMMON_SPECULATIVE_TYPE_EAGLE3 -> COMMON_SPECULATIVE_TYPE_DRAFT_EAGLE3 and the registered name strings flipped from underscore- to dash- separated form (e.g. ngram_simple -> ngram-simple), with the bare draft/eagle3 aliases replaced by draft-simple/draft-eagle3. This broke the build with the new LLAMA_VERSION on every variant (vulkan/arm64, darwin and likely all the rest) at grpc-server.cpp:461. Update the upstream branch of the speculative-type fallback to use the new identifier (the LOCALAI_LEGACY_LLAMA_CPP_SPEC fork branch keeps the old name), and normalize spec_type option tokens before passing them to common_speculative_types_from_names so existing model configs that say spec_type:draft / spec_type:ngram_simple keep working. 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 42a8db3 commit 53bdb18

2 files changed

Lines changed: 18 additions & 4 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?=a9883db8ee021cf16783016a60996d41820b5195
2+
LLAMA_VERSION?=7f3f843c31cd32dc4adc10b393342dfee071c332
33
LLAMA_REPO?=https://github.com/ggerganov/llama.cpp
44

55
CMAKE_ARGS?=

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <grpcpp/health_check_service_interface.h>
3333
#include <grpcpp/security/server_credentials.h>
3434
#include <regex>
35+
#include <algorithm>
3536
#include <atomic>
3637
#include <cstdlib>
3738
#include <fstream>
@@ -450,6 +451,8 @@ static void params_parse(server_context& /*ctx_server*/, const backend::ModelOpt
450451
// vector; the turboquant fork still uses the legacy scalar. The
451452
// LOCALAI_LEGACY_LLAMA_CPP_SPEC macro is injected by
452453
// backend/cpp/turboquant/patch-grpc-server.sh for fork builds only.
454+
// Upstream renamed COMMON_SPECULATIVE_TYPE_DRAFT -> ..._DRAFT_SIMPLE
455+
// in ggml-org/llama.cpp#22964; the fork still uses the old name.
453456
#ifdef LOCALAI_LEGACY_LLAMA_CPP_SPEC
454457
if (params.speculative.type == COMMON_SPECULATIVE_TYPE_NONE) {
455458
params.speculative.type = COMMON_SPECULATIVE_TYPE_DRAFT;
@@ -458,7 +461,7 @@ static void params_parse(server_context& /*ctx_server*/, const backend::ModelOpt
458461
const bool no_spec_type = params.speculative.types.empty() ||
459462
(params.speculative.types.size() == 1 && params.speculative.types[0] == COMMON_SPECULATIVE_TYPE_NONE);
460463
if (no_spec_type) {
461-
params.speculative.types = { COMMON_SPECULATIVE_TYPE_DRAFT };
464+
params.speculative.types = { COMMON_SPECULATIVE_TYPE_DRAFT_SIMPLE };
462465
}
463466
#endif
464467
}
@@ -701,16 +704,27 @@ static void params_parse(server_context& /*ctx_server*/, const backend::ModelOpt
701704
// Upstream switched to a vector of types (comma-separated for multi-type
702705
// chaining via common_speculative_types_from_names). We keep accepting a
703706
// single value here, but also tolerate comma-separated lists.
707+
//
708+
// ggml-org/llama.cpp#22964 also renamed the registered names from
709+
// underscore- to dash-separated form, and replaced the bare
710+
// `draft`/`eagle3` aliases with `draft-simple`/`draft-eagle3`. We
711+
// normalize each token here so existing model configs keep working.
712+
auto normalize_spec_name = [](std::string s) -> std::string {
713+
std::replace(s.begin(), s.end(), '_', '-');
714+
if (s == "draft") return "draft-simple";
715+
if (s == "eagle3") return "draft-eagle3";
716+
return s;
717+
};
704718
std::vector<std::string> names;
705719
std::string item;
706720
for (char c : optval_str) {
707721
if (c == ',') {
708-
if (!item.empty()) { names.push_back(item); item.clear(); }
722+
if (!item.empty()) { names.push_back(normalize_spec_name(item)); item.clear(); }
709723
} else {
710724
item.push_back(c);
711725
}
712726
}
713-
if (!item.empty()) names.push_back(item);
727+
if (!item.empty()) names.push_back(normalize_spec_name(item));
714728
auto parsed = common_speculative_types_from_names(names);
715729
if (!parsed.empty()) {
716730
params.speculative.types = parsed;

0 commit comments

Comments
 (0)