#[repr(u32)]pub enum LlamaLazyMode {
Off = 0,
Auto = 1,
On = 2,
}Expand description
Whether tensors the architecture marks as lazy are read on demand rather than up front.
Only tensors the model architecture flags carry this at all — today that is
Gemma-4’s per-layer token embedding and Qwen4Exp’s PLE rows — so on every
other architecture the setting has no effect. Lazy reading always needs
mmap; without it llama.cpp warns and loads the tensor in full regardless.
llama_lazy_mode is an unsigned enum upstream (all discriminants are
non-negative), unlike the signed LlamaLoadMode.
Variants§
Off = 0
Never read lazily — always pull the whole tensor up front.
Auto = 1
Read lazily only for marked tensors larger than 4 GiB. llama.cpp’s
default, and downgraded to LlamaLazyMode::Off at load time if any
backend device lacks mmap support (iGPUs, for instance).
On = 2
Read every marked tensor’s rows on demand, whatever its size. Trades I/O for resident memory; the 4 GiB floor exists because the per-read overhead is not worth it on small tensors.
Trait Implementations§
Source§impl Clone for LlamaLazyMode
impl Clone for LlamaLazyMode
Source§fn clone(&self) -> LlamaLazyMode
fn clone(&self) -> LlamaLazyMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more