Skip to content

Commit

Permalink
feat: Update llama.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
abetlen committed Nov 28, 2024
1 parent 7ecdd94 commit f3fb90b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions llama_cpp/llama_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,9 @@ class llama_model_kv_override(ctypes.Structure):


# struct llama_model_params {
# // NULL-terminated list of devices to use for offloading (if NULL, all available devices are used)
# ggml_backend_dev_t * devices;

# int32_t n_gpu_layers; // number of layers to store in VRAM
# enum llama_split_mode split_mode; // how to split the model across multiple GPUs

Expand Down Expand Up @@ -680,6 +683,7 @@ class llama_model_params(ctypes.Structure):
check_tensors: bool

_fields_ = [
("devices", ctypes.c_void_p), # NOTE: unnused
("n_gpu_layers", ctypes.c_int32),
("split_mode", ctypes.c_int),
("main_gpu", ctypes.c_int32),
Expand Down Expand Up @@ -1898,6 +1902,14 @@ def llama_kv_cache_update(ctx: llama_context_p, /):
...


# // Check if the context supports KV cache shifting
# LLAMA_API bool llama_kv_cache_can_shift(struct llama_context * ctx);
@ctypes_function("llama_kv_cache_can_shift", [llama_context_p_ctypes], ctypes.c_bool)
def llama_kv_cache_can_shift(ctx: llama_context_p, /) -> bool:
"""Check if the context supports KV cache shifting"""
...


# //
# // State / sessions
# //
Expand Down Expand Up @@ -3621,13 +3633,3 @@ def llama_perf_sampler_reset(chain: llama_sampler_p, /):
...


# LLAMA_API void llama_perf_dump_yaml(FILE * stream, const struct llama_context * ctx);
@ctypes_function(
"llama_perf_dump_yaml",
[ctypes.POINTER(ctypes.c_void_p), llama_context_p_ctypes],
None,
)
def llama_perf_dump_yaml(
stream: ctypes.POINTER(ctypes.c_void_p), ctx: llama_context_p, /
):
...
2 changes: 1 addition & 1 deletion vendor/llama.cpp
Submodule llama.cpp updated 231 files

0 comments on commit f3fb90b

Please sign in to comment.