mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-27 21:46:57 +02:00
llama: add lazy mode auto, fix iGPU regression
This commit is contained in:
+8
-6
@@ -2736,13 +2736,15 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
|
||||
add_opt(common_arg(
|
||||
{"-lzm", "--lazy-mode"}, "MODE",
|
||||
"on-demand reading of certain tensors, for example per-layer embeddings (default: auto)\n"
|
||||
"- on: read the rows of such tensors from disk on demand instead of keeping them resident (requires mmap)\n"
|
||||
"- auto: on, but only for tensors larger than 4 GiB\n"
|
||||
"- off: always keep them resident",
|
||||
"- auto: large where mmap is supported, off otherwise\n"
|
||||
"- off: always keep them resident\n"
|
||||
"- large: read only large tensors (>4GiB) from disk on demand (requires mmap)\n"
|
||||
"- all: read the all such tensors from disk on demand instead of keeping them resident (requires mmap)",
|
||||
[](common_params & params, const std::string & value) {
|
||||
/**/ if (value == "on") { params.lazy_mode = LLAMA_LAZY_MODE_ON; }
|
||||
else if (value == "auto") { params.lazy_mode = LLAMA_LAZY_MODE_AUTO; }
|
||||
else if (value == "off") { params.lazy_mode = LLAMA_LAZY_MODE_OFF; }
|
||||
/**/ if (value == "auto") { params.lazy_mode = LLAMA_LAZY_MODE_AUTO; }
|
||||
else if (value == "off") { params.lazy_mode = LLAMA_LAZY_MODE_OFF; }
|
||||
else if (value == "large") { params.lazy_mode = LLAMA_LAZY_MODE_LARGE; }
|
||||
else if (value == "all") { params.lazy_mode = LLAMA_LAZY_MODE_ALL; }
|
||||
else { throw std::invalid_argument("invalid value"); }
|
||||
}
|
||||
).set_env("LLAMA_ARG_LAZY_MODE"));
|
||||
|
||||
Reference in New Issue
Block a user