News for hackers. Stuff that matters.
Re:Using mmap to make LLaMA load faster by blitzkrieg3 on Wednesday April 05, 2023 @01:26PM (#35457566)
mmap() will keep things in memory after first loading, but the page cache will _also_ keep things in memory after first loading. The difference is in order to re-use that you still need to read the file and store yourself (requiring 2x memory), instead of just doing a memory access. This has two consequences:

* 2x memory. A 20G data set requires 40G (20 for page cache and 20 for LLaMA)

* Things would be _even slower_ if they weren't in page cache after first loading. mmap is fast because it does not require a copy and reduces the working set size

Re:Using mmap to make LLaMA load faster by IshKebab on Wednesday April 05, 2023 @04:08PM (#35459731)
Why would you need to keep the entire file in cache though?