Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llama-mmap: use MAP_PRIVATE instead of MAP_SHARED #11798

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iehgit
Copy link

@iehgit iehgit commented Feb 10, 2025

It is not intended to write data to the file for others to read.

It is not intended to write data to the file for others to read.
@IMbackK
Copy link
Collaborator

IMbackK commented Feb 11, 2025

No, thats a terrible idea. MAP_PRIVATE requires the kernel to reserve space for the file in its overcommit total, as the kernel might need to find the ram/swap to store the entire file, if the process with the map decides to write to every page in the file.
This change would thus break llamacpp in cases where there is overcommit/memory pressure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants