You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 27fddd0
Browse filesBrowse the repository at this point in the historyBrowse files
# LLAMA_TENSOR_READ_LAZY_OFF = 0, // always read the whole tensor up front
541
+
# LLAMA_TENSOR_READ_LAZY_AUTO = 1, // lazy only for marked tensors larger than 4 GiB (requires mmap)
542
+
# LLAMA_TENSOR_READ_LAZY_ON = 2, // read the rows of tensors marked by the arch on demand (requires mmap)
543
+
# };
544
+
classllama_tensor_read_lazy(enum.IntEnum):
545
+
LLAMA_TENSOR_READ_LAZY_OFF=0# always read the whole tensor up front
546
+
LLAMA_TENSOR_READ_LAZY_AUTO=1# lazy only for marked tensors larger than 4 GiB (requires mmap)
547
+
LLAMA_TENSOR_READ_LAZY_ON=2# read the rows of tensors marked by the arch on demand (requires mmap)
548
+
539
549
# enum llama_context_type {
540
550
# LLAMA_CONTEXT_TYPE_DEFAULT = 0,
541
551
# LLAMA_CONTEXT_TYPE_MTP = 1,
@@ -783,6 +793,8 @@ class llama_model_tensor_buft_override(ctypes.Structure):
783
793
# enum llama_split_mode split_mode; // how to split the model across multiple GPUs
784
794
# enum llama_load_mode load_mode; // how to load the model
785
795
796
+
# enum llama_tensor_read_lazy tensor_read_lazy; // on-demand reading of tensors marked by the arch
797
+
786
798
# // the GPU that is used for the entire model when split_mode is LLAMA_SPLIT_MODE_NONE
787
799
# int32_t main_gpu;
788
800
@@ -817,6 +829,7 @@ class llama_model_params(ctypes.Structure):
817
829
n_gpu_layers (int): number of layers to store in VRAM, a negative value means all layers
818
830
split_mode (int): how to split the model across multiple GPUs
819
831
load_mode (int): how to load the model
832
+
tensor_read_lazy (int): on-demand reading of tensors marked by the arch
820
833
main_gpu (int): the GPU that is used for the entire model. main_gpu interpretation depends on split_mode: LLAMA_SPLIT_NONE: the GPU that is used for the entire model LLAMA_SPLIT_ROW: the GPU that is used for small tensors and intermediate results LLAMA_SPLIT_LAYER: ignored
821
834
tensor_split (ctypes.Array[ctypes.ctypes.c_float]): proportion of the model (layers or rows) to offload to each GPU, size: llama_max_devices()
822
835
progress_callback (llama_progress_callback): called with a progress value between 0.0 and 1.0. Pass NULL to disable. If the provided progress_callback returns true, model loading continues. If it returns false, model loading is immediately aborted.
@@ -835,6 +848,7 @@ class llama_model_params(ctypes.Structure):
0 commit comments