Skip to content

Commit 98f7a2d

Browse files
authored
feat: update llama.cpp to 7d7f02875 (#2406)
* feat: update llama.cpp bindings to 7d7f02875 * style: format MTMD ctypes bindings * fix(ci): support Python 3.9 on current Ubuntu runners
1 parent 1652066 commit 98f7a2d

6 files changed

Lines changed: 483 additions & 23 deletions

File tree

‎.github/workflows/test.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Set up Python
2626
uses: actions/setup-python@v6
2727
with:
28-
python-version: "3.9"
28+
python-version: "3.10"
2929
- name: Install huggingface-hub
3030
run: pip install huggingface-hub
3131
- name: Restore model cache
@@ -44,7 +44,7 @@ jobs:
4444
4545
build-linux:
4646
needs: download-model
47-
runs-on: ubuntu-latest
47+
runs-on: ubuntu-24.04
4848
strategy:
4949
matrix:
5050
python-version: ["3.9", "3.10", "3.11", "3.12"]

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
- feat: update llama.cpp to ggml-org/llama.cpp@7d7f02875
11+
1012
## [0.3.36]
1113

1214
- feat: update llama.cpp to ggml-org/llama.cpp@0c1e57098

‎llama_cpp/llama_cpp.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,8 @@ class llama_context_params(ctypes.Structure):
10271027
cb_eval_user_data (ctypes.ctypes.c_void_p): user data for cb_eval
10281028
type_k (int): data type for K cache
10291029
type_v (int): data type for V cache
1030+
moe_cache_size (int): device cache size in bytes for host-resident MoE experts
1031+
moe_cache_cpu_share (float): share of MoE cache misses computed on the CPU
10301032
abort_callback (ggml_abort_callback): abort callback if it returns true, execution of llama_decode() will be aborted
10311033
abort_callback_data (ctypes.ctypes.c_void_p): data for abort_callback
10321034
embeddings (bool): if true, extract embeddings (together with logits)
@@ -1067,6 +1069,8 @@ class llama_context_params(ctypes.Structure):
10671069
cb_eval_user_data: ctypes.c_void_p
10681070
type_k: int
10691071
type_v: int
1072+
moe_cache_size: int
1073+
moe_cache_cpu_share: float
10701074
abort_callback: Callable[[ctypes.c_void_p], bool]
10711075
abort_callback_data: ctypes.c_void_p
10721076
embeddings: bool
@@ -1106,6 +1110,8 @@ class llama_context_params(ctypes.Structure):
11061110
("cb_eval_user_data", ctypes.c_void_p),
11071111
("type_k", ctypes.c_int),
11081112
("type_v", ctypes.c_int),
1113+
("moe_cache_size", ctypes.c_size_t),
1114+
("moe_cache_cpu_share", ctypes.c_float),
11091115
("abort_callback", ggml_abort_callback),
11101116
("abort_callback_data", ctypes.c_void_p),
11111117
("embeddings", ctypes.c_bool),
@@ -5238,6 +5244,8 @@ def llama_log_set(
52385244
# int32_t n_p_eval;
52395245
# int32_t n_eval;
52405246
# int32_t n_reused; // number of times a ggml compute graph had been reused
5247+
# int32_t n_reallocs_same; // reallocations with unchanged graph size
5248+
# int32_t n_reallocs_diff; // reallocations with changed graph size
52415249
# };
52425250
class llama_perf_context_data(ctypes.Structure):
52435251
_fields_ = [
@@ -5248,6 +5256,8 @@ class llama_perf_context_data(ctypes.Structure):
52485256
("n_p_eval", ctypes.c_int32),
52495257
("n_eval", ctypes.c_int32),
52505258
("n_reused", ctypes.c_int32),
5259+
("n_reallocs_same", ctypes.c_int32),
5260+
("n_reallocs_diff", ctypes.c_int32),
52515261
]
52525262

52535263

0 commit comments

Comments
 (0)