News for hackers. Stuff that matters.
Re:Using mmap to make LLaMA load faster by gmork13 on Wednesday April 05, 2023 @01:17PM (#35457435)
This is from today apr 5 saying the mmap change loads twice as big models with x100 speed up - is this not a blatant lie?

Wasn’t it discovered last week that loading larger models was an error in measurement and the speed up was from keeping things in memory after the first loading?

Please do correct me if I’m wrong.

Re:Using mmap to make LLaMA load faster by saurik on Wednesday April 05, 2023 @01:24PM (#35457545)
Justine knows this and it is stated right there on the page:

> The first time you load a model after rebooting your computer, it's still going to go slow, because it has to load the weights from disk. However each time it's loaded afterwards, it should be fast (at least until memory pressure causes your file cache to be evicted).

Re:Using mmap to make LLaMA load faster by Zuiii on Wednesday April 05, 2023 @11:59PM (#35463957)
Is the initial load via mmap slower than the non mmap approach? If it is, why is it slower?
Re:Using mmap to make LLaMA load faster by jerf on Wednesday April 05, 2023 @01:23PM (#35457520)
"Blatant lie" seems a bit strong. Running a large model for a second time in a row is a pretty common use case and that speedup strikes me as real in that common case. Attribution may have been wrong but the time saved is real.
Re:Using mmap to make LLaMA load faster by gmork13 on Wednesday April 05, 2023 @03:54PM (#35459576)
So it can load twice as large models somehow?
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?