llama.cpp
197ee652 - llama : simplify mmap session cache with fixed-size files

Commit
321 days ago
llama : simplify mmap session cache with fixed-size files - Add llama_state_size_max() to calculate maximum session file size - Pre-allocate session files to max size, eliminating resize logic - Implement true copy-on-write using MAP_PRIVATE (POSIX) and FILE_MAP_COPY (Windows) for lazy page copying - Remove llama_state_mmap_open_rw_sized() (no longer needed) - Simplify llama_mmap_rw class by removing resize() method - Update documentation with new API and usage patterns Breaking change: Session files are now pre-allocated to maximum size based on context length. This trades disk space for simpler code and true zero-copy COW semantics.
Author
Parents
Loading