Skip to content

docs(streaming): correct load_hot_layer's "page cache" backing claim - #118

Open
agourakis82 wants to merge 2 commits into
Edge0-AI:mainfrom
agourakis82:fix/hot-layer-anonymous-memory-doc
Open

agourakis82 wants to merge 2 commits into
Edge0-AI:mainfrom
agourakis82:fix/hot-layer-anonymous-memory-doc

Conversation

@agourakis82

@agourakis82 agourakis82 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Addresses point 2 of #106.

load_hot_layer() keeps copied NumPy buffers, not file-backed page cache. Clarify that these buffers survive across requests and are outside MLX active memory. They can be paged out by the OS, but cannot be discarded and reloaded from the checkpoint like clean mapped file pages.

Documentation only: the docstring and inline comment change; execution is unchanged. Rebased onto the current python/ layout.

Validation: default local suite, 79 passed, 1 skipped, 4 slow tests deselected (MLX 0.30.4, mlx-lm 0.31.0). No model-checkpoint benchmark was run.

agourakis82 and others added 2 commits October 4, 2026 11:34
load_hot_layer()'s docstring described the hot-expert backing store as
"page cache" that "survives across requests, counts ZERO toward MLX
active" -- true of the zero-MLX-cost and survives-across-requests
parts, but the backing is built with np.concatenate(rows), which
copies. That makes it resident anonymous process memory, not
mmap'd/file-backed page cache: it is not reclaimable by the OS the way
page cache is, and does not shrink under memory pressure the way the
docstring's "page cache" framing implies.

Fixes the misleading description and the matching inline comment
further down the same method. No behavior change.

Addresses point 2 of Edge0-AI#106 (the README wording in points 1 and 3 was
already addressed in the issue thread by the maintainer).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@agourakis82
agourakis82 force-pushed the fix/hot-layer-anonymous-memory-doc branch from f772bf9 to 538b669 Compare October 4, 2026 14:41
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.

1 participant