Skip to content

Commit f750fa9

Browse files
committed
feat: update llama.cpp to 92e854ab8
1 parent 9be3cd1 commit f750fa9

5 files changed

Lines changed: 33 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ 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@92e854ab8
1011
- fix: preserve recurrent/hybrid model state when the full prompt is already cached by @allthatido and @abetlen in #2306
1112

1213
## [0.3.31]

llama_cpp/llama_cpp.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,6 +1744,11 @@ def llama_model_n_embd_out(model: llama_model_p, /) -> int:
17441744
def llama_model_n_layer(model: llama_model_p, /) -> int: ...
17451745

17461746

1747+
# LLAMA_API int32_t llama_model_n_layer_nextn(const struct llama_model * model);
1748+
@ctypes_function("llama_model_n_layer_nextn", [llama_model_p_ctypes], ctypes.c_int32)
1749+
def llama_model_n_layer_nextn(model: llama_model_p, /) -> int: ...
1750+
1751+
17471752
# LLAMA_API int32_t llama_model_n_head (const struct llama_model * model);
17481753
@ctypes_function("llama_model_n_head", [llama_model_p_ctypes], ctypes.c_int32)
17491754
def llama_model_n_head(model: llama_model_p, /) -> int: ...

llama_cpp/llama_cpp_ext.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,25 @@ def llama_set_embeddings_nextn(
6262
...
6363

6464

65+
# LLAMA_API void llama_set_nextn_layer_offset(struct llama_context * ctx, int32_t offset);
66+
@_ctypes_function_from_names(
67+
(
68+
"llama_set_nextn_layer_offset",
69+
"_Z28llama_set_nextn_layer_offsetP13llama_contexti",
70+
"?llama_set_nextn_layer_offset@@YAXPEAUllama_context@@H@Z",
71+
),
72+
[llama_cpp.llama_context_p_ctypes, ctypes.c_int32],
73+
None,
74+
)
75+
def llama_set_nextn_layer_offset(
76+
ctx: llama_cpp.llama_context_p,
77+
offset: Union[ctypes.c_int32, int],
78+
/,
79+
):
80+
"""Select which appended NextN block the decoder MTP graph runs."""
81+
...
82+
83+
6584
# LLAMA_API float * llama_get_embeddings_nextn(struct llama_context * ctx);
6685
@_ctypes_function_from_names(
6786
(

llama_cpp/mtmd_cpp.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
)
2121
import pathlib
2222
from typing import (
23+
Callable,
2324
Union,
2425
NewType,
2526
Optional,
@@ -84,6 +85,8 @@
8485
MTMD_INPUT_CHUNK_TYPE_IMAGE = 1
8586
MTMD_INPUT_CHUNK_TYPE_AUDIO = 2
8687

88+
mtmd_progress_callback = CFUNCTYPE(c_bool, c_float, c_void_p)
89+
8790

8891
# Structures
8992
class mtmd_context_params(Structure):
@@ -106,6 +109,8 @@ class mtmd_context_params(Structure):
106109
cb_eval: llama_cpp.ggml_backend_sched_eval_callback
107110
cb_eval_user_data: c_void_p
108111
batch_max_tokens: int
112+
progress_callback: Callable[[float, c_void_p], bool]
113+
progress_callback_user_data: c_void_p
109114

110115
_fields_ = [
111116
("use_gpu", c_bool),
@@ -120,6 +125,8 @@ class mtmd_context_params(Structure):
120125
("cb_eval", llama_cpp.ggml_backend_sched_eval_callback),
121126
("cb_eval_user_data", c_void_p),
122127
("batch_max_tokens", c_int),
128+
("progress_callback", mtmd_progress_callback),
129+
("progress_callback_user_data", c_void_p),
123130
]
124131

125132

vendor/llama.cpp

Submodule llama.cpp updated 128 files

0 commit comments

Comments
 (0)