On-Demand Paging: The Lazy Loader's Secret

Memory mapping's primary RAM-saving trick is loading model weights into physical memory only when specific pages are accessed, not the entire file at once. This significantly reduces initial RAM footprint for large LLMs.

Sources

Open the full topic