Repository navigation
Conversation
Assisted-by: OpenAI coding assistant
bri-prism
reviewed
Nov 25, 2026
bri-prism
left a comment
Collaborator
There was a problem hiding this comment.
Thanks, the change is small and makes sense: retiring only the full pages inside the fragment and
keeping the view mapped is a safe way to get the POSIX behavior on Windows.
Since the description says this branch has not been built, could you build it on Windows (shared and
static) and run test-mmap-win32 and the existing tests? I want to check the test compiles cleanly
when it pulls llama-mmap.cpp and llama-impl.cpp into the executable with a shared llama build.
Also, nothing here depends on our fork. Would you consider sending it to ggml-org/llama.cpp first?
We would pick it up from there on our next upstream merge, which keeps our mmap code in sync with theirs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Retire unused Windows file-mapping pages from the working set when
llama_mmap::unmap_fragmentis called. The Windows implementation currently does nothing, so pages copied to an accelerator can remain resident.VirtualUnlockonly for complete pages inside the requested fragment; treatERROR_NOT_LOCKEDas the expected unlocked-page case.QueryWorkingSetEx, plus test instructions.This PR is independent of the tokenizer, attention and embedded-adapter changes in the original research branch. It is mechanically extracted from
JohnUzoka/llama.cpp@3d1930a, whose based7b2896is an ancestor of the currentprism; this branch starts at6447906.Additional information
Recorded validation, not a new test run
The 2026-11-12 frozen-runtime record records the failing-before reproduction and four passing native checks after the fix. That aggregate is not four mmap-specific cases. The minimal patch and before/after source archive preserve the tested implementation.
No build, tests, linters or formatters were run during this extraction. The newly separated branch has not been independently built. No general RAM, speed or model-quality improvement is claimed; retiring working-set pages does not unmap the Windows view or prevent subsequent refaults.
Requirements