diff --git a/src/llama-model-loader.cpp b/src/llama-model-loader.cpp index ded2bca3cc..9db3140647 100644 --- a/src/llama-model-loader.cpp +++ b/src/llama-model-loader.cpp @@ -1282,7 +1282,7 @@ struct ggml_tensor * llama_model_loader::create_tensor( return NULL; } - if ((flags & TENSOR_GET_ROW_LAZY) && use_mmap && tensor_read_lazy != LLAMA_TENSOR_READ_LAZY_OFF) { + if ((flags & TENSOR_READ_LAZY) && use_mmap && tensor_read_lazy != LLAMA_TENSOR_READ_LAZY_OFF) { // in auto mode, small tensors are cheap enough to keep resident constexpr size_t auto_lazy_min_size = 4ull * 1024 * 1024 * 1024; if (tensor_read_lazy == LLAMA_TENSOR_READ_LAZY_ON || ggml_nbytes(cur) > auto_lazy_min_size) { diff --git a/src/llama-model-loader.h b/src/llama-model-loader.h index 5b78ece484..9898d7f621 100644 --- a/src/llama-model-loader.h +++ b/src/llama-model-loader.h @@ -68,7 +68,7 @@ struct llama_model_loader { static const int TENSOR_SKIP = 1 << 2; static const int TENSOR_SKIP_IF_VIRTUAL = 1 << 3; static const int TENSOR_ALLOW_RESHAPE = 1 << 4; - static const int TENSOR_GET_ROW_LAZY = 1 << 5; // read rows on demand instead of loading whole tensor; requires mmap for now + static const int TENSOR_READ_LAZY = 1 << 5; // read rows on demand instead of loading whole tensor; requires mmap for now int n_kv = 0; int n_tensors = 0; @@ -92,7 +92,7 @@ struct llama_model_loader { llama_mmaps mappings; - // byte ranges of TENSOR_GET_ROW_LAZY tensors, per file index + // byte ranges of TENSOR_READ_LAZY tensors, per file index std::map>> lazy_tensor_ranges; std::map weights_map; diff --git a/src/llama-model.cpp b/src/llama-model.cpp index 578b44cea6..ad50093e41 100644 --- a/src/llama-model.cpp +++ b/src/llama-model.cpp @@ -3069,7 +3069,7 @@ llama_model_base::llama_model_base(const struct llama_model_params & params) : l TENSOR_SKIP (llama_model_loader::TENSOR_SKIP), TENSOR_SKIP_IF_VIRTUAL(llama_model_loader::TENSOR_SKIP_IF_VIRTUAL), TENSOR_ALLOW_RESHAPE (llama_model_loader::TENSOR_ALLOW_RESHAPE), - TENSOR_GET_ROW_LAZY (llama_model_loader::TENSOR_GET_ROW_LAZY) {} + TENSOR_READ_LAZY (llama_model_loader::TENSOR_READ_LAZY) {} ggml_tensor * llama_model_base::create_tensor(const LLM_TN_IMPL & tn, const std::initializer_list & ne, int flags) { GGML_ASSERT(ml != nullptr); diff --git a/src/llama-model.h b/src/llama-model.h index e8a7fce22d..25898ad4af 100644 --- a/src/llama-model.h +++ b/src/llama-model.h @@ -756,7 +756,7 @@ struct llama_model_base : public llama_model { const int TENSOR_SKIP; const int TENSOR_SKIP_IF_VIRTUAL; const int TENSOR_ALLOW_RESHAPE; - const int TENSOR_GET_ROW_LAZY; + const int TENSOR_READ_LAZY; explicit llama_model_base(const llama_model_params & params); virtual ~llama_model_base() = default; diff --git a/src/models/gemma4.cpp b/src/models/gemma4.cpp index 3d0e5d3235..aa518c6df5 100644 --- a/src/models/gemma4.cpp +++ b/src/models/gemma4.cpp @@ -50,7 +50,7 @@ void llama_model_gemma4::load_arch_tensors(llama_model_loader &) { tok_embd = create_tensor(tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab}, 0); if (n_embd_per_layer > 0) { - per_layer_tok_embd = create_tensor(tn(LLM_TENSOR_PER_LAYER_TOKEN_EMBD, "weight"), {n_embd_per_layer * n_layer, n_vocab}, TENSOR_GET_ROW_LAZY); + per_layer_tok_embd = create_tensor(tn(LLM_TENSOR_PER_LAYER_TOKEN_EMBD, "weight"), {n_embd_per_layer * n_layer, n_vocab}, TENSOR_READ_LAZY); per_layer_model_proj = create_tensor(tn(LLM_TENSOR_PER_LAYER_MODEL_PROJ, "weight", 0), {n_embd, n_embd_per_layer * n_layer}, 0); per_layer_proj_norm = create_tensor(tn(LLM_TENSOR_PER_LAYER_PROJ_NORM, "weight", 0), {n_embd_per_layer}, 0); }