llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

Add mmap pages stats (disabled by default)

Open prusnak opened this issue 2 years ago • 1 comments

Stats can be enabled by changing #if 0 to #if 1.

Stats are printed at the end, when mmap block is being unmapped, but the print_pages_stats can be called at any time between mmap and munmap.

I was just interested to see the stats for my setup after short inference. Not surprisingly 99% pages are resident even after generating 32 tokens.

Feel free to close without merging, if you think this is not very useful.

prusnak avatar Apr 16 '23 16:04 prusnak

mincore is not in POSIX, so in POSIX it is impossible to check if mincore exists. I do not recommend to add this to this project. Btw Warning: mincore() is not specified in POSIX.1-2001, and it is not available on all UNIX implementations. From: https://linux.die.net/man/2/mincore

CoderRC avatar Apr 18 '23 23:04 CoderRC