From 58e38bdf65f79d2d59f60c0cae206bb98cd332bd Mon Sep 17 00:00:00 2001 From: "Oscar M. Herrera" Date: Tue, 10 Nov 2026 07:55:46 +0100 Subject: [PATCH] llama : apply the iGPU lazy-mode fallback only when mmap is off (#31957) On a device without mmap support, --lazy-mode auto resolved to off even with --load-mode mmap, so llama_prefetch_rows never ran and the rows of the large tensors faulted in one page at a time. Resolve it to off only when mmap is off; the default iGPU load path is unchanged. Fixes #31943 --- src/llama-model.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llama-model.cpp b/src/llama-model.cpp index 72639b155..dbc91a137 100644 --- a/src/llama-model.cpp +++ b/src/llama-model.cpp @@ -1697,8 +1697,8 @@ bool llama_model_base::load_tensors(llama_model_loader & ml) { } } - // resolve AUTO on systems without mmap support (e.g. iGPUs): fall back to OFF; see #28160 - if (ml.lazy.mode == LLAMA_LAZY_MODE_AUTO) { + // resolve AUTO on systems without mmap support (e.g. iGPUs): fall back to OFF unless mmap is in use; see #28160, #31943 + if (ml.lazy.mode == LLAMA_LAZY_MODE_AUTO && !ml.use_mmap) { for (const auto & dev : devices) { ggml_backend_dev_props props; ggml_backend_dev_get_props(dev.dev, &props);